Commit Graph

864 Commits

Author SHA1 Message Date
Nicholas Nethercote
3eadc6844b Update itertools to 0.11.
Because the API for `with_position` improved in 0.11 and I want to use
it.
2023-11-22 08:13:21 +11:00
Nilstrieb
21a870515b Fix clippy::needless_borrow in the compiler
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
Mark Rousskov
db3e2bacb6 Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
cui fliter
a44a4edc0e Fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-11-14 23:06:50 +08:00
bors
d8dbf7ca0e Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov
Make `FatalErrorMarker` lower priority than other panics

This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs.

This fixes https://github.com/rust-lang/rust/issues/116659.
2023-11-09 00:39:02 +00:00
bors
f9b644636f Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwco
enable parallel rustc front end in nightly builds

Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does:
1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option.

2. Set it up to serial front end for beta/stable builds via bootstrap.

3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel.

r? `@oli-obk`

cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06 07:41:22 +00:00
SparrowLii
f2a40e99ff use portable AtomicU64 for powerPC and MIPS 2023-11-06 09:58:51 +08:00
Taras Tsugrii
97bc528877
Remove invariant comments 2023-11-05 17:35:37 -06:00
John Kåre Alsaker
ff1858e2aa Make FatalErrorMarker lower priority than other panics 2023-11-03 19:46:00 +01:00
Josh Stone
3984914aff Use filter_map in try_par_for_each_in
This simplifies the expression, especially for the rayon part, and also
lets us drop the `E: Copy` constraint.
2023-11-03 09:17:16 -07:00
Nicholas Nethercote
8ff624a9f2 Clean up rustc_*/Cargo.toml.
- Sort dependencies and features sections.
- Add `tidy` markers to the sorted sections so they stay sorted.
- Remove empty `[lib`] sections.
- Remove "See more keys..." comments.

Excluded files:
- rustc_codegen_{cranelift,gcc}, because they're external.
- rustc_lexer, because it has external use.
- stable_mir, because it has external use.
2023-10-30 08:46:02 +11:00
bors
a56bd2b944 Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot
Avoid a `track_errors` by bubbling up most errors from `check_well_formed`

I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them.

