Commit Graph

633 Commits

Author SHA1 Message Date
Nicholas Nethercote b81c7c8bd1 Remove SmallStr.
It no longer has any uses. If it's needed in the future, it can be
easily reinstated. Or a crate such as `smallstr` can be used, much like
we use `smallvec`.
2023-06-29 11:45:52 +10:00
Guillaume Gomez dffa5f8e8f Rollup merge of #112538 - ndrewxie:issue-84447-partial-1, r=compiler-errors
Removed unnecessary &String -> &str, now that &String implements StableOrd as well

Applied a few nits suggested by lcnr to PR #110040 (nits can be found [here](https://github.com/rust-lang/rust/pull/110040#pullrequestreview-1469452191).)

Making a new PR because the old one was already merged, and given that this just applies changes that were already suggested, reviewing it should be fairly open-and-shut.
2023-06-21 20:00:49 +02:00
Camille GILLOT 70d7071a1d Make closure_saved_names_of_captured_variables a query. 2023-06-19 16:50:52 +00:00
Andrew Xie e168d92494 Applied nits 2023-06-11 22:45:04 -04:00
Michael Goulet 90288a0270 Don't print Interned or PrivateZst 2023-06-09 00:20:37 +00:00
Andrew Xie 0fd2d91518 Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems 2023-06-08 00:38:50 -04:00
Andrew Xie 72899f76fa Fixed to_sorted => to_sorted_stable_ord 2023-06-05 00:16:20 -04:00
Andrew Xie 3eeb171593 Fixed unord mistake 2023-06-04 21:55:32 -04:00
Andrew Xie 7587245f63 Fixed failing test + minor cleanup 2023-06-04 21:55:32 -04:00
Arlo Siemsen 6503a3e799 Update dependencies with reported vulnerabilities
bumpalo 3.12.1 (yanked)
  * updated to 3.13.0
tokio 1.8.4 - https://rustsec.org/advisories/RUSTSEC-2023-0001
  * updated to 1.28.2
remove_dir_all 0.5.3 - https://rustsec.org/advisories/RUSTSEC-2023-0018
  * removed by using the standard library function in `rust-installer` instead and updating to `tempfile@3.5.0` (which also removes the dependency).
2023-06-02 12:34:01 -05:00
bors dcd320827c Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot
diagnostics: exclude indirect private deps from trait impl suggest

Fixes #88696
2023-05-31 13:47:36 +00:00
John Kåre Alsaker 847f53614b Add some comments 2023-05-28 15:54:52 +02:00
John Kåre Alsaker 5ca9d877d8 Don't access self.mask with a single shard 2023-05-28 15:47:44 +02:00
John Kåre Alsaker 6e7aeb034a Use only one shard with a single thread 2023-05-28 14:08:59 +02:00
Michael Howell b5839b50f8 rustc_data_structures: sync and atomic consistency
Co-authored-by: @lukas-code
2023-05-25 15:18:05 -07:00
Michael Howell 77545c9465 rustc_metadata: specialize private_dep flag with fetch_and 2023-05-25 08:15:05 -07:00
Michael Howell 12b0059095 rustc_metadata: use configurable AtomicBool for privateness flag
This switches to using a `Cell` for single-threaded rustc.
2023-05-25 08:15:04 -07:00
Matthias Krüger aa55752df2 Rollup merge of #111875 - WaffleLapkin:defer_on_drop, r=Nilstrieb
Don't leak the function that is called on drop

