--> $DIR/E0263.rs:1:16
|
LL | fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
- | -- ^^ declared twice
+ | -- ^^ lifetime `'a` already in scope
| |
- | previous declaration here
+ | first declared here
error: aborting due to previous error
+error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
+ --> $DIR/shadowing.rs:4:14
+ |
+LL | trait Shadow<'a> {
+ | -- first declared here
+LL | type Bar<'a>;
+ | ^^ lifetime `'a` already in scope
+
+error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
+ --> $DIR/shadowing.rs:13:14
+ |
+LL | impl<'a> NoShadow<'a> for &'a u32 {
+ | -- first declared here
+LL | type Bar<'a> = i32;
+ | ^^ lifetime `'a` already in scope
+
error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
--> $DIR/shadowing.rs:18:14
|
LL | type Bar<T> = i32;
| ^ already used
-error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
- --> $DIR/shadowing.rs:13:14
- |
-LL | impl<'a> NoShadow<'a> for &'a u32 {
- | -- first declared here
-LL | type Bar<'a> = i32;
- | ^^ lifetime `'a` already in scope
-
-error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
- --> $DIR/shadowing.rs:4:14
- |
-LL | trait Shadow<'a> {
- | -- first declared here
-LL | type Bar<'a>;
- | ^^ lifetime `'a` already in scope
-
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0403, E0496.
--> $DIR/duplicate_lifetimes.rs:8:14
|
LL | fn g<$a, 'a>() {}
- | ^^ declared twice
+ | ^^ lifetime `'a` already in scope
...
LL | m!('a);
| ------
| | |
- | | previous declaration here
+ | | first declared here
| in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $DIR/duplicate_lifetimes.rs:13:14
|
LL | fn h<$a, 'a>() {}
- | ^^ declared twice
+ | ^^ lifetime `'a` already in scope
...
LL | n!('a);
| ------
| | |
- | | previous declaration here
+ | | first declared here
| in this macro invocation
|
= note: this error originates in the macro `n` (in Nightly builds, run with -Z macro-backtrace for more info)
macro_rules! loop_x {
($e: expr) => {
// $e shouldn't be able to interact with this 'x
- 'x: loop { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: loop {
+ $e
+ }
+ };
}
macro_rules! while_true {
($e: expr) => {
// $e shouldn't be able to interact with this 'x
- 'x: while 1 + 1 == 2 { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: while 1 + 1 == 2 {
+ $e
+ }
+ };
}
macro_rules! run_once {
($e: expr) => {
// ditto
- 'x: for _ in 0..1 { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: for _ in 0..1 {
+ $e
+ }
+ };
}
pub fn main() {
let k: isize = {
'x: for _ in 0..1 {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
// ditto
loop_x!(break 'x);
i += 1;
let l: isize = {
'x: for _ in 0..1 {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
// ditto
while_true!(break 'x);
i += 1;
let n: isize = {
'x: for _ in 0..1 {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
// ditto
run_once!(continue 'x);
i += 1;
warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:16:9
+ --> $DIR/hygienic-labels-in-let.rs:54:9
|
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
LL | 'x: loop {
| -- first declared here
-LL | // this 'x should refer to the outer loop, lexically
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:64:9
- |
-LL | 'x: loop {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:64:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
...
LL | 'x: for _ in 0..1 {
| ^^ label `'x` already in scope
warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:16:9
+ --> $DIR/hygienic-labels-in-let.rs:65:9
|
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
LL | 'x: loop {
| -- first declared here
...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:16:9
- |
-LL | 'x: loop { $e }
- | ^^
- | |
- | first declared here
- | label `'x` already in scope
-...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:16:9
- |
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:76:9
- |
-LL | 'x: loop {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:76:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:76:9
- |
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
LL | 'x: for _ in 0..1 {
| ^^ label `'x` already in scope
warning: label name `'x` shadows a label name that is already in scope
--> $DIR/hygienic-labels-in-let.rs:76:9
|
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:27:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
LL | 'x: loop {
| -- first declared here
...
-LL | while_true!(break 'x);
- | --------------------- in this macro invocation
- |
- = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:27:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | while_true!(break 'x);
- | --------------------- in this macro invocation
- |
- = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:27:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | while_true!(break 'x);
- | --------------------- in this macro invocation
- |
- = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:27:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 { $e }
| ^^ label `'x` already in scope
-...
-LL | while_true!(break 'x);
- | --------------------- in this macro invocation
- |
- = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:27:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | while_true!(break 'x);
- | --------------------- in this macro invocation
- |
- = note: this warning originates in the macro `while_true` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: loop {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:90:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: loop {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels-in-let.rs:39:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-warning: 28 warnings emitted
+warning: 3 warnings emitted
macro_rules! loop_x {
($e: expr) => {
// $e shouldn't be able to interact with this 'x
- 'x: loop { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: loop {
+ $e
+ }
+ };
}
macro_rules! run_once {
($e: expr) => {
// ditto
- 'x: for _ in 0..1 { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: for _ in 0..1 {
+ $e
+ }
+ };
}
macro_rules! while_x {
($e: expr) => {
// ditto
- 'x: while 1 + 1 == 2 { $e }
- //~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- }
+ 'x: while 1 + 1 == 2 {
+ $e
+ }
+ };
}
pub fn main() {
'x: loop {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
// ditto
loop_x!(break 'x);
'x: while 1 + 1 == 2 {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
while_x!(break 'x);
panic!("break doesn't act hygienically inside infinite while loop");
'x: for _ in 0..1 {
//~^ WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
- //~| WARNING shadows a label name that is already in scope
// ditto
run_once!(continue 'x);
warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:13:9
+ --> $DIR/hygienic-labels.rs:44:5
|
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
LL | 'x: for _ in 0..1 {
| -- first declared here
-LL | // this 'x should refer to the outer loop, lexically
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:54:5
- |
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | 'x: loop {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:54:5
- |
-LL | 'x: loop { $e }
- | -- first declared here
...
LL | 'x: loop {
| ^^ label `'x` already in scope
warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:13:9
- |
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:13:9
- |
-LL | 'x: loop { $e }
- | ^^
- | |
- | first declared here
- | label `'x` already in scope
-...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:13:9
- |
-LL | 'x: loop { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: loop {
- | -- first declared here
-...
-LL | loop_x!(break 'x);
- | ----------------- in this macro invocation
- |
- = note: this warning originates in the macro `loop_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:63:5
+ --> $DIR/hygienic-labels.rs:52:5
|
LL | 'x: for _ in 0..1 {
| -- first declared here
| ^^ label `'x` already in scope
warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:63:5
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:63:5
- |
-LL | 'x: loop {
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:63:5
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:38:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | while_x!(break 'x);
- | ------------------ in this macro invocation
- |
- = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:38:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | while_x!(break 'x);
- | ------------------ in this macro invocation
- |
- = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:38:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: loop {
- | -- first declared here
-...
-LL | while_x!(break 'x);
- | ------------------ in this macro invocation
- |
- = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:38:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | while_x!(break 'x);
- | ------------------ in this macro invocation
- |
- = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:38:9
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: while 1 + 1 == 2 {
- | -- first declared here
-...
-LL | while_x!(break 'x);
- | ------------------ in this macro invocation
- |
- = note: this warning originates in the macro `while_x` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
- |
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
- |
-LL | 'x: loop {
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
+ --> $DIR/hygienic-labels.rs:59:5
|
-LL | 'x: loop { $e }
- | -- first declared here
-...
LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
- |
-LL | 'x: while 1 + 1 == 2 {
| -- first declared here
...
LL | 'x: for _ in 0..1 {
| ^^ label `'x` already in scope
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:73:5
- |
-LL | 'x: while 1 + 1 == 2 { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 {
- | ^^ label `'x` already in scope
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: loop {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: loop { $e }
- | -- first declared here
-...
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: while 1 + 1 == 2 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: while 1 + 1 == 2 { $e }
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: label name `'x` shadows a label name that is already in scope
- --> $DIR/hygienic-labels.rs:24:9
- |
-LL | 'x: for _ in 0..1 { $e }
- | ^^ label `'x` already in scope
-...
-LL | 'x: for _ in 0..1 {
- | -- first declared here
-...
-LL | run_once!(continue 'x);
- | ---------------------- in this macro invocation
- |
- = note: this warning originates in the macro `run_once` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: 28 warnings emitted
+warning: 3 warnings emitted
--> $DIR/label_misspelled.rs:6:9
|
LL | 'while_loop: while true {
- | ----------- a label with a similar name exists
+ | -----------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL |
LL | while_loop;
| ^^^^^^^^^^ not found in this scope
--> $DIR/label_misspelled.rs:11:9
|
LL | 'while_let: while let Some(_) = Some(()) {
- | ---------- a label with a similar name exists
+ | ----------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL |
LL | while_let;
| ^^^^^^^^^ not found in this scope
--> $DIR/label_misspelled.rs:16:9
|
LL | 'for_loop: for _ in 0..3 {
- | --------- a label with a similar name exists
+ | ---------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL |
LL | for_loop;
| ^^^^^^^^ not found in this scope
--> $DIR/label_misspelled.rs:21:9
|
LL | 'LOOP: loop {
- | ----- a label with a similar name exists
+ | -----
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL |
LL | LOOP;
| ^^^^ not found in this scope
--> $DIR/label_misspelled.rs:28:15
|
LL | 'LOOP: loop {
- | ----- a label with a similar name exists
+ | -----
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break LOOP;
- | ^^^^
- | |
- | not found in this scope
- | help: use the similarly named label: `'LOOP`
+ | ^^^^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'LOOP;
+ | ~~~~~
+help: use the similarly named label
+ |
+LL | break 'LOOP;
+ | ~~~~~
error[E0425]: cannot find value `while_loop` in this scope
--> $DIR/label_misspelled.rs:32:15
|
LL | 'while_loop: while true {
- | ----------- a label with a similar name exists
+ | -----------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break while_loop;
- | ^^^^^^^^^^
- | |
- | not found in this scope
- | help: use the similarly named label: `'while_loop`
+ | ^^^^^^^^^^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'while_loop;
+ | ~~~~~~~~~~~
+help: use the similarly named label
+ |
+LL | break 'while_loop;
+ | ~~~~~~~~~~~
error[E0425]: cannot find value `while_let` in this scope
--> $DIR/label_misspelled.rs:36:15
|
LL | 'while_let: while let Some(_) = Some(()) {
- | ---------- a label with a similar name exists
+ | ----------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break while_let;
- | ^^^^^^^^^
- | |
- | not found in this scope
- | help: use the similarly named label: `'while_let`
+ | ^^^^^^^^^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'while_let;
+ | ~~~~~~~~~~
+help: use the similarly named label
+ |
+LL | break 'while_let;
+ | ~~~~~~~~~~
error[E0425]: cannot find value `for_loop` in this scope
--> $DIR/label_misspelled.rs:40:15
|
LL | 'for_loop: for _ in 0..3 {
- | --------- a label with a similar name exists
+ | ---------
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break for_loop;
- | ^^^^^^^^
- | |
- | not found in this scope
- | help: use the similarly named label: `'for_loop`
+ | ^^^^^^^^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'for_loop;
+ | ~~~~~~~~~
+help: use the similarly named label
+ |
+LL | break 'for_loop;
+ | ~~~~~~~~~
warning: unused label
--> $DIR/label_misspelled.rs:4:5
--> $DIR/label_misspelled_2.rs:8:15
|
LL | 'b: for _ in 0..1 {
- | -- a label with a similar name exists
+ | --
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break b;
- | ^
- | |
- | not found in this scope
- | help: use the similarly named label: `'b`
+ | ^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'b;
+ | ~~
+help: use the similarly named label
+ |
+LL | break 'b;
+ | ~~
error[E0425]: cannot find value `d` in this scope
--> $DIR/label_misspelled_2.rs:14:15
|
LL | d: for _ in 0..1 {
- | - a label with a similar name exists
+ | -
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break d;
- | ^
- | |
- | not found in this scope
- | help: use the similarly named label: `'d`
+ | ^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'd;
+ | ~~
+help: use the similarly named label
+ |
+LL | break 'd;
+ | ~~
error: aborting due to 4 previous errors
//~^ WARN unused label
'many_used_shadowed: for _ in 0..10 {
//~^ WARN label name `'many_used_shadowed` shadows a label name that is already in scope
+ //~| WARN label name `'many_used_shadowed` shadows a label name that is already in scope
if 1 % 2 == 0 {
break 'many_used_shadowed;
} else {
+warning: label name `'many_used_shadowed` shadows a label name that is already in scope
+ --> $DIR/unused_labels.rs:62:9
+ |
+LL | 'many_used_shadowed: for _ in 0..10 {
+ | ------------------- first declared here
+LL |
+LL | 'many_used_shadowed: for _ in 0..10 {
+ | ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
+
+warning: label name `'many_used_shadowed` shadows a label name that is already in scope
+ --> $DIR/unused_labels.rs:62:9
+ |
+LL | 'many_used_shadowed: for _ in 0..10 {
+ | ------------------- first declared here
+LL |
+LL | 'many_used_shadowed: for _ in 0..10 {
+ | ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
+
warning: unused label
--> $DIR/unused_labels.rs:11:5
|
| ^^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:72:5
+ --> $DIR/unused_labels.rs:73:5
|
LL | 'unused_loop_label: loop {
| ^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:78:5
+ --> $DIR/unused_labels.rs:79:5
|
LL | 'unused_block_label: {
| ^^^^^^^^^^^^^^^^^^^
-warning: label name `'many_used_shadowed` shadows a label name that is already in scope
- --> $DIR/unused_labels.rs:62:9
- |
-LL | 'many_used_shadowed: for _ in 0..10 {
- | ------------------- first declared here
-LL |
-LL | 'many_used_shadowed: for _ in 0..10 {
- | ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
-
-warning: 9 warnings emitted
+warning: 10 warnings emitted
--> $DIR/loop-break-value.rs:95:15
|
LL | 'LOOP: for _ in 0 .. 9 {
- | ----- a label with a similar name exists
+ | -----
+ | |
+ | a label with a similar name exists
+ | a label with a similar name exists
LL | break LOOP;
- | ^^^^
- | |
- | not found in this scope
- | help: use the similarly named label: `'LOOP`
+ | ^^^^ not found in this scope
+ |
+help: use the similarly named label
+ |
+LL | break 'LOOP;
+ | ~~~~~
+help: use the similarly named label
+ |
+LL | break 'LOOP;
+ | ~~~~~
warning: denote infinite loops with `loop { ... }`
--> $DIR/loop-break-value.rs:26:5
}
macro_rules! br2 {
($b:lifetime) => {
- 'b: loop { //~ WARNING `'b` shadows a label name that is already in scope
+ 'b: loop {
break $b; // this $b should refer to the outer loop.
}
}
+++ /dev/null
-warning: label name `'b` shadows a label name that is already in scope
- --> $DIR/macro-lifetime-used-with-labels.rs:21:9
- |
-LL | 'b: loop {
- | ^^ label `'b` already in scope
-...
-LL | 'b: loop {
- | -- first declared here
-LL | br2!('b);
- | -------- in this macro invocation
- |
- = note: this warning originates in the macro `br2` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: 1 warning emitted
-
-struct Foo<'a, 'a> { //~ ERROR lifetime name `'a` declared twice
- x: &'a isize
+struct Foo<'a, 'a> {
+ //~^ ERROR lifetime name `'a` declared twice
+ //~| ERROR parameter `'a` is never used [E0392]
+ x: &'a isize,
}
fn main() {}
--> $DIR/regions-name-duplicated.rs:1:16
|
LL | struct Foo<'a, 'a> {
- | -- ^^ declared twice
+ | -- ^^ lifetime `'a` already in scope
| |
- | previous declaration here
+ | first declared here
-error: aborting due to previous error
+error[E0392]: parameter `'a` is never used
+ --> $DIR/regions-name-duplicated.rs:1:12
+ |
+LL | struct Foo<'a, 'a> {
+ | ^^ unused parameter
+ |
+ = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
+
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0263`.
+Some errors have detailed explanations: E0263, E0392.
+For more information about an error, try `rustc --explain E0263`.