This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`)

cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-23 09:59:40 +00:00
Oli Scherer
fd9ef69adf Avoid a track_errors by bubbling up most errors from check_well_formed 2023-10-20 08:46:27 +00:00
Caio
6379013876 Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
bors
862bba6093 Auto merge of #116830 - nnethercote:rustc_type_ir, r=compiler-errors
Remove `IdFunctor` trait.

It's defined in `rustc_data_structures` but is only used in
`rustc_type_ir`. The code is shorter and easier to read if we remove
this layer of abstraction and just do the things directly where they are
needed.

r? `@BoxyUwU`
2023-10-18 03:55:36 +00:00
Nicholas Nethercote
847c8ba70d Remove IdFunctor trait.
It's defined in `rustc_data_structures` but is only used in
`rustc_type_ir`. The code is shorter and easier to read if we remove
this layer of abstraction and just do the things directly where they are
needed.
2023-10-17 16:26:35 +11:00
Nicholas Nethercote
4175c9b595 Remove unused features from rustc_data_structures. 2023-10-17 16:26:12 +11:00
Michael Howell
2ff2624722 docs: add Rust logo to more compiler crates
c6e6ecb1af added it to some of the
compiler's crates, but avoided adding it to all of them to reduce
bit-rot. This commit adds to more.
2023-10-16 15:38:08 -07:00
Tomasz Miąsko
b61a6d59e4 Remove unused dominator iterator 2023-10-10 21:39:59 +02:00
Tomasz Miąsko
0528d378b6 Optimize dominators for small path graphs
Generalizes the small dominators approach from #107449.
2023-10-05 23:45:59 +02:00
Tomasz Miąsko
ba694e301c Remove redundant Dominators::start_node field 2023-10-05 23:45:58 +02:00
Tomasz Miąsko
a8ec7ddf0e Test immediate dominators using public API 2023-10-05 23:45:58 +02:00
John Kåre Alsaker
2c507cae36 Rename cold_path to outline 2023-09-25 22:54:07 +02:00
Florian Schmiderer
3409ca65d8 Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointers
instead of &'static mut and provides safe interface to create/dispose
it.
2023-09-24 21:11:37 +02:00
bors
f73d376fb6 Auto merge of #115230 - Vtewari2311:mod-hurd-latest, r=b-naber
added support for GNU/Hurd

adding support for i686-unknown-hurd-gnu
2023-09-21 19:24:01 +00:00
Samuel Thibault
dcea7709f2 added support for GNU/Hurd 2023-09-21 17:31:25 +02:00
Ralf Jung
57444cf9f3 use pretty_print_const_value from MIR constant 'extra' printing 2023-09-19 11:06:32 +02:00
Zalathar
01b67f4b26 coverage: Simplify sorting of coverage spans extracted from MIR
Switching to `Ordering::then_with` makes control-flow less complicated, and
there is no need to use `partial_cmp` here.
2023-09-18 23:15:25 +10:00
Matthias Krüger
f3cc59b741
Rollup merge of #115548 - Zoxc:parallel-extract, r=wesleywiser
Extract parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule

This extracts parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule. This cuts down on the size of the large `cfg_if!` in `sync` and makes it easier to compare between serial and parallel variants.
2023-09-11 21:16:20 +02:00
bors
9b72cc9abf Auto merge of #115388 - Zoxc:sharded-lock, r=SparrowLii
Add optimized lock methods for `Sharded` and refactor `Lock`

This adds methods to `Sharded` which pick a shard and also locks it. These branch on parallelism just once instead of twice, improving performance.

Benchmark for `cfg(parallel_compiler)` and 1 thread:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.6461s</td><td align="right">1.6345s</td><td align="right"> -0.70%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2414s</td><td align="right">0.2394s</td><td align="right"> -0.83%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9205s</td><td align="right">0.9143s</td><td align="right"> -0.67%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.4981s</td><td align="right">1.4869s</td><td align="right"> -0.75%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.7629s</td><td align="right">5.7256s</td><td align="right"> -0.65%</td></tr><tr><td>Total</td><td align="right">10.0690s</td><td align="right">10.0008s</td><td align="right"> -0.68%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9928s</td><td align="right"> -0.72%</td></tr></table>

cc `@SparrowLii`
2023-09-11 01:43:29 +00:00
John Kåre Alsaker
1d8fdc0332 Use FreezeLock for CStore 2023-09-09 16:02:11 +02:00
John Kåre Alsaker
c83eba9251 Add Freeze::clone 2023-09-08 14:14:57 +02:00
John Kåre Alsaker
9690142bef Remove the LockMode enum and dispatch 2023-09-08 10:15:12 +02:00
John Kåre Alsaker
61cc00d238 Refactor Lock implementation 2023-09-08 08:48:44 +02:00
John Kåre Alsaker
8fc160b742 Add optimized lock methods for Sharded 2023-09-08 08:48:44 +02:00
John Kåre Alsaker
f49382c050 Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00
John Kåre Alsaker
c5996b80be Use Freeze for SourceFile.external_src 2023-09-07 13:04:23 +02:00
John Kåre Alsaker
35e8b67fc2 Use a reference to the lock in the guards 2023-09-06 11:44:06 +02:00
John Kåre Alsaker
fe614712dd Extract parallel operations in rustc_data_structures::sync into a new parallel submodule 2023-09-06 09:47:34 +02:00
John Kåre Alsaker
a3ad045ea4 Rename Freeze to FreezeLock 2023-09-02 08:14:06 +02:00
John Kåre Alsaker
50f0d666d3 Add some comments 2023-09-02 08:13:07 +02:00
John Kåre Alsaker
25884ec9be Use RwLock for Freeze 2023-09-02 08:13:07 +02:00
John Kåre Alsaker
0c96a9260b Add Freeze type and use it to store Definitions 2023-09-02 08:13:03 +02:00
John Kåre Alsaker
90f5f94699 Use OnceLock for SingleCache 2023-09-01 03:11:51 +02:00
John Kåre Alsaker
c303c8abdd Use a parallel_guard function to handle the parallel guard 2023-08-30 18:17:38 +02:00
John Kåre Alsaker
d36393b839 Use Mutex to avoid issue with conditional locks 2023-08-30 18:17:38 +02:00
John Kåre Alsaker
b56acac41d Add ParallelGuard type to handle unwinding in parallel sections 2023-08-30 18:13:06 +02:00
John Kåre Alsaker
51eb8427bf Make parallel! an expression 2023-08-30 18:12:18 +02:00
John Kåre Alsaker
5739349e96 Use conditional synchronization for Lock 2023-08-30 06:10:02 +02:00
bors
6d32b298ed Auto merge of #114894 - Zoxc:sharded-cfg-cleanup2, r=cjgillot
Remove conditional use of `Sharded` from query state

`Sharded` is already a zero cost abstraction, so it shouldn't affect the performance of the single thread compiler if LLVM does its job.

r? `@cjgillot`
2023-08-29 12:04:37 +00:00
klensy
3b26b3d1d2 don't use SnapshotVec in Graph implementation, as it looks unused; use Vec instead 2023-08-28 18:59:55 +03:00
Weihang Lo
832fb9c072
Rollup merge of #114987 - RalfJung:unsound-mmap, r=cjgillot
elaborate a bit on the (lack of) safety in 'Mmap::map'

Sadly none of the callers of this function even consider it worth mentioning in their unsafe block that what they are doing is completely unsound.
2023-08-24 22:53:57 +01:00
John Kåre Alsaker
f458b112f8 Optimize lock_shards 2023-08-24 23:29:48 +02:00
bors
b60e31b673 Auto merge of #115082 - Zoxc:syntax-context-decode-race, r=cjgillot
Fix races conditions with `SyntaxContext` decoding

This changes `SyntaxContext` decoding to work with concurrent decoding. The `remapped_ctxts` field now only stores `SyntaxContext` which have completed decoding, while the new `decoding` and `local_in_progress` keeps track of `SyntaxContext`s which are in process of being decoding and on which threads.

This fixes 2 issues with the current implementation. It can return an `SyntaxContext` which contains dummy data if another thread starts decoding before the first one has completely finished. Multiple threads could also allocate multiple `SyntaxContext`s for the same `raw_id`.
2023-08-24 17:43:02 +00:00
bors
8a6b67f988 Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonur
Update bootstrap compiler to 1.73.0 beta
2023-08-24 11:10:52 +00:00
Mark Rousskov
0a916062aa Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
John Kåre Alsaker
e41240e45b Fix races conditions with SyntaxContext decoding 2023-08-22 02:36:41 +02:00
Ralf Jung
132a2c6cf2 elaborate a bit on the (lack of) safety in 'Mmap::map' 2023-08-19 12:50:26 +02:00
John Kåre Alsaker
0823f0c32b Remove count 2023-08-16 10:44:32 +02:00
John Kåre Alsaker
81220c0ace Keep SHARDS fixed instead of a function of cfg!(parallel_compiler) 2023-08-16 10:00:25 +02:00
John Kåre Alsaker
c737c62e70 Make Sharded an enum and specialize it for the single thread case 2023-08-15 17:22:48 +02:00
bors
617821ab32 Auto merge of #114339 - ttsugriy:unsafe-utf8, r=davidtwco
[rustc_data_structures][base_n][perf] Remove unnecessary utf8 check.

Since all output characters taken from `BASE_64` are valid UTF8 chars there is no need to waste cycles on validation.

Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3) on M1 MacBook Air with following results:
```
Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693)
push_str/old            time:   [14.670 µs 14.852 µs 15.074 µs]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
push_str/new            time:   [12.573 µs 12.674 µs 12.801 µs]
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe
```
2023-08-08 10:25:37 +00:00
Matthias Krüger
4669905ee6
Rollup merge of #114418 - klensy:parking_lot, r=oli-obk
bump parking_lot to 0.12

Bumps parking_lot to 0.12, replaces few explicit uses of parking_lot with rustc_data_structures::sync ones.

<strike>cc `@oli-obk` this touches recent https://github.com/rust-lang/rust/pull/114283</strike>
cc `@SparrowLii` i've checked that this builds with parallel-compiler

measureme's bump https://github.com/rust-lang/measureme/pull/209
fcf3006e01/compiler/rustc_data_structures/src/sync.rs (L18-L34)
2023-08-04 21:31:56 +02:00
klensy
383b715163 bump parking_lot 0.11 to 0.12 2023-08-03 16:05:26 +03:00
Nilstrieb
5830ca216d Add internal_features lint
It lints against features that are inteded to be internal to the
compiler and standard library. Implements MCP #596.

We allow `internal_features` in the standard library and compiler as those
use many features and this _is_ the standard library from the "internal to the compiler and
standard library" after all.

Marking some features as internal wasn't exactly the most scientific approach, I just marked some
mostly obvious features. While there is a categorization in the macro,
it's not very well upheld (should probably be fixed in another PR).

We always pass `-Ainternal_features` in the testsuite
About 400 UI tests and several other tests use internal features.
Instead of throwing the attribute on each one, just always allow them.
There's nothing wrong with testing internal features^^
2023-08-03 14:50:50 +02:00
Taras Tsugrii
64dfd1090d [rustc_data_structures][base_n][perf] Remove unnecessary utf8 check.
Since all output characters taken from `BASE_64` are valid UTF8 chars
there is no need to waste cycles on validation.

Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3)
on M1 MacBook Air with following results:
```
Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693)
push_str/old            time:   [14.670 µs 14.852 µs 15.074 µs]
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
push_str/new            time:   [12.573 µs 12.674 µs 12.801 µs]
                        Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe
