Skip to content

Commit 30309db

Browse files
committed
Put the 2229 migration errors in alphabetical order
Looks like they were in FxHash order before, so it might just be luck that this used to be consistent across different word lengths.
1 parent 086bf7a commit 30309db

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

compiler/rustc_typeck/src/check/upvar.rs

+4
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
914914
reasons.auto_traits.extend(auto_trait_reasons);
915915
reasons.drop_order = drop_order;
916916

917+
// `auto_trait_reasons` are in hashset order, so sort them to put the
918+
// diagnostics we emit later in a cross-platform-consistent order.
919+
reasons.auto_traits.sort_unstable();
920+
917921
reasons
918922
}
919923

src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
2929
LL | thread::spawn(move || unsafe {
3030
| ^^^^^^^^^^^^^^
3131
| |
32-
| in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync`
3332
| in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0.0` does not implement `Send`
33+
| in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync`
3434
...
3535
LL | *fptr.0.0 = 20;
3636
| --------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`

src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
44
LL | let result = panic::catch_unwind(move || {
55
| ^^^^^^^
66
| |
7-
| in Rust 2018, this closure implements `UnwindSafe` as `f` implements `UnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe` because `f` is not fully captured and `f.0` does not implement `UnwindSafe`
87
| in Rust 2018, this closure implements `RefUnwindSafe` as `f` implements `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `RefUnwindSafe` because `f` is not fully captured and `f.0` does not implement `RefUnwindSafe`
8+
| in Rust 2018, this closure implements `UnwindSafe` as `f` implements `UnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe` because `f` is not fully captured and `f.0` does not implement `UnwindSafe`
99
...
1010
LL | f.0()
1111
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`

src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
9494
LL | thread::spawn(move || unsafe {
9595
| ^^^^^^^^^^^^^^
9696
| |
97-
| in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync`
9897
| in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Send`
98+
| in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync`
9999
| in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr2` is not fully captured and `fptr2.0` does not implement `Send`
100100
...
101101
LL | *fptr1.0.0 = 20;

0 commit comments

Comments
 (0)