Rebase fallout.

This commit is contained in:
Camille GILLOT 2022-05-05 20:49:48 +02:00
parent be40b58895
commit a265c49b25
4 changed files with 7 additions and 95 deletions

View File

@ -102,7 +102,7 @@ fn label_break_match(c: u8, xe: u8, ye: i8) {
0 => break 'a 0,
v if { if v % 2 == 0 { break 'a 1; }; v % 3 == 0 } => { x += 1; },
v if { 'b: { break 'b v == 5; } } => { x = 41; },
_ => 'b: { //~ WARNING `'b` shadows a label
_ => 'b: {
break 'b ();
},
}
@ -128,8 +128,8 @@ fn label_break_macro() {
0
};
assert_eq!(x, 0);
let x: u8 = 'a: { //~ WARNING `'a` shadows a label
'b: { //~ WARNING `'b` shadows a label
let x: u8 = 'a: {
'b: {
if true {
mac1!('a, 1);
}

View File

@ -1,28 +0,0 @@
warning: label name `'b` shadows a label name that is already in scope
--> $DIR/label_break_value.rs:105:18
|
LL | v if { 'b: { break 'b v == 5; } } => { x = 41; },
| -- first declared here
LL | _ => 'b: {
| ^^ label `'b` already in scope
warning: label name `'a` shadows a label name that is already in scope
--> $DIR/label_break_value.rs:131:17
|
LL | let x: u8 = 'a: {
| -- first declared here
...
LL | let x: u8 = 'a: {
| ^^ label `'a` already in scope
warning: label name `'b` shadows a label name that is already in scope
--> $DIR/label_break_value.rs:132:9
|
LL | 'b: {
| -- first declared here
...
LL | 'b: {
| ^^ label `'b` already in scope
warning: 3 warnings emitted

View File

@ -20,14 +20,11 @@ fn lbv_macro_test_hygiene_respected() {
macro_rules! mac3 {
($val:expr) => {
'a: {
//~^ WARNING `'a` shadows a label
//~| WARNING `'a` shadows a label
//~| WARNING `'a` shadows a label
$val
}
};
}
let x: u8 = mac3!('b: { //~ WARNING `'b` shadows a label
let x: u8 = mac3!('b: {
if true {
break 'a 3; //~ ERROR undeclared label `'a` [E0426]
}

View File

@ -10,7 +10,7 @@ LL | mac2!(2);
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0426]: use of undeclared label `'a`
--> $DIR/label_break_value_invalid.rs:32:19
--> $DIR/label_break_value_invalid.rs:29:19
|
LL | let x: u8 = mac3!('b: {
| -- a label with a similar name is reachable
@ -22,68 +22,11 @@ LL | break 'a 3;
| help: try using similarly named label: `'b`
error[E0426]: use of undeclared label `'a`
--> $DIR/label_break_value_invalid.rs:37:29
--> $DIR/label_break_value_invalid.rs:34:29
|
LL | let x: u8 = mac3!(break 'a 4);
| ^^ undeclared label `'a`
warning: label name `'a` shadows a label name that is already in scope
--> $DIR/label_break_value_invalid.rs:22:13
|
LL | let x: u8 = 'a: {
| -- first declared here
...
LL | 'a: {
| ^^ label `'a` already in scope
...
LL | let x: u8 = mac3!('b: {
| _________________-
LL | | if true {
LL | | break 'a 3;
LL | | }
LL | | 0
LL | | });
| |______- in this macro invocation
|
= note: this warning originates in the macro `mac3` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: label name `'b` shadows a label name that is already in scope
--> $DIR/label_break_value_invalid.rs:30:23
|
LL | 'b: {
| -- first declared here
...
LL | let x: u8 = mac3!('b: {
| ^^ label `'b` already in scope
warning: label name `'a` shadows a label name that is already in scope
--> $DIR/label_break_value_invalid.rs:22:13
|
LL | let x: u8 = 'a: {
| -- first declared here
...
LL | 'a: {
| ^^ label `'a` already in scope
...
LL | let x: u8 = mac3!(break 'a 4);
| ----------------- in this macro invocation
|
= note: this warning originates in the macro `mac3` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: label name `'a` shadows a label name that is already in scope
--> $DIR/label_break_value_invalid.rs:22:13
|
LL | 'a: {
| ^^
| |
| first declared here
| label `'a` already in scope
...
LL | let x: u8 = mac3!(break 'a 4);
| ----------------- in this macro invocation
|
= note: this warning originates in the macro `mac3` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors; 4 warnings emitted
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0426`.