```
2023-08-01 11:10:17 -07:00
Matthias Krüger
00ad3ccae6
Rollup merge of #114306 - ttsugriy:push_str, r=wesleywiser
[rustc_data_structures][perf] Simplify base_n::push_str.

This minor change removes the need to reverse resulting digits. Since reverse is O(|digit_num|) but bounded by 128, it's unlikely to be a noticeable in practice. At the same time, this code is also a 1 line shorter, so combined with tiny perf win, why not?

I ran https://gist.github.com/ttsugriy/ed14860ef597ab315d4129d5f8adb191 on M1 macbook air and got a small improvement
```
Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693)
push_str/old            time:   [14.180 µs 14.313 µs 14.462 µs]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
push_str/new            time:   [13.741 µs 13.839 µs 13.973 µs]
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
```
2023-08-01 17:39:12 +02:00
Matthias Krüger
b38718090e
Rollup merge of #114283 - oli-obk:parkin_lot_rwlock, r=SparrowLii
Use parking lot's rwlock even without parallel-rustc

Considering that this doesn't affect perf, I think we should use the simplest solution.
2023-08-01 17:39:10 +02:00
Oli Scherer
3eb5733ed4 Always use parking_lot's RwLock, even without parallel compiler 2023-08-01 06:55:12 +00:00
Matthias Krüger
a902550233
Rollup merge of #114313 - ttsugriy:sm-insert, r=petrochenkov
[rustc_data_structures] Simplify SortedMap::insert.

It looks like current usage of `swap` is aimed at achieving what `std::mem::replace` does but more concisely and idiomatically.
2023-08-01 06:55:55 +02:00
Taras Tsugrii
9eae73a5de [rustc_data_structures] Simplify SortedMap::insert.
It looks like current usage of `swap` is aimed at achieving what
`std::mem::replace` does but more concisely and idiomatically.
2023-07-31 16:58:04 -07:00
Matthias Krüger
58f963fb65
Rollup merge of #113717 - cuishuang:master, r=Nilstrieb
remove repetitive words
2023-07-31 22:49:47 +02:00
Taras Tsugrii
b84942a0fe [rustc_data_structures][perf] Simplify base_n::push_str.
This minor change removes the need to reverse resulting digits.
Since reverse is O(|digit_num|) but bounded by 128, it's unlikely
to be a noticeable in practice. At the same time, this code is
also a 1 line shorter, so combined with tiny perf win, why not?

I ran https://gist.github.com/ttsugriy/ed14860ef597ab315d4129d5f8adb191
on M1 macbook air and got a small improvement
```
Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693)
push_str/old            time:   [14.180 µs 14.313 µs 14.462 µs]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
push_str/new            time:   [13.741 µs 13.839 µs 13.973 µs]
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
```
2023-07-31 12:40:11 -07:00
cui fliter
88c7b16e03 remove repetitive words
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-31 16:13:02 +08:00
Taras Tsugrii
9ced089569 [rustc_data_structures] Use partition_point to find binary_search_slice end. 2023-07-29 19:42:22 -07:00
Taras Tsugrii
31fadf621b [rustc][data_structures] Simplify binary_search_slice. 2023-07-29 07:22:56 -07:00
Matthias Krüger
af2b370100 more clippy::style fixes:
get_first
single_char_add_str
unnecessary_mut_passed
manual_map
manual_is_ascii_check
2023-07-23 23:39:04 +02:00
Michael Woerister
457b787a52 Introduce ExtentUnord trait for collections that can safely consume UnordItems. 2023-07-14 10:10:15 +02:00
Michael Woerister
cfb310939b Enable potential_query_instability lint in rustc_hir_typeck.
Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
2023-07-14 10:10:14 +02:00
Mark Rousskov
cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
Josh Stone
d9b1fa93c4 Upgrade to indexmap 2.0.0
The new version was already added to the tree as an indirect dependency
in #113046, but now our direct dependents are using it too.
2023-07-03 13:51:54 -07:00
Nicholas Nethercote
f2d863fa75 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
a5561eb4d5
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
7d5b2e4926 Make closure_saved_names_of_captured_variables a query. 2023-06-19 16:50:52 +00:00
Andrew Xie
0cac8455e6 Applied nits 2023-06-11 22:45:04 -04:00
Michael Goulet
80e9ca9398 Don't print Interned or PrivateZst 2023-06-09 00:20:37 +00:00
Andrew Xie
54d7b327e5 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
f5f638c124 Fixed to_sorted => to_sorted_stable_ord 2023-06-05 00:16:20 -04:00
Andrew Xie
6f2d3dee17 Fixed unord mistake 2023-06-04 21:55:32 -04:00
Andrew Xie
96b577860d Fixed failing test + minor cleanup 2023-06-04 21:55:32 -04:00
Arlo Siemsen
4d9b476bb1 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
ad8304a0d5 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
8abafd085a Add some comments 2023-05-28 15:54:52 +02:00
John Kåre Alsaker
5843858c01 Don't access self.mask with a single shard 2023-05-28 15:47:44 +02:00
John Kåre Alsaker
6620882089 Use only one shard with a single thread 2023-05-28 14:08:59 +02:00
Michael Howell
52bd82f522 rustc_data_structures: sync and atomic consistency
Co-authored-by: @lukas-code
2023-05-25 15:18:05 -07:00
Michael Howell
6a358960da rustc_metadata: specialize private_dep flag with fetch_and 2023-05-25 08:15:05 -07:00
Michael Howell
a12f50ddc4 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
a9743e108a
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
d0b3ebee66
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
97d328012b 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
fb0f74a8c9 Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
Maybe Waffle
e2b953063d Don't leak the function that is called on drop 2023-05-23 14:53:36 +00:00
bors
25f084d5e0 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
7c8f29f02c Revert spurious changes. 2023-05-18 14:36:13 +00:00
Dylan DPC
ad214ac02b
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
9bfb90b1be Remove unused impl<T> WorkerLocal<Vec<T>>. 2023-05-18 13:14:45 +10:00
Camille GILLOT
fa8598cb50 Merge DominatorTree and Dominators. 2023-05-17 10:37:29 +00:00
Camille GILLOT
4bbdb64016 Typo. 2023-05-17 10:29:12 +00:00
Camille GILLOT
ae318e3444 Remove outdated comment. 2023-05-17 10:26:04 +00:00
Tomasz Miąsko
aa1267f630 Preprocess dominator tree to answer queries in O(1) 2023-05-17 09:36:12 +00:00
Dylan DPC
2a5c4baf68
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
a6197a5dca Fixup comments 2023-05-16 12:09:24 +00:00
Maybe Waffle
e39d61cbf3 Remove MetadataRef type alias 2023-05-16 11:55:47 +00:00
Maybe Waffle
086c08d86a Switch OwnedSlice to use Lrc & remove Lrc from MetadataBlob 2023-05-16 11:43:27 +00:00
Maybe Waffle
2eef27a6c1 Merge MetadataRef type aliases 2023-05-16 11:43:25 +00:00
Camille GILLOT
84339a6f05 Process current bucket instead of parent's bucket when starting loop for dominators. 2023-05-15 16:16:34 +00:00
Tomasz Miąsko
f16d2b1629 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
dd8ec9c88d 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
d075b6c16d
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
3c03cce341 bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
Dylan DPC
f748bb1402
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
f2645776dc Use smaller ints for bitflags 2023-05-07 18:24:46 +02:00
SparrowLii
d7e3e5bede add DynSend / DynSync for CopyTaggedPtr 2023-05-06 10:23:51 +08:00
SparrowLii
bffccddac3 correct import of owned_slice 2023-05-06 09:34:55 +08:00
SparrowLii
089a38880b correct literals for dyn thread safe 2023-05-06 09:34:53 +08:00
SparrowLii
9f8ab2a8d3 rename relative names in sync 2023-05-06 09:34:24 +08:00
SparrowLii
f196e27d87 fix parallel! 2023-05-06 09:34:22 +08:00
SparrowLii
261b727d76 fix some nits 2023-05-06 09:34:21 +08:00
SparrowLii
b9746ce039 introduce DynSend and DynSync auto trait 2023-05-06 09:34:18 +08:00
Matthew Jasper
bd928a0b5e 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
Ben Kimock
3c6d9ec77d Use the full Fingerprint when stringifying Svh 2023-04-30 14:28:30 -04:00
bors
c14882f74e Auto merge of #107782 - Zoxc:worker-local, r=cjgillot
Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures

This PR moves the definition of the `WorkerLocal` type from `rustc-rayon` into `rustc_data_structures`. This is enabled by the introduction of the `Registry` type which allows you to group up threads to be used by `WorkerLocal` which is basically just an array with an per thread index. The `Registry` type mirrors the one in Rayon and each Rayon worker thread is also registered with the new `Registry`. Safety for `WorkerLocal` is ensured by having it keep a reference to the registry and checking on each access that we're still on the group of threads associated with the registry used to construct it.

Accessing a `WorkerLocal` is micro-optimized due to it being hot since it's used for most arena allocations.

Performance is slightly improved for the parallel compiler:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.9992s</td><td align="right">1.9949s</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2977s</td><td align="right">0.2970s</td><td align="right"> -0.22%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.1335s</td><td align="right">1.1315s</td><td align="right"> -0.18%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.8235s</td><td align="right">1.8171s</td><td align="right"> -0.35%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.9047s</td><td align="right">6.8930s</td><td align="right"> -0.17%</td></tr><tr><td>Total</td><td align="right">12.1586s</td><td align="right">12.1336s</td><td align="right"> -0.21%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9977s</td><td align="right"> -0.23%</td></tr></table>

cc `@SparrowLii`
2023-04-27 17:43:09 +00:00
Matthias Krüger
b1ff6e3e10
Rollup merge of #110814 - WaffleLapkin:sprinkle_#inline, r=Nilstrieb
Sprinkle some `#[inline]` in `rustc_data_structures::tagged_ptr`

