Normalise diagnostics with respect to "the X is declared/defined here"
This commit is contained in:
parent
dee12bb2b7
commit
f4f96e2943
8 changed files with 8 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ error: cannot define multiple global allocators
|
|||
--> $DIR/two-allocators.rs:6:1
|
||||
|
|
||||
LL | static A: System = System;
|
||||
| -------------------------- previous global allocator is defined here
|
||||
| -------------------------- previous global allocator defined here
|
||||
LL | #[global_allocator]
|
||||
LL | static B: System = System;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of closure
|
|||
--> $DIR/issue-45983.rs:20:18
|
||||
|
|
||||
LL | let x = None;
|
||||
| - `x` is declared here, outside of the closure body
|
||||
| - `x` declared here, outside of the closure body
|
||||
LL | give_any(|y| x = Some(y));
|
||||
| - ^^^^^^^^^^^ `y` escapes the closure body here
|
||||
| |
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of generator
|
|||
--> $DIR/ref-escapes-but-not-over-yield.rs:11:9
|
||||
|
|
||||
LL | let mut a = &3;
|
||||
| ----- `a` is declared here, outside of the generator body
|
||||
| ----- `a` declared here, outside of the generator body
|
||||
...
|
||||
LL | a = &b;
|
||||
| ^^^^--
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ error[E0521]: borrowed data escapes outside of closure
|
|||
LL | foo(cell, |cell_a, cell_x| {
|
||||
| ------ ------ `cell_x` is a reference that is only valid in the closure body
|
||||
| |
|
||||
| `cell_a` is declared here, outside of the closure body
|
||||
| `cell_a` declared here, outside of the closure body
|
||||
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ error[E0521]: borrowed data escapes outside of function
|
|||
LL | fn get_bar(&self) -> Bar2 {
|
||||
| -----
|
||||
| |
|
||||
| `self` is declared here, outside of the function body
|
||||
| `self` declared here, outside of the function body
|
||||
| `self` is a reference that is only valid in the function body
|
||||
LL | Bar2::new(&self)
|
||||
| ^^^^^^^^^^^^^^^^ `self` escapes the function body here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue