Skip to content

Commit 3e4dfc8

Browse files
committed
normalize stderr
1 parent 32e3232 commit 3e4dfc8

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

tests/ui/impl-trait/normalize-tait-in-const.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// failure-status: 101
33
// normalize-stderr-test "note: .*\n\n" -> ""
44
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
5+
// normalize-stderr-test "DefId([^)]*)" -> "..."
56
// rustc-env:RUST_BACKTRACE=0
67

78
#![feature(type_alias_impl_trait)]

tests/ui/impl-trait/normalize-tait-in-const.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize Alias(Projection, AliasTy { substs: [FnDef(DefId(0:18 ~ normalize_tait_in_const[1c07]::foo), []), Tuple([Ref(ReErased, Ref(ReErased, Adt(S, []), Not), Not)])], def_id: DefId(2:2940 ~ core[a28e]::ops::function::FnOnce::Output) }), maybe try to call `try_normalize_erasing_regions` instead
1+
error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize Alias(Projection, AliasTy { substs: [FnDef(...), []), Tuple([Ref(ReErased, Ref(ReErased, Adt(S, []), Not), Not)])], def_id: ...) }), maybe try to call `try_normalize_erasing_regions` instead
22

33
query stack during panic:
44
#0 [eval_to_allocation_raw] const-evaluating + checking `BAR`

tests/ui/layout/zero-sized-array-enum-niche.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// normalize-stderr-test "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
2+
// normalize-stderr-test "Leaf\(0x\d+\)" -> "Leaf(...)"
23
#![feature(rustc_attrs)]
34
#![crate_type = "lib"]
45

@@ -18,7 +19,8 @@ type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of
1819
// Here's another case with multiple ZST alignments, where we should
1920
// get the maximal alignment and matching size.
2021
#[rustc_layout(debug)]
21-
enum MultipleAlignments { //~ ERROR: layout_of
22+
enum MultipleAlignments {
23+
//~^ ERROR: layout_of
2224
Align2([u16; 0]),
2325
Align4([u32; 0]),
2426
Niche(bool),
@@ -38,7 +40,9 @@ type NicheLosesToTagged = Result<[u32; 0], Packed<std::num::NonZeroU16>>; //~ ER
3840
// Should get tag_encoding: Direct, size == align == 4.
3941

4042
#[repr(u16)]
41-
enum U16IsZero { _Zero = 0 }
43+
enum U16IsZero {
44+
_Zero = 0,
45+
}
4246

4347
#[rustc_layout(debug)]
4448
type NicheWinsOverTagged = Result<[u32; 0], Packed<U16IsZero>>; //~ ERROR: layout_of

tests/ui/layout/zero-sized-array-enum-niche.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(0x0000000000000000)) }), Bool])) = Layout {
1+
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(...)) }), Bool])) = Layout {
22
size: Size(4 bytes),
33
align: AbiAndPrefAlign {
44
abi: Align(4 bytes),
@@ -92,7 +92,7 @@ error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usi
9292
],
9393
},
9494
}
95-
--> $DIR/zero-sized-array-enum-niche.rs:13:1
95+
--> $DIR/zero-sized-array-enum-niche.rs:14:1
9696
|
9797
LL | type AlignedResult = Result<[u32; 0], bool>;
9898
| ^^^^^^^^^^^^^^^^^^
@@ -213,12 +213,12 @@ error: layout_of(Adt(MultipleAlignments, [])) = Layout {
213213
],
214214
},
215215
}
216-
--> $DIR/zero-sized-array-enum-niche.rs:21:1
216+
--> $DIR/zero-sized-array-enum-niche.rs:22:1
217217
|
218218
LL | enum MultipleAlignments {
219219
| ^^^^^^^^^^^^^^^^^^^^^^^
220220

221-
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(0x0000000000000000)) }), Adt(Packed, [Adt(std::num::NonZeroU16, [])])])) = Layout {
221+
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(...)) }), Adt(Packed, [Adt(std::num::NonZeroU16, [])])])) = Layout {
222222
size: Size(4 bytes),
223223
align: AbiAndPrefAlign {
224224
abi: Align(4 bytes),
@@ -312,12 +312,12 @@ error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usi
312312
],
313313
},
314314
}
315-
--> $DIR/zero-sized-array-enum-niche.rs:37:1
315+
--> $DIR/zero-sized-array-enum-niche.rs:39:1
316316
|
317317
LL | type NicheLosesToTagged = Result<[u32; 0], Packed<std::num::NonZeroU16>>;
318318
| ^^^^^^^^^^^^^^^^^^^^^^^
319319