This is based on `nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr` which shows many methods that should probably be inlined. May fix the regression in https://github.com/rust-lang/rust/pull/110795.

r? ```@Nilstrieb```
2023-04-27 15:10:53 +02:00
Matthias Krüger
8d00a8d11e
Rollup merge of #110615 - WaffleLapkin:impl_tag, r=cjgillot
Add `impl_tag!` macro to implement `Tag` for tagged pointer easily

r? `@Nilstrieb`

This should also lifts the need to think about safety from the callers (`impl_tag!` is robust (ish, see the macro issue)) and removes the possibility of making a "weird" `Tag` impl.
2023-04-25 21:06:33 +02:00
Maybe Waffle
bec7ce4824 Add #[inline] in impl_tag 2023-04-25 17:37:12 +00:00
Maybe Waffle
021a12c00d Sprinkle some #[inline] in rustc_data_structures::tagged_ptr 2023-04-25 17:30:05 +00:00
Yuki Okushi
a373623d55
Rollup merge of #110681 - klensy:cut-dep, r=lcnr
drop few unused crates, gate libc under unix for rustc_codegen_ssa

Small cleanup.
2023-04-25 02:33:29 +09:00
Maybe Waffle
2b8d27b402 Switch impl_tag! from explicit tags to ${index()} 2023-04-24 16:48:37 +00:00
Maybe Waffle
e496fbec92 Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
klensy
3338ee3ca7 drop unused deps, gate libc under unix for one crate 2023-04-22 15:22:21 +03:00
Maybe Waffle
ad8c7b6705 Simplify bits_for_tags impl 2023-04-20 19:54:10 +00:00
Maybe Waffle
7cfecf26f7 Remove confusing comment 2023-04-20 19:07:57 +00:00
Maybe Waffle
96905d568a Use impl Tag for $T syntax for impl_tag! 2023-04-20 18:49:40 +00:00
Maybe Waffle
77c83c0965 Add impl_tag! macro to implement Tag for tagged pointer easily 2023-04-20 17:14:32 +00:00
Maybe Waffle
f79df7d2a4 deny(unsafe_op_in_unsafe_fn) in rustc_data_structures 2023-04-19 18:00:48 +00:00
bors
b3f1379509 Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillot
Encode hashes as bytes, not varint

