Skip to content

Commit b8ce429

Browse files
committed
Bless tests.
1 parent c70ec8e commit b8ce429

16 files changed

+207
-774
lines changed

src/test/ui/error-codes/E0263.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
22
--> $DIR/E0263.rs:1:16
33
|
44
LL | fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
5-
| -- ^^ declared twice
5+
| -- ^^ lifetime `'a` already in scope
66
| |
7-
| previous declaration here
7+
| first declared here
88

99
error: aborting due to previous error
1010

src/test/ui/generic-associated-types/shadowing.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
2+
--> $DIR/shadowing.rs:4:14
3+
|
4+
LL | trait Shadow<'a> {
5+
| -- first declared here
6+
LL | type Bar<'a>;
7+
| ^^ lifetime `'a` already in scope
8+
9+
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
10+
--> $DIR/shadowing.rs:13:14
11+
|
12+
LL | impl<'a> NoShadow<'a> for &'a u32 {
13+
| -- first declared here
14+
LL | type Bar<'a> = i32;
15+
| ^^ lifetime `'a` already in scope
16+
117
error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
218
--> $DIR/shadowing.rs:18:14
319
|
@@ -14,22 +30,6 @@ LL | impl<T> NoShadowT<T> for Option<T> {
1430
LL | type Bar<T> = i32;
1531
| ^ already used
1632

17-
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
18-
--> $DIR/shadowing.rs:13:14
19-
|
20-
LL | impl<'a> NoShadow<'a> for &'a u32 {
21-
| -- first declared here
22-
LL | type Bar<'a> = i32;
23-
| ^^ lifetime `'a` already in scope
24-
25-
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
26-
--> $DIR/shadowing.rs:4:14
27-
|
28-
LL | trait Shadow<'a> {
29-
| -- first declared here
30-
LL | type Bar<'a>;
31-
| ^^ lifetime `'a` already in scope
32-
3333
error: aborting due to 4 previous errors
3434

3535
Some errors have detailed explanations: E0403, E0496.

src/test/ui/hygiene/duplicate_lifetimes.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
22
--> $DIR/duplicate_lifetimes.rs:8:14
33
|
44
LL | fn g<$a, 'a>() {}
5-
| ^^ declared twice
5+
| ^^ lifetime `'a` already in scope
66
...
77
LL | m!('a);
88
| ------
99
| | |
10-
| | previous declaration here
10+
| | first declared here
1111
| in this macro invocation
1212
|
1313
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -16,12 +16,12 @@ error[E0263]: lifetime name `'a` declared twice in the same scope
1616
--> $DIR/duplicate_lifetimes.rs:13:14
1717
|
1818
LL | fn h<$a, 'a>() {}
19-
| ^^ declared twice
19+
| ^^ lifetime `'a` already in scope
2020
...
2121
LL | n!('a);
2222
| ------
2323
| | |
24-
| | previous declaration here
24+
| | first declared here
2525
| in this macro invocation
2626
|
2727
= note: this error originates in the macro `n` (in Nightly builds, run with -Z macro-backtrace for more info)

src/test/ui/hygiene/hygienic-labels-in-let.rs

+12-31
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,28 @@
1313
macro_rules! loop_x {
1414
($e: expr) => {
1515
// $e shouldn't be able to interact with this 'x
16-
'x: loop { $e }
17-
//~^ WARNING shadows a label name that is already in scope
18-
//~| WARNING shadows a label name that is already in scope
19-
//~| WARNING shadows a label name that is already in scope
20-
//~| WARNING shadows a label name that is already in scope
21-
}
16+
'x: loop {
17+
$e
18+
}
19+
};
2220
}
2321

2422
macro_rules! while_true {
2523
($e: expr) => {
2624
// $e shouldn't be able to interact with this 'x
27-
'x: while 1 + 1 == 2 { $e }
28-
//~^ WARNING shadows a label name that is already in scope
29-
//~| WARNING shadows a label name that is already in scope
30-
//~| WARNING shadows a label name that is already in scope
31-
//~| WARNING shadows a label name that is already in scope
32-
//~| WARNING shadows a label name that is already in scope
33-
}
25+
'x: while 1 + 1 == 2 {
26+
$e
27+
}
28+
};
3429
}
3530

3631
macro_rules! run_once {
3732
($e: expr) => {
3833
// ditto
39-
'x: for _ in 0..1 { $e }
40-
//~^ WARNING shadows a label name that is already in scope
41-
//~| WARNING shadows a label name that is already in scope
42-
//~| WARNING shadows a label name that is already in scope
43-
//~| WARNING shadows a label name that is already in scope
44-
//~| WARNING shadows a label name that is already in scope
45-
//~| WARNING shadows a label name that is already in scope
46-
//~| WARNING shadows a label name that is already in scope
47-
}
34+
'x: for _ in 0..1 {
35+
$e
36+
}
37+
};
4838
}
4939

5040
pub fn main() {
@@ -63,7 +53,6 @@ pub fn main() {
6353
let k: isize = {
6454
'x: for _ in 0..1 {
6555
//~^ WARNING shadows a label name that is already in scope
66-
//~| WARNING shadows a label name that is already in scope
6756
// ditto
6857
loop_x!(break 'x);
6958
i += 1;
@@ -75,9 +64,6 @@ pub fn main() {
7564
let l: isize = {
7665
'x: for _ in 0..1 {
7766
//~^ WARNING shadows a label name that is already in scope
78-
//~| WARNING shadows a label name that is already in scope
79-
//~| WARNING shadows a label name that is already in scope
80-
//~| WARNING shadows a label name that is already in scope
8167
// ditto
8268
while_true!(break 'x);
8369
i += 1;
@@ -89,11 +75,6 @@ pub fn main() {
8975
let n: isize = {
9076
'x: for _ in 0..1 {
9177
//~^ WARNING shadows a label name that is already in scope
92-
//~| WARNING shadows a label name that is already in scope
93-
//~| WARNING shadows a label name that is already in scope
94-
//~| WARNING shadows a label name that is already in scope
95-
//~| WARNING shadows a label name that is already in scope
96-
//~| WARNING shadows a label name that is already in scope
9778
// ditto
9879
run_once!(continue 'x);
9980
i += 1;

0 commit comments

Comments
 (0)