320-
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(0x0000000000000000)) }), Adt(Packed, [Adt(U16IsZero, [])])])) = Layout {
320+
error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usize), kind: Value(Leaf(...)) }), Adt(Packed, [Adt(U16IsZero, [])])])) = Layout {
321321
size: Size(4 bytes),
322322
align: AbiAndPrefAlign {
323323
abi: Align(4 bytes),
@@ -415,7 +415,7 @@ error: layout_of(Adt(std::result::Result, [Array(Uint(U32), Const { ty: Uint(Usi
415415
],
416416
},
417417
}
418-
--> $DIR/zero-sized-array-enum-niche.rs:44:1
418+
--> $DIR/zero-sized-array-enum-niche.rs:48:1
419419
|
420420
LL | type NicheWinsOverTagged = Result<[u32; 0], Packed<U16IsZero>>;
421421
| ^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/nll/ty-outlives/projection-no-regions-closure.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// compile-flags:-Zverbose
2+
// normalize-stderr-test "DefId([^)]*)" -> "..."
23

34
// Tests closures that propagate an outlives relationship to their
45
// creator where the subject is a projection with no regions (`<T as
@@ -7,12 +8,13 @@
78
#![allow(warnings)]
89
#![feature(rustc_attrs)]
910

10-
trait Anything { }
11+
trait Anything {}
1112

12-
impl<T> Anything for T { }
13+
impl<T> Anything for T {}
1314

1415
fn with_signature<'a, T, F>(x: Box<T>, op: F) -> Box<dyn Anything + 'a>
15-
where F: FnOnce(Box<T>) -> Box<dyn Anything + 'a>
16+
where
17+
F: FnOnce(Box<T>) -> Box<dyn Anything + 'a>,
1618
{
1719
op(x)
1820
}

tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
note: external requirements
2-
--> $DIR/projection-no-regions-closure.rs:25:23
2+
--> $DIR/projection-no-regions-closure.rs:27:23
33
|
44
LL | with_signature(x, |mut y| Box::new(y.next()))
55
| ^^^^^^^
@@ -19,10 +19,10 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
1919
),
2020
]
2121
= note: number of external vids: 3
22-
= note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: DefId(2:7157 ~ core[a28e]::iter::traits::iterator::Iterator::Item) }): '_#2r
22+
= note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: ...) }): '_#2r
2323

2424
note: no external requirements
25-
--> $DIR/projection-no-regions-closure.rs:21:1
25+
--> $DIR/projection-no-regions-closure.rs:23:1
2626
|
2727
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
2828
LL | | where
@@ -32,7 +32,7 @@ LL | | T: Iterator,
3232
= note: defining type: no_region::<'_#1r, T>
3333

3434
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
35-
--> $DIR/projection-no-regions-closure.rs:25:31
35+
--> $DIR/projection-no-regions-closure.rs:27:31
3636
|
3737
LL | with_signature(x, |mut y| Box::new(y.next()))
3838
| ^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
4141
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
4242

4343
note: external requirements
44-
--> $DIR/projection-no-regions-closure.rs:34:23
44+
--> $DIR/projection-no-regions-closure.rs:36:23
4545
|
4646
LL | with_signature(x, |mut y| Box::new(y.next()))
4747
| ^^^^^^^
@@ -61,10 +61,10 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
6161
),
6262
]
6363
= note: number of external vids: 3
64-
= note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: DefId(2:7157 ~ core[a28e]::iter::traits::iterator::Iterator::Item) }): '_#2r
64+
= note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: ...) }): '_#2r
6565

6666
note: no external requirements
67-
--> $DIR/projection-no-regions-closure.rs:30:1
67+
--> $DIR/projection-no-regions-closure.rs:32:1
6868
|
6969
LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
7070
LL | | where
@@ -74,7 +74,7 @@ LL | | T: 'a + Iterator,
7474
= note: defining type: correct_region::<'_#1r, T>
7575

7676
note: external requirements
77-
--> $DIR/projection-no-regions-closure.rs:42:23
77+
--> $DIR/projection-no-regions-closure.rs:44:23
7878
|
7979
LL | with_signature(x, |mut y| Box::new(y.next()))
8080
| ^^^^^^^
@@ -94,10 +94,10 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
9494
),
9595
]
9696
= note: number of external vids: 4
97-
= note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: DefId(2:7157 ~ core[a28e]::iter::traits::iterator::Iterator::Item) }): '_#3r
97+
= note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: ...) }): '_#3r
9898

9999
note: no external requirements
100-
--> $DIR/projection-no-regions-closure.rs:38:1
100+
--> $DIR/projection-no-regions-closure.rs:40:1
101101
|
102102
LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
103103
LL | | where
@@ -107,7 +107,7 @@ LL | | T: 'b + Iterator,
107107
= note: defining type: wrong_region::<'_#1r, '_#2r, T>
108108

109109
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
110-
--> $DIR/projection-no-regions-closure.rs:42:31
110+
--> $DIR/projection-no-regions-closure.rs:44:31
111111
|
112112
LL | with_signature(x, |mut y| Box::new(y.next()))
113113
| ^^^^^^^^^^^^^^^^^^
@@ -116,7 +116,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
116116
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
117117

118118
note: external requirements
119-
--> $DIR/projection-no-regions-closure.rs:52:23
119+
--> $DIR/projection-no-regions-closure.rs:54:23
120120
|
121121
LL | with_signature(x, |mut y| Box::new(y.next()))
122122
| ^^^^^^^
@@ -136,10 +136,10 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
136136
),
137137
]
138138
= note: number of external vids: 4
139-
= note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: DefId(2:7157 ~ core[a28e]::iter::traits::iterator::Iterator::Item) }): '_#3r
139+
= note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: ...) }): '_#3r
140140

141141
note: no external requirements
142-
--> $DIR/projection-no-regions-closure.rs:47:1
142+
--> $DIR/projection-no-regions-closure.rs:49:1
143143
|
144144
LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
145145
LL | | where

0 commit comments

Comments
 (0)