In a few places, we store hashes as `u64` or `u128` and then apply `derive(Decodable, Encodable)` to the enclosing struct/enum. It is more efficient to encode hashes directly than try to apply some varint encoding. This PR adds two new types `Hash64` and `Hash128` which are produced by `StableHasher` and replace every use of storing a `u64` or `u128` that represents a hash.

Distribution of the byte lengths of leb128 encodings, from `x build --stage 2` with `incremental = true`

Before:
```
(  1) 373418203 (53.7%, 53.7%): 1
(  2) 196240113 (28.2%, 81.9%): 3
(  3) 108157958 (15.6%, 97.5%): 2
(  4)  17213120 ( 2.5%, 99.9%): 4
(  5)    223614 ( 0.0%,100.0%): 9
(  6)    216262 ( 0.0%,100.0%): 10
(  7)     15447 ( 0.0%,100.0%): 5
(  8)      3633 ( 0.0%,100.0%): 19
(  9)      3030 ( 0.0%,100.0%): 8
( 10)      1167 ( 0.0%,100.0%): 18
( 11)      1032 ( 0.0%,100.0%): 7
( 12)      1003 ( 0.0%,100.0%): 6
( 13)        10 ( 0.0%,100.0%): 16
( 14)        10 ( 0.0%,100.0%): 17
( 15)         5 ( 0.0%,100.0%): 12
( 16)         4 ( 0.0%,100.0%): 14
```