It probably wasn't causing problems anyway, but still, a `// this leaks, please don't pass anything that owns memory` is not sustainable.

I could implement a version which does not require `Option`, but it would require `unsafe`, at which point it's probably not worth it.
2023-05-25 08:01:08 +02:00
Manish Goregaokar 7590e4f21d Rollup merge of #111912 - WaffleLapkin:is_some_and_in_the_compiler, r=petrochenkov
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler

`.is_some_and(..)`/`.is_ok_and(..)` replace `.map_or(false, ..)` and `.map(..).unwrap_or(false)`, making the code more readable.

This PR is a sibling of https://github.com/rust-lang/rust/pull/111873#issuecomment-1561316515
2023-05-24 15:05:05 -07:00
bors ee9b78acc2 Auto merge of #111673 - cjgillot:dominator-preprocess, r=cjgillot,tmiasko
Preprocess and cache dominator tree

Preprocessing dominators has a very strong effect for https://github.com/rust-lang/rust/pull/111344.
That pass checks that assignments dominate their uses repeatedly. Using the unprocessed dominator tree caused a quadratic runtime (number of bbs x depth of the dominator tree).

This PR also caches the dominator tree and the pre-processed dominators in the MIR cfg cache.

Rebase of https://github.com/rust-lang/rust/pull/107157
cc `@tmiasko`
2023-05-24 16:18:21 +00:00
Maybe Waffle cb2d555147 Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
Maybe Waffle 93942c5f65 Don't leak the function that is called on drop 2023-05-23 14:53:36 +00:00
bors 4a5a2e2ab5 Auto merge of #111596 - cjgillot:dominator-bucket, r=Mark-Simulacrum
Process current bucket instead of parent's bucket when starting loop for dominators.

The linked paper by Georgiadis suggests in §2.2.3 to process `bucket[w]` when beginning the loop, instead of `bucket[parent[w]]` when finishing it.

In the test case, we correctly computed `idom[2] = 0` and `sdom[3] = 1`, but the algorithm returned `idom[3] = 1`, instead of the correct value 0, because of the path 0-7-2-3.

This provoked LLVM ICE in https://github.com/rust-lang/rust/pull/111061#issuecomment-1546912112. LLVM checks that SSA assignments dominate uses using its own implementation of Lengauer-Tarjan, and saw case where rustc was breaking the dominance property.

r? `@Mark-Simulacrum`
2023-05-20 07:41:15 +00:00
Camille GILLOT b714284e51 Revert spurious changes. 2023-05-18 14:36:13 +00:00
Dylan DPC 9ede663928 Rollup merge of #111707 - nnethercote:rm-WorkerLocal-Vec, r=compiler-errors
Remove unused `impl<T> WorkerLocal<Vec<T>>`.

cc ``@SparrowLii`` ``@Zoxc``
2023-05-18 17:37:10 +05:30
Nicholas Nethercote 60852ad416 Remove unused impl<T> WorkerLocal<Vec<T>>. 2023-05-18 13:14:45 +10:00
Camille GILLOT ae391bdbae Merge DominatorTree and Dominators. 2023-05-17 10:37:29 +00:00
Camille GILLOT e3b315218a Typo. 2023-05-17 10:29:12 +00:00
Camille GILLOT 99644fa0ad Remove outdated comment. 2023-05-17 10:26:04 +00:00
Tomasz Miąsko 2c634e4595 Preprocess dominator tree to answer queries in O(1) 2023-05-17 09:36:12 +00:00
Dylan DPC bd657951f9 Rollup merge of #110145 - WaffleLapkin:share_slice_of_bytes, r=Nilstrieb
Share slice of bytes

r? `@Nilstrieb`
cc `@noamtashma`
2023-05-17 11:13:55 +05:30
Maybe Waffle a1de2e343d Fixup comments 2023-05-16 12:09:24 +00:00
Maybe Waffle 80b6d4a8b2 Remove MetadataRef type alias 2023-05-16 11:55:47 +00:00
Maybe Waffle 044228637f Switch OwnedSlice to use Lrc & remove Lrc from MetadataBlob 2023-05-16 11:43:27 +00:00
Maybe Waffle 7430825d1a Merge MetadataRef type aliases 2023-05-16 11:43:25 +00:00
Camille GILLOT da43a402a2 Process current bucket instead of parent's bucket when starting loop for dominators. 2023-05-15 16:16:34 +00:00
Tomasz Miąsko 1c6fb1dddb Start node has no immediate dominator
Change the immediate_dominator return type to Option, and use None to
indicate that node has no immediate dominator.

Also fix the issue where the start node would be returned as its own
immediate dominator.
2023-05-14 16:09:58 +02:00
bors e76b131541 Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot
Introduce `DynSend` and `DynSync` auto trait for parallel compiler

part of parallel-rustc #101566

This PR introduces `DynSend / DynSync` trait and `FromDyn / IntoDyn` structure in rustc_data_structure::marker. `FromDyn` can dynamically check data structures for thread safety when switching to parallel environments (such as calling `par_for_each_in`). This happens only when `-Z threads > 1` so it doesn't affect single-threaded mode's compile efficiency.

r? `@cjgillot`
2023-05-13 13:47:53 +00:00
Matthias Krüger a908cb48de Rollup merge of #111393 - klensy:win-0.48, r=oli-obk
bump windows crate 0.46 -> 0.48

This drops duped version of crate(0.46), reduces `rustc_driver.dll` ~800kb and reduces exported functions number from 26k to 22k.

Also while here, added `tidy-alphabetical` sorting to lists in tidy allowed lists.
2023-05-12 07:11:12 +02:00
klensy 4a99c6a6e7 bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
Dylan DPC 85841b9abe Rollup merge of #111252 - matthewjasper:min-spec-improvements, r=compiler-errors
Min specialization improvements

- Don't allow specialization impls with no items, such implementations are probably not correct and only occur as mistakes in the compiler and standard library
- Fix a missing normalization call
- Adds spans for lifetime errors from overly general specializations

Closes #79457
Closes #109815
2023-05-09 12:33:46 +05:30
Nilstrieb f0be07a6c9 Use smaller ints for bitflags 2023-05-07 18:24:46 +02:00
SparrowLii 6fecfca352 add DynSend / DynSync for CopyTaggedPtr 2023-05-06 10:23:51 +08:00
SparrowLii 6d94d3a1f1 correct import of owned_slice 2023-05-06 09:34:55 +08:00
SparrowLii 82157f073d correct literals for dyn thread safe 2023-05-06 09:34:53 +08:00
SparrowLii 79e29c5e37 rename relative names in sync 2023-05-06 09:34:24 +08:00
SparrowLii c522bb181d fix parallel! 2023-05-06 09:34:22 +08:00
SparrowLii df51076631 fix some nits 2023-05-06 09:34:21 +08:00
SparrowLii ed1f8daeef introduce DynSend and DynSync auto trait 2023-05-06 09:34:18 +08:00
Matthew Jasper d46428d100 Disallow (min) specialization imps with no items
Such implementations are usually mistakes and are not used in the
compiler or standard library (after this commit) so forbid them with
`min_specialization`.
2023-05-05 16:19:18 +01:00