After:
```
(  1) 372939136 (53.7%, 53.7%): 1
(  2) 196240140 (28.3%, 82.0%): 3
(  3) 108014969 (15.6%, 97.5%): 2
(  4)  17192375 ( 2.5%,100.0%): 4
(  5)       435 ( 0.0%,100.0%): 5
(  6)        83 ( 0.0%,100.0%): 18
(  7)        79 ( 0.0%,100.0%): 10
(  8)        50 ( 0.0%,100.0%): 9
(  9)         6 ( 0.0%,100.0%): 19
```

The remaining 9 or 10 and 18 or 19 are `u64` and `u128` respectively that have the high bits set. As far as I can tell these are coming primarily from `SwitchTargets`.
2023-04-18 22:27:15 +00:00
Ben Kimock
073d99b25d
Add #[inline] to some new functions
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2023-04-18 14:13:19 -04:00
Ben Kimock
a04c09ade8 Document how the HashN types are different from Fingerprint 2023-04-18 10:52:47 -04:00
Ben Kimock
0445fbdd83 Store hashes in special types so they aren't accidentally encoded as numbers 2023-04-18 10:52:47 -04:00
Guillaume Gomez
aa87addfb3
Rollup merge of #110417 - jsoref:spelling-compiler, r=Nilstrieb
Spelling compiler

This is per https://github.com/rust-lang/rust/pull/110392#issuecomment-1510193656

I'm going to delay performing a squash because I really don't expect people to be perfectly happy w/ my changes, I really am a human and I really do make mistakes.

r? Nilstrieb

I'm going to be flying this evening, but I should be able to squash / respond to reviews w/in a day or two.

I tried to be careful about dropping changes to `tests`, afaict only two files had changes that were likely related to the changes for a given commit (this is where not having eagerly squashed should have given me an advantage), but, that said, picking things apart can be error prone.
2023-04-18 14:50:51 +02:00
bors
74864fa496 Auto merge of #110481 - matthiaskrgr:rollup-phkkgm9, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #109981 (Set commit information environment variables when building tools)
 - #110348 (Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book)
 - #110409 (Don't use `serde_json` to serialize a simple JSON object)
 - #110442 (Avoid including dry run steps in the build metrics)
 - #110450 (rustdoc: Fix invalid handling of nested items with `--document-private-items`)
 - #110461 (Use `Item::expect_*` and `ImplItem::expect_*` more)
 - #110465 (Assure everyone that `has_type_flags` is fast)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-18 05:28:44 +00:00
Matthias Krüger
41ae7fcf9b
Rollup merge of #110409 - Nilstrieb:some-manual-javascript-object-notationing, r=fee1-dead
Don't use `serde_json` to serialize a simple JSON object

This avoids `rustc_data_structures` depending on `serde_json` which allows it to be compiled much earlier, unlocking most of rustc.

This used to not matter, but after #110407 we're not blocked on fluent anymore, which means that it's now a blocking edge.
![image](https://user-images.githubusercontent.com/48135649/232313178-e0150420-3020-4eb6-98d3-fe5294a8f947.png)

This saves a few more seconds.

cc ````@Zoxc```` who added it recently
2023-04-18 06:44:46 +02:00
bors
386025117a Auto merge of #110410 - saethlin:hash-u128-as-u64s, r=oli-obk
Implement StableHasher::write_u128 via write_u64

In https://github.com/rust-lang/rust/pull/110367#issuecomment-1510114777 the cachegrind diffs indicate that nearly all the regression is from this:
```
22,892,558  ???:<rustc_data_structures::sip128::SipHasher128>::slice_write_process_buffer
-9,502,262  ???:<rustc_data_structures::sip128::SipHasher128>::short_write_process_buffer::<8>
```
Which happens because the diff for that perf run swaps a `Hash::hash` of a `u64` to a `u128`. But `slice_write_process_buffer` is a `#[cold]` function, and is for handling hashes of arbitrary-length byte arrays.

Using the much more optimizer-friendly `u64` path twice to hash a `u128` provides a nice perf boost in some benchmarks.
2023-04-18 03:11:18 +00:00
bors
7908a1d654 Auto merge of #110243 - WaffleLapkin:bless_tagged_pointers🙏, r=Nilstrieb
Tagged pointers, now with strict provenance!

This is a big refactor of tagged pointers in rustc, with three main goals:
1. Porting the code to the strict provenance
2. Cleanup the code
3. Document the code (and safety invariants) better

This PR has grown quite a bit (almost a complete rewrite at this point...), so I'm not sure what's the best way to review this, but reviewing commit-by-commit should be fine.

r? `@Nilstrieb`
2023-04-17 21:50:13 +00:00
Josh Soref
e09d0d2a29 Spelling - compiler
* account
* achieved
* advising
* always
* ambiguous
* analysis
* annotations
* appropriate
* build
* candidates
* cascading
* category
* character
* clarification
* compound
* conceptually
* constituent
* consts
* convenience
* corresponds
* debruijn
* debug
* debugable
* debuggable
* deterministic
* discriminant
* display
* documentation
* doesn't
* ellipsis
* erroneous
* evaluability
* evaluate
* evaluation
* explicitly
* fallible
* fulfill
* getting
* has
* highlighting
* illustrative
* imported
* incompatible
* infringing
* initialized
* into
* intrinsic
* introduced
* javascript
* liveness
* metadata
* monomorphization
* nonexistent
* nontrivial
* obligation
* obligations
* offset
* opaque
* opportunities
* opt-in
* outlive
* overlapping
* paragraph
* parentheses
* poisson
* precisely
* predecessors
* predicates
* preexisting
* propagated
* really
* reentrant
* referent
* responsibility
* rustonomicon
* shortcircuit
* simplifiable
* simplifications
* specify
* stabilized
* structurally
* suggestibility
* translatable
* transmuting
* two
* unclosed
* uninhabited
* visibility
* volatile
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17 16:09:18 -04:00
bors
e49122fb1c Auto merge of #110367 - saethlin:no-truncations, r=oli-obk
Remove some suspicious cast truncations

These truncations were added a long time ago, and as best I can tell without a perf justification. And with rust-lang/rust#110410 it has become perf-neutral to not truncate anymore. We worked hard for all these bits, let's use them.
2023-04-17 09:38:31 +00:00
Ben Kimock
84facac97a Remove some unnecessary hash truncations 2023-04-16 20:05:02 -04:00
Ben Kimock
ad8d304163 Implement StableHasher::write_u128 via write_u64 2023-04-16 09:44:03 -04:00
Nilstrieb
7859a8e9a5 Don't use serde_json to serialize a simple JSON object
This avoids `rustc_data_structures` depending on `serde_json` which
allows it to be compiled much earlier, unlocking most of rustc.
2023-04-16 15:00:06 +02:00
Matthias Krüger
543f8bc38c fix clippy::toplevel_ref_arg and ::manual_map 2023-04-16 13:28:13 +02:00
John Kåre Alsaker
64474a40b0 Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures 2023-04-16 05:50:57 +02:00
Maybe Waffle
5571dd061d fix broken intradoclinks 2023-04-14 13:04:58 +00:00
Maybe Waffle
014c6f208e Use ptr::Alignment for extra coolness points 2023-04-14 12:31:49 +00:00
Maybe Waffle
36f5918bf1 Test CopyTaggedPtr's HashStable impl 2023-04-14 11:59:53 +00:00
Maybe Waffle
251f662e4d Share Tag2 impl between CopyTaggedPtr and TaggedPtr tests 2023-04-14 11:24:22 +00:00
Maybe Waffle
8d49e948a8 Doc fixes from review 2023-04-14 11:24:22 +00:00
Maybe Waffle
c155d5149f Implement Send/Sync for CopyTaggedPtr 2023-04-13 16:51:04 +00:00
Maybe Waffle
dc19dc29c9 doc fixes 2023-04-12 19:00:27 +00:00
Maybe Waffle
838c5491a4 Document tagged pointers better 2023-04-12 16:22:20 +00:00
Maybe Waffle
6f9b15c40c Add tests for tagged pointers 2023-04-12 16:20:34 +00:00
Maybe Waffle
5e4577ec65 Add TaggedPtr::set_tag 2023-04-12 12:35:43 +00:00
Maybe Waffle
6f64ae3fbc Move code around 2023-04-12 11:50:45 +00:00
Maybe Waffle
3df9a7bde3 Shorten COMPARE_PACKED => CP where it is not important
why can't I _ it :'(
2023-04-12 11:44:52 +00:00
Maybe Waffle
8f408202c3 Remove pointer_{ref,mut} from tagged pointers
Just use `deref{,_mut}`!
2023-04-12 11:41:41 +00:00
Maybe Waffle
c7c0b85f67 Make tagged pointers debug impls print the pointer
Does not really matter, but may be nicer in case
the pointer has some specific debug impl.
2023-04-12 11:30:45 +00:00
Maybe Waffle
c6acd5c92f Remove Pointer::with_ref in favour implementing it on tagged pointers directly 2023-04-12 11:26:34 +00:00
Maybe Waffle
9051331dd7 Lift Pointer's requirement for the pointer to be thin
fat pointers rule!
2023-04-12 11:00:35 +00:00
Maybe Waffle
26232f1ff5 Remove useless parameter from ghost 2023-04-12 10:34:29 +00:00
Maybe Waffle
ad92677008 Fix doc test 2023-04-11 21:45:19 +00:00
Maybe Waffle
12fd610e01 Refactor tagged ptr packing into a function 2023-04-11 21:40:39 +00:00
Maybe Waffle
3c6f4c1260 Bless tagged pointers (comply to strict provenance) 2023-04-11 21:31:23 +00:00
Maybe Waffle
f028636b1a Sprinkle some whitespace & uses 2023-04-11 19:33:33 +00:00
Maybe Waffle
c738dcc284 Add bits_for helper for tagged pointers & fixup docs 2023-04-11 19:18:59 +00:00
Maybe Waffle
a32959263c Use SSO_ARRAY_SIZE instead of 8 in SsoHashMap impl 2023-04-11 11:02:01 +00:00
Maybe Waffle
0465201f77 Use itertools::Either instead of own EitherIter impl 2023-04-11 11:02:01 +00:00
Nilstrieb
73417b1e15
Inline format_args
Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-09 23:29:39 +02:00
Nilstrieb
81c320ea77 Fix some clippy::complexity 2023-04-09 23:22:14 +02:00
Nilstrieb
0a0968b207 Allow modulo_one on function using cfg consts 2023-04-09 22:30:24 +02:00
Nilstrieb
f058d05fc2 Some simple clippy::perf fixes 2023-04-09 21:59:28 +02:00
bors
0f0dc29264 Auto merge of #109971 - WaffleLapkin:yeet_ownership, r=Nilstrieb
Yeet `owning_ref`

Based on the discussions from https://github.com/rust-lang/rust/pull/109948

This replaces `owning_ref` with a far simpler & safer abstraction.

Fixes #109974
2023-04-08 01:08:26 +00:00
Maybe Waffle
fbe0591c68 Mark OwnedSlice::{deref, borrow} as #[inline] 2023-04-07 10:14:50 +00:00
Maybe Waffle
2733c29bb1 Support multithreaded mode in OwnedSlice tests 2023-04-06 18:13:07 +00:00
Maybe Waffle
e0e39caf84 Add basic tests for OwnedSlice 2023-04-06 17:33:55 +00:00
Maybe Waffle
b6970d0e26 Use FnOnce for slice_owned instead of Fn 2023-04-06 17:03:42 +00:00
Nilstrieb
504c4c40e9 Add context to phantom comment 2023-04-05 18:55:55 +02:00
Thom Chiovoloni
9d314627aa Fix a couple missed hash constants 2023-04-05 15:48:37 +00:00
Thom Chiovoloni
bb0969cae0 Use SipHash-1-3 instead of SipHash-2-4 for StableHasher 2023-04-05 15:48:37 +00:00
Maybe Waffle
9405f586f5 Fix typo 2023-04-05 13:49:48 +00:00
Maybe Waffle
d7056548f9 Yeet owning_ref
Turns out
- `owning_ref` is unsound due to `Box` aliasing stuff
- `rustc` doesn't need 99% of the `owning_ref` API
- `rustc` can use a far simpler abstraction that is `OwnedSlice`
2023-04-05 13:49:48 +00:00