mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Update UI tests
This commit is contained in:
parent
99b1054d9f
commit
7ba5fd168a
@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable local variable `y` as mutable
|
||||
|
|
||||
LL | let y = Int(2);
|
||||
| - consider changing this to `mut y`
|
||||
29 | //~^ consider changing this to `mut y`
|
||||
LL | //~^ consider changing this to `mut y`
|
||||
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||
| ^ cannot borrow mutably
|
||||
|
||||
|
@ -3,14 +3,14 @@ error[E0255]: the name `foo` is defined multiple times
|
||||
|
|
||||
LL | mod foo { pub mod foo { } }
|
||||
| ------- previous definition of the module `foo` here
|
||||
12 |
|
||||
LL |
|
||||
LL | use foo::foo;
|
||||
| ^^^^^^^^ `foo` reimported here
|
||||
|
|
||||
= note: `foo` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
13 | use foo::foo as other_foo;
|
||||
LL | use foo::foo as other_foo;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -6,7 +6,7 @@ LL | fn foo() -> String { //~ ERROR mismatched types
|
||||
LL | | format!("Hello {}",
|
||||
LL | | "world")
|
||||
LL | | // Put the trailing semicolon on its own line to test that the
|
||||
17 | | // note message gets the offending semicolon exactly
|
||||
LL | | // note message gets the offending semicolon exactly
|
||||
LL | | ;
|
||||
| | - help: consider removing this semicolon
|
||||
LL | | }
|
||||
|
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
||||
|
|
||||
LL | fn main() {
|
||||
| - expected `()` because of default return type
|
||||
24 | let b = Bob + 3.5;
|
||||
LL | let b = Bob + 3.5;
|
||||
LL | b + 3 //~ ERROR E0277
|
||||
| ^^^^^ expected (), found struct `Bob`
|
||||
|
|
||||
|
@ -8,11 +8,11 @@ LL | foo() //~ ERROR mismatched types
|
||||
found type `usize`
|
||||
help: try adding a semicolon
|
||||
|
|
||||
19 | foo(); //~ ERROR mismatched types
|
||||
LL | foo(); //~ ERROR mismatched types
|
||||
| ^
|
||||
help: try adding a return type
|
||||
|
|
||||
18 | fn bar() -> usize {
|
||||
LL | fn bar() -> usize {
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
36 | //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
@ -14,7 +14,7 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
45 | //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
@ -25,7 +25,7 @@ error[E0382]: use of moved value: `a`
|
||||
|
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
54 | //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = &a.y; //~ ERROR use of moved
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
@ -62,7 +62,7 @@ LL | let _x = &mut a.x;
|
||||
| --- mutable borrow occurs here (via `a.x`)
|
||||
LL | let _y = &a.y; //~ ERROR cannot borrow
|
||||
| ^^^ immutable borrow occurs here (via `a.y`)
|
||||
86 | //~^ immutable borrow occurs here (via `a.y`)
|
||||
LL | //~^ immutable borrow occurs here (via `a.y`)
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
@ -73,7 +73,7 @@ LL | let _x = &a.x;
|
||||
| --- immutable borrow occurs here (via `a.x`)
|
||||
LL | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow occurs here (via `a.y`)
|
||||
93 | //~^ mutable borrow occurs here (via `a.y`)
|
||||
LL | //~^ mutable borrow occurs here (via `a.y`)
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
@ -82,7 +82,7 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
99 | //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
@ -93,7 +93,7 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
107| //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
@ -104,7 +104,7 @@ error[E0382]: use of collaterally moved value: `a.y`
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
115| //~^ value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = &a.y; //~ ERROR use of collaterally moved
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
@ -115,7 +115,7 @@ error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
123| //~^ borrow of `a.x.x` occurs here
|
||||
LL | //~^ borrow of `a.x.x` occurs here
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
@ -140,10 +140,10 @@ error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- mutable borrow occurs here
|
||||
146| //~^ mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | let _y = &a.y; //~ ERROR cannot borrow
|
||||
| ^^^ immutable borrow occurs here
|
||||
148| //~^ immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
@ -152,10 +152,10 @@ error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- immutable borrow occurs here
|
||||
154| //~^ immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow occurs here
|
||||
156| //~^ mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
|
@ -9,7 +9,7 @@ LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable mo
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
@ -24,7 +24,7 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as muta
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
@ -39,7 +39,7 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as muta
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
@ -84,7 +84,7 @@ LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable mo
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
@ -99,7 +99,7 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as muta
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
@ -114,7 +114,7 @@ LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as muta
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
|
@ -7,7 +7,7 @@ LL | spawn(|| books.push(4));
|
||||
| may outlive borrowed value `books`
|
||||
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
23 | spawn(move || books.push(4));
|
||||
LL | spawn(move || books.push(4));
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -7,7 +7,7 @@ LL | Box::new(|| books.push(4))
|
||||
| may outlive borrowed value `books`
|
||||
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
21 | Box::new(move || books.push(4))
|
||||
LL | Box::new(move || books.push(4))
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0507]: cannot move out of borrowed content
|
||||
|
|
||||
LL | match *f { //~ ERROR cannot move out of
|
||||
| ^^ cannot move out of borrowed content
|
||||
22 | //~| cannot move out
|
||||
LL | //~| cannot move out
|
||||
LL | Foo::Foo1(num1,
|
||||
| ---- hint: to prevent move, use `ref num1` or `ref mut num1`
|
||||
LL | num2) => (),
|
||||
@ -28,7 +28,7 @@ error[E0507]: cannot move out of borrowed content
|
||||
|
|
||||
LL | match a.a { //~ ERROR cannot move out of
|
||||
| ^ cannot move out of borrowed content
|
||||
58 | //~| cannot move out
|
||||
LL | //~| cannot move out
|
||||
LL | n => {
|
||||
| - hint: to prevent move, use `ref n` or `ref mut n`
|
||||
|
||||
|
@ -3,10 +3,10 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| - mutable borrow occurs here
|
||||
16 | //~^ mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | let z = &x; //~ ERROR cannot borrow
|
||||
| ^ immutable borrow occurs here
|
||||
18 | //~^ immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
@ -15,10 +15,10 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
|
||||
|
|
||||
LL | let y = &x;
|
||||
| - immutable borrow occurs here
|
||||
27 | //~^ immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ mutable borrow occurs here
|
||||
29 | //~^ mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
@ -27,10 +27,10 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
40 | //~^ first mutable borrow occurs here
|
||||
LL | //~^ first mutable borrow occurs here
|
||||
LL | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ second mutable borrow occurs here
|
||||
42 | //~^ second mutable borrow occurs here
|
||||
LL | //~^ second mutable borrow occurs here
|
||||
LL | };
|
||||
| - first borrow ends here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||
|
|
||||
LL | [box ref _a, _, _] => {
|
||||
| ------ borrow of `vec[..]` occurs here
|
||||
20 | //~^ borrow of `vec[..]` occurs here
|
||||
LL | //~^ borrow of `vec[..]` occurs here
|
||||
LL | vec[0] = box 4; //~ ERROR cannot assign
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||
|
|
||||
LL | &mut [ref _b..] => {
|
||||
| ------ borrow of `vec[..]` occurs here
|
||||
32 | //~^ borrow of `vec[..]` occurs here
|
||||
LL | //~^ borrow of `vec[..]` occurs here
|
||||
LL | vec[0] = box 4; //~ ERROR cannot assign
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||
|
||||
|
@ -26,7 +26,7 @@ LL | if let Some(thing) = maybe {
|
||||
LL | | //~^ ERROR use of partially moved value: `maybe` (Ast) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
21 | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe.0` (Mir) [E0382]
|
||||
LL | | }
|
||||
| |_________^ value used here after move
|
||||
|
@ -3,7 +3,7 @@ error: borrowed data cannot be stored outside of its closure
|
||||
|
|
||||
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
|
||||
| - cannot infer an appropriate lifetime...
|
||||
28 | //~^ NOTE cannot infer an appropriate lifetime
|
||||
LL | //~^ NOTE cannot infer an appropriate lifetime
|
||||
LL | let push_id = |installed_id: &CrateId| {
|
||||
| ------- ------------------------ borrowed data cannot outlive this closure
|
||||
| |
|
||||
|
@ -3,7 +3,7 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
|
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
21 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
|
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
27 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
@ -21,7 +21,7 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
|
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
34 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
||||
|
|
||||
LL | let y = vec![format!("World")];
|
||||
| - captured outer variable
|
||||
20 | call(|| {
|
||||
LL | call(|| {
|
||||
LL | y.into_iter();
|
||||
| ^ cannot move out of captured outer variable in an `Fn` closure
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0382]: use of moved value: `some_vec`
|
||||
|
|
||||
LL | some_vec.into_iter();
|
||||
| -------- value moved here
|
||||
16 | {
|
||||
LL | {
|
||||
LL | println!("{:?}", some_vec); //~ ERROR use of moved
|
||||
| ^^^^^^^^ value used here after move
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||
|
|
||||
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
18 | //~^ ERROR E0592
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0592]: duplicate definitions with name `f`
|
||||
|
|
||||
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
||||
| ^^^^^^^^^^^^^^ duplicate definitions for `f`
|
||||
24 | //~^ ERROR E0592
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<X> A<i32, X> { fn f(&self) {} }
|
||||
| -------------- other definition for `f`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||
|
|
||||
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
20 | //~^ ERROR E0592
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||
|
|
||||
LL | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
22 | //~^ ERROR E0592
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl A<i16> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
|
||||
|
@ -27,7 +27,7 @@ error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
||||
|
|
||||
LL | fn foo1(&self, other: &Z) {
|
||||
| -- use `&mut Z` here to make mutable
|
||||
30 | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
||||
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
||||
|
||||
@ -44,7 +44,7 @@ error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
||||
|
|
||||
LL | fn foo2<'a>(&'a self, other: &Z) {
|
||||
| -- use `&mut Z` here to make mutable
|
||||
35 | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
||||
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
||||
|
||||
@ -61,7 +61,7 @@ error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
|
||||
|
|
||||
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
|
||||
| -- use `&mut Z` here to make mutable
|
||||
40 | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut self.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut other.x; //~ ERROR cannot borrow
|
||||
| ^^^^^^^ cannot mutably borrow field of immutable binding
|
||||
|
||||
@ -86,7 +86,7 @@ error[E0596]: cannot borrow field `w.x` of immutable binding as mutable
|
||||
|
|
||||
LL | pub fn with_arg(z: Z, w: &Z) {
|
||||
| -- use `&mut Z` here to make mutable
|
||||
51 | let _ = &mut z.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut z.x; //~ ERROR cannot borrow
|
||||
LL | let _ = &mut w.x; //~ ERROR cannot borrow
|
||||
| ^^^ cannot mutably borrow field of immutable binding
|
||||
|
||||
|
@ -8,9 +8,9 @@ LL | this_function_expects_a_double_option(n);
|
||||
found type `usize`
|
||||
help: try using a variant of the expected type
|
||||
|
|
||||
21 | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
|
||||
LL | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
21 | this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
|
||||
LL | this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -9,7 +9,7 @@ LL | use sub2::foo; //~ ERROR the name `foo` is defined multiple times
|
||||
= note: `foo` must be defined only once in the value namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
23 | use sub2::foo as other_foo; //~ ERROR the name `foo` is defined multiple times
|
||||
LL | use sub2::foo as other_foo; //~ ERROR the name `foo` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -5,7 +5,7 @@ LL | / impl<#[may_dangle] A, B: fmt::Debug> Drop for Pt<A, B> {
|
||||
LL | | //~^ ERROR requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
|
||||
LL | |
|
||||
LL | | // (unsafe to access self.1 due to #[may_dangle] on A)
|
||||
36 | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
|
||||
LL | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
@ -16,7 +16,7 @@ LL | / impl<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> {
|
||||
LL | | //~^ ERROR requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
|
||||
LL | |
|
||||
LL | | // (unsafe to access self.1 due to #[may_dangle] on 'a)
|
||||
42 | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
|
||||
LL | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
|
@ -17,7 +17,7 @@ LL | let e4 = E::Empty4();
|
||||
| ^^^^^^^^^^^ not a function
|
||||
help: `E::Empty4` is a unit variant, you need to write it without the parenthesis
|
||||
|
|
||||
26 | let e4 = E::Empty4;
|
||||
LL | let e4 = E::Empty4;
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0618]: expected function, found `empty_struct::XEmpty2`
|
||||
@ -33,7 +33,7 @@ LL | let xe4 = XE::XEmpty4();
|
||||
| ^^^^^^^^^^^^^ not a function
|
||||
help: `XE::XEmpty4` is a unit variant, you need to write it without the parenthesis
|
||||
|
|
||||
29 | let xe4 = XE::XEmpty4;
|
||||
LL | let xe4 = XE::XEmpty4;
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
@ -3,7 +3,7 @@ error[E0194]: type parameter `T` shadows another type parameter of the same name
|
||||
|
|
||||
LL | trait Foo<T> {
|
||||
| - first `T` declared here
|
||||
12 | fn do_something(&self) -> T;
|
||||
LL | fn do_something(&self) -> T;
|
||||
LL | fn do_something_else<T: Clone>(&self, bar: T);
|
||||
| ^ shadows another type parameter
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | type A: T1;
|
||||
...
|
||||
LL | type A: T2;
|
||||
| ----------- ambiguous `A` from `Bar`
|
||||
20 | fn do_something() {
|
||||
LL | fn do_something() {
|
||||
LL | let _: Self::A;
|
||||
| ^^^^^^^ ambiguous associated type `A`
|
||||
|
||||
@ -15,7 +15,7 @@ error[E0221]: ambiguous associated type `Err` in bounds of `Self`
|
||||
|
|
||||
LL | type Err: T3;
|
||||
| ------------- ambiguous `Err` from `My`
|
||||
30 | fn test() {
|
||||
LL | fn test() {
|
||||
LL | let _: Self::Err;
|
||||
| ^^^^^^^^^ ambiguous associated type `Err`
|
||||
|
|
||||
|
@ -9,7 +9,7 @@ LL | use bar::baz; //~ ERROR E0252
|
||||
= note: `baz` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
12 | use bar::baz as other_baz; //~ ERROR E0252
|
||||
LL | use bar::baz as other_baz; //~ ERROR E0252
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -10,7 +10,7 @@ LL | use foo::alloc;
|
||||
= note: `alloc` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
22 | use foo::alloc as other_alloc;
|
||||
LL | use foo::alloc as other_alloc;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,14 +3,14 @@ error[E0255]: the name `foo` is defined multiple times
|
||||
|
|
||||
LL | use bar::foo;
|
||||
| -------- previous import of the value `foo` here
|
||||
12 |
|
||||
LL |
|
||||
LL | fn foo() {} //~ ERROR E0255
|
||||
| ^^^^^^^^ `foo` redefined here
|
||||
|
|
||||
= note: `foo` must be defined only once in the value namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
11 | use bar::foo as other_foo;
|
||||
LL | use bar::foo as other_foo;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0259]: the name `alloc` is defined multiple times
|
||||
|
|
||||
LL | extern crate alloc;
|
||||
| ------------------- previous import of the extern crate `alloc` here
|
||||
15 |
|
||||
LL |
|
||||
LL | extern crate libc as alloc;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
|
@ -3,14 +3,14 @@ error[E0260]: the name `alloc` is defined multiple times
|
||||
|
|
||||
LL | extern crate alloc;
|
||||
| ------------------- previous import of the extern crate `alloc` here
|
||||
15 |
|
||||
LL |
|
||||
LL | mod alloc {
|
||||
| ^^^^^^^^^ `alloc` redefined here
|
||||
|
|
||||
= note: `alloc` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
14 | extern crate alloc as other_alloc;
|
||||
LL | extern crate alloc as other_alloc;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -17,7 +17,7 @@ LL | use std::fmt::{self, self}; //~ ERROR E0430
|
||||
= note: `fmt` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
11 | use std::fmt::{self, self as other_fmt}; //~ ERROR E0430
|
||||
LL | use std::fmt::{self, self as other_fmt}; //~ ERROR E0430
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -3,7 +3,7 @@ error[E0453]: allow(non_snake_case) overruled by outer forbid(non_snake_case)
|
||||
|
|
||||
LL | #![forbid(non_snake_case)]
|
||||
| -------------- `forbid` level set here
|
||||
12 |
|
||||
LL |
|
||||
LL | #[allow(non_snake_case)]
|
||||
| ^^^^^^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0597]: `y` does not live long enough
|
||||
|
|
||||
LL | x.x = Some(&y);
|
||||
| ^ borrowed value does not live long enough
|
||||
19 | //~^ `y` does not live long enough [E0597]
|
||||
LL | //~^ `y` does not live long enough [E0597]
|
||||
LL | }
|
||||
| - `y` dropped here while still borrowed
|
||||
|
|
||||
|
@ -35,7 +35,7 @@ LL | printf(::std::ptr::null(), printf);
|
||||
| ^^^^^^
|
||||
help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
|
||||
|
|
||||
34 | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));
|
||||
LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -8,7 +8,7 @@ LL | X::Entry();
|
||||
| ^^^^^^^^^^ not a function
|
||||
help: `X::Entry` is a unit variant, you need to write it without the parenthesis
|
||||
|
|
||||
16 | X::Entry;
|
||||
LL | X::Entry;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0618]: expected function, found `i32`
|
||||
|
@ -5,7 +5,7 @@ error[E0518]: attribute should be applied to function
|
||||
|
|
||||
LL | #[inline = "2100"]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
22 | //~^ ERROR attribute should be applied to function
|
||||
LL | //~^ ERROR attribute should be applied to function
|
||||
LL | / mod inline {
|
||||
LL | | mod inner { #![inline="2100"] }
|
||||
LL | | //~^ ERROR attribute should be applied to function
|
||||
|
@ -5,7 +5,7 @@ LL | (|| yield &a).resume()
|
||||
| -- ^ borrowed value does not live long enough
|
||||
| |
|
||||
| capture occurs here
|
||||
19 | //~^ ERROR: `a` does not live long enough
|
||||
LL | //~^ ERROR: `a` does not live long enough
|
||||
LL | };
|
||||
| - borrowed value only lives until here
|
||||
...
|
||||
|
@ -3,7 +3,7 @@ error[E0597]: `ref_` does not live long enough
|
||||
|
|
||||
LL | gen = || {
|
||||
| -- capture occurs here
|
||||
22 | // but the generator can use it to drop a `Ref<'a, i32>`.
|
||||
LL | // but the generator can use it to drop a `Ref<'a, i32>`.
|
||||
LL | let _d = ref_.take(); //~ ERROR `ref_` does not live long enough
|
||||
| ^^^^ borrowed value does not live long enough
|
||||
...
|
||||
|
@ -12,7 +12,7 @@ error[E0626]: borrow may still be in use when generator yields (Ast)
|
||||
|
|
||||
LL | let b = &mut true; //~ ERROR borrow may still be in use when generator yields (Ast)
|
||||
| ^^^^
|
||||
21 | //~^ borrow may still be in use when generator yields (Mir)
|
||||
LL | //~^ borrow may still be in use when generator yields (Mir)
|
||||
LL | yield ();
|
||||
| -------- possible yield occurs here
|
||||
|
||||
@ -21,7 +21,7 @@ error[E0626]: borrow may still be in use when generator yields (Mir)
|
||||
|
|
||||
LL | let b = &mut true; //~ ERROR borrow may still be in use when generator yields (Ast)
|
||||
| ^^^^^^^^^
|
||||
21 | //~^ borrow may still be in use when generator yields (Mir)
|
||||
LL | //~^ borrow may still be in use when generator yields (Mir)
|
||||
LL | yield ();
|
||||
| -------- possible yield occurs here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0597]: `b` does not live long enough
|
||||
|
|
||||
LL | a = &b;
|
||||
| ^ borrowed value does not live long enough
|
||||
25 | //~^ ERROR `b` does not live long enough
|
||||
LL | //~^ ERROR `b` does not live long enough
|
||||
LL | };
|
||||
| - `b` dropped here while still borrowed
|
||||
LL | }
|
||||
|
@ -16,7 +16,7 @@ LL | for p in &mut x {
|
||||
...
|
||||
LL | println!("{}", x[0]); //~ ERROR
|
||||
| ^ immutable borrow occurs here
|
||||
68 | b.resume();
|
||||
LL | b.resume();
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
|
@ -8,7 +8,7 @@ LL | let a = &mut *x;
|
||||
...
|
||||
LL | println!("{}", x); //~ ERROR
|
||||
| ^ borrow occurs here
|
||||
46 | b.resume();
|
||||
LL | b.resume();
|
||||
LL | }
|
||||
| - borrow from closure ends here
|
||||
|
||||
|
@ -7,13 +7,13 @@ LL | 1u32.method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following traits are implemented but not in scope, perhaps add a `use` for one of them:
|
||||
|
|
||||
14 | use foo::Bar;
|
||||
LL | use foo::Bar;
|
||||
|
|
||||
14 | use no_method_suggested_traits::foo::PubPub;
|
||||
LL | use no_method_suggested_traits::foo::PubPub;
|
||||
|
|
||||
14 | use no_method_suggested_traits::qux::PrivPub;
|
||||
LL | use no_method_suggested_traits::qux::PrivPub;
|
||||
|
|
||||
14 | use no_method_suggested_traits::Reexported;
|
||||
LL | use no_method_suggested_traits::Reexported;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
|
||||
@ -25,13 +25,13 @@ LL | std::rc::Rc::new(&mut Box::new(&1u32)).method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following traits are implemented but not in scope, perhaps add a `use` for one of them:
|
||||
|
|
||||
14 | use foo::Bar;
|
||||
LL | use foo::Bar;
|
||||
|
|
||||
14 | use no_method_suggested_traits::foo::PubPub;
|
||||
LL | use no_method_suggested_traits::foo::PubPub;
|
||||
|
|
||||
14 | use no_method_suggested_traits::qux::PrivPub;
|
||||
LL | use no_method_suggested_traits::qux::PrivPub;
|
||||
|
|
||||
14 | use no_method_suggested_traits::Reexported;
|
||||
LL | use no_method_suggested_traits::Reexported;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `char` in the current scope
|
||||
@ -43,7 +43,7 @@ LL | 'a'.method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
|
|
||||
14 | use foo::Bar;
|
||||
LL | use foo::Bar;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&char>>` in the current scope
|
||||
@ -55,7 +55,7 @@ LL | std::rc::Rc::new(&mut Box::new(&'a')).method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
|
|
||||
14 | use foo::Bar;
|
||||
LL | use foo::Bar;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `i32` in the current scope
|
||||
@ -67,7 +67,7 @@ LL | 1i32.method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
|
|
||||
14 | use no_method_suggested_traits::foo::PubPub;
|
||||
LL | use no_method_suggested_traits::foo::PubPub;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
|
||||
@ -79,7 +79,7 @@ LL | std::rc::Rc::new(&mut Box::new(&1i32)).method();
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
|
|
||||
14 | use no_method_suggested_traits::foo::PubPub;
|
||||
LL | use no_method_suggested_traits::foo::PubPub;
|
||||
|
|
||||
|
||||
error[E0599]: no method named `method` found for type `Foo` in the current scope
|
||||
|
@ -11,7 +11,7 @@ LL | fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
|
||||
| ^^^^^ not found in this scope
|
||||
help: possible candidate is found in another module, you can import it into scope
|
||||
|
|
||||
13 | use std::fmt::Debug;
|
||||
LL | use std::fmt::Debug;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Debug` in this scope
|
||||
@ -21,7 +21,7 @@ LL | fn wants_display(g: impl Debug) { } //~ ERROR cannot find
|
||||
| ^^^^^ not found in this scope
|
||||
help: possible candidate is found in another module, you can import it into scope
|
||||
|
|
||||
13 | use std::fmt::Debug;
|
||||
LL | use std::fmt::Debug;
|
||||
|
|
||||
|
||||
error: cannot continue compilation due to previous error
|
||||
|
@ -9,7 +9,7 @@ LL | use a::foo; //~ ERROR the name `foo` is defined multiple times
|
||||
= note: `foo` must be defined only once in the value namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
25 | use a::foo as other_foo; //~ ERROR the name `foo` is defined multiple times
|
||||
LL | use a::foo as other_foo; //~ ERROR the name `foo` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
|
@ -3,7 +3,7 @@ error: `panic` is already in scope
|
||||
|
|
||||
LL | macro_rules! panic { () => {} } //~ ERROR `panic` is already in scope
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
43 | } }
|
||||
LL | } }
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
|
|
||||
|
@ -11,7 +11,7 @@ error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scop
|
||||
|
|
||||
LL | impl Foo<&'s u8> {
|
||||
| -- first declared here
|
||||
17 | fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
|
||||
LL | fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
|
||||
LL | fn baz(x: for<'s> fn(&'s u32)) {} //~ ERROR shadows a lifetime name
|
||||
| ^^ lifetime 's already in scope
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `cont`
|
||||
|
|
||||
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
|
||||
| ---- consider changing the type of `cont` to `&'r T`
|
||||
23 | {
|
||||
LL | {
|
||||
LL | let cont_iter = cont.iter();
|
||||
| ^^^^ lifetime `'r` required
|
||||
|
||||
|
@ -16,7 +16,7 @@ LL | let (c, d) = (&mut foo.a, &foo.b);
|
||||
| ----- ^^^^^ immutable borrow occurs here (via `foo.b`)
|
||||
| |
|
||||
| mutable borrow occurs here (via `foo.a`)
|
||||
22 | //~^ ERROR cannot borrow `foo` (via `foo.b`) as immutable
|
||||
LL | //~^ ERROR cannot borrow `foo` (via `foo.b`) as immutable
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
|
@ -3,14 +3,14 @@ error[E0255]: the name `A` is defined multiple times
|
||||
|
|
||||
LL | use self::A;
|
||||
| ------- previous import of the module `A` here
|
||||
12 | use self::B;
|
||||
LL | use self::B;
|
||||
LL | mod A {} //~ ERROR the name `A` is defined multiple times
|
||||
| ^^^^^ `A` redefined here
|
||||
|
|
||||
= note: `A` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
11 | use self::A as OtherA;
|
||||
LL | use self::A as OtherA;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `B` is defined multiple times
|
||||
@ -25,7 +25,7 @@ LL | pub mod B {} //~ ERROR the name `B` is defined multiple times
|
||||
= note: `B` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
12 | use self::B as OtherB;
|
||||
LL | use self::B as OtherB;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `D` is defined multiple times
|
||||
@ -39,7 +39,7 @@ LL | mod D {} //~ ERROR the name `D` is defined multiple times
|
||||
= note: `D` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
18 | use C::D as OtherD;
|
||||
LL | use C::D as OtherD;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -52,9 +52,9 @@ LL | 4);
|
||||
| - interpreted as generic arguments
|
||||
help: try comparing the casted value
|
||||
|
|
||||
25 | println!("{}", (a
|
||||
26 | as
|
||||
27 | usize)
|
||||
LL | println!("{}", (a
|
||||
LL | as
|
||||
LL | usize)
|
||||
|
|
||||
|
||||
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
|
||||
@ -66,12 +66,12 @@ LL | 5);
|
||||
| - interpreted as generic arguments
|
||||
help: try comparing the casted value
|
||||
|
|
||||
30 | println!("{}", (a
|
||||
31 |
|
||||
32 |
|
||||
33 | as
|
||||
34 |
|
||||
35 |
|
||||
LL | println!("{}", (a
|
||||
LL |
|
||||
LL |
|
||||
LL | as
|
||||
LL |
|
||||
LL |
|
||||
...
|
||||
|
||||
error: `<` is interpreted as a start of generic arguments for `usize`, not a shift
|
||||
|
@ -3,7 +3,7 @@ error[E0530]: function parameters cannot shadow statics
|
||||
|
|
||||
LL | static foo: i32 = 0;
|
||||
| -------------------- a static `foo` is defined here
|
||||
12 |
|
||||
LL |
|
||||
LL | fn bar(foo: i32) {}
|
||||
| ^^^ cannot be named the same as a static
|
||||
|
||||
@ -12,7 +12,7 @@ error[E0530]: function parameters cannot shadow statics
|
||||
|
|
||||
LL | use self::submod::answer;
|
||||
| -------------------- a static `answer` is imported here
|
||||
22 |
|
||||
LL |
|
||||
LL | fn question(answer: i32) {}
|
||||
| ^^^^^^ cannot be named the same as a static
|
||||
|
||||
|
@ -18,7 +18,7 @@ LL | | //~^ ERROR match arms have incompatible types
|
||||
LL | | 1 => |c| c + 1,
|
||||
LL | | 2 => |c| c - 1,
|
||||
| | --------- match arm with an incompatible type
|
||||
22 | | _ => |c| c - 1
|
||||
LL | | _ => |c| c - 1
|
||||
LL | | };
|
||||
| |_____^ expected closure, found a different closure
|
||||
|
|
||||
|
@ -10,7 +10,7 @@ LL | type Add = bool; //~ ERROR the name `Add` is defined multiple times
|
||||
= note: `Add` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
11 | use std::ops::Add as OtherAdd;
|
||||
LL | use std::ops::Add as OtherAdd;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `Sub` is defined multiple times
|
||||
@ -25,7 +25,7 @@ LL | struct Sub { x: f32 } //~ ERROR the name `Sub` is defined multiple times
|
||||
= note: `Sub` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
12 | use std::ops::Sub as OtherSub;
|
||||
LL | use std::ops::Sub as OtherSub;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `Mul` is defined multiple times
|
||||
@ -40,7 +40,7 @@ LL | enum Mul { A, B } //~ ERROR the name `Mul` is defined multiple times
|
||||
= note: `Mul` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
13 | use std::ops::Mul as OtherMul;
|
||||
LL | use std::ops::Mul as OtherMul;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `Div` is defined multiple times
|
||||
@ -55,7 +55,7 @@ LL | mod Div { } //~ ERROR the name `Div` is defined multiple times
|
||||
= note: `Div` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
14 | use std::ops::Div as OtherDiv;
|
||||
LL | use std::ops::Div as OtherDiv;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `Rem` is defined multiple times
|
||||
@ -70,7 +70,7 @@ LL | trait Rem { } //~ ERROR the name `Rem` is defined multiple times
|
||||
= note: `Rem` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
15 | use std::ops::Rem as OtherRem;
|
||||
LL | use std::ops::Rem as OtherRem;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -9,7 +9,7 @@ LL | use std::sync::Arc; //~ ERROR the name `Arc` is defined multiple times
|
||||
= note: `Arc` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
12 | use std::sync::Arc as OtherArc; //~ ERROR the name `Arc` is defined multiple times
|
||||
LL | use std::sync::Arc as OtherArc; //~ ERROR the name `Arc` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0252]: the name `sync` is defined multiple times
|
||||
@ -24,7 +24,7 @@ LL | use std::sync; //~ ERROR the name `sync` is defined multiple times
|
||||
= note: `sync` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
14 | use std::sync as other_sync; //~ ERROR the name `sync` is defined multiple times
|
||||
LL | use std::sync as other_sync; //~ ERROR the name `sync` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -11,7 +11,7 @@ error: unreachable pattern
|
||||
|
|
||||
LL | Nil => true,
|
||||
| --- matches any value
|
||||
24 | //~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack`
|
||||
LL | //~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack`
|
||||
LL | _ => false
|
||||
| ^ unreachable pattern
|
||||
|
|
||||
|
@ -14,7 +14,7 @@ LL | Apple(5)
|
||||
| ^^^^^ not found in this scope
|
||||
help: possible candidate is found in another module, you can import it into scope
|
||||
|
|
||||
12 | use Fruit::Apple;
|
||||
LL | use Fruit::Apple;
|
||||
|
|
||||
|
||||
error[E0573]: expected type, found variant `Fruit::Apple`
|
||||
@ -33,7 +33,7 @@ LL | Apple(5)
|
||||
| ^^^^^ not found in this scope
|
||||
help: possible candidate is found in another module, you can import it into scope
|
||||
|
|
||||
12 | use Fruit::Apple;
|
||||
LL | use Fruit::Apple;
|
||||
|
|
||||
|
||||
error[E0573]: expected type, found variant `Ok`
|
||||
|
@ -5,7 +5,7 @@ LL | arg.wait();
|
||||
| ^^^^
|
||||
help: another candidate was found in the following trait, perhaps add a `use` for it:
|
||||
|
|
||||
11 | use private::Future;
|
||||
LL | use private::Future;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0072]: recursive type `S` has infinite size
|
||||
|
|
||||
LL | struct S {
|
||||
| ^^^^^^^^ recursive type has infinite size
|
||||
12 | //~^ ERROR E0072
|
||||
LL | //~^ ERROR E0072
|
||||
LL | element: Option<S>
|
||||
| ------------------ recursive without indirection
|
||||
|
|
||||
|
@ -5,7 +5,7 @@ LL | / fn next(&'a mut self) -> Option<Self::Item>
|
||||
LL | | //~^ ERROR method not compatible with trait
|
||||
LL | | //~| lifetime mismatch
|
||||
LL | | {
|
||||
20 | | Some(&mut self.0)
|
||||
LL | | Some(&mut self.0)
|
||||
LL | | }
|
||||
| |_____^ lifetime mismatch
|
||||
|
|
||||
@ -18,7 +18,7 @@ LL | / fn next(&'a mut self) -> Option<Self::Item>
|
||||
LL | | //~^ ERROR method not compatible with trait
|
||||
LL | | //~| lifetime mismatch
|
||||
LL | | {
|
||||
20 | | Some(&mut self.0)
|
||||
LL | | Some(&mut self.0)
|
||||
LL | | }
|
||||
| |_____^
|
||||
note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:1
|
||||
|
@ -5,7 +5,7 @@ LL | 3.f()
|
||||
| ^
|
||||
help: you must specify a concrete type for this numeric value, like `i32`
|
||||
|
|
||||
19 | 3_i32.f()
|
||||
LL | 3_i32.f()
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -7,7 +7,7 @@ LL | id(Box::new(|| *v))
|
||||
| may outlive borrowed value `v`
|
||||
help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
16 | id(Box::new(move || *v))
|
||||
LL | id(Box::new(move || *v))
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0507]: cannot move out of borrowed content
|
||||
|
@ -3,7 +3,7 @@ error: unnecessary `unsafe` block
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
16 | let f = |v: &mut Vec<_>| {
|
||||
LL | let f = |v: &mut Vec<_>| {
|
||||
LL | unsafe { //~ ERROR unnecessary `unsafe`
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
|
@ -5,7 +5,7 @@ LL | let _a = b + ", World!";
|
||||
| ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
|
|
||||
13 | let _a = b.to_owned() + ", World!";
|
||||
LL | let _a = b.to_owned() + ", World!";
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -5,7 +5,7 @@ LL | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
|
||||
| ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
|
|
||||
12 | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
|
||||
LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -3,7 +3,7 @@ error[E0061]: this function takes 1 parameter but 2 parameters were supplied
|
||||
|
|
||||
LL | fn foo(a: usize) {}
|
||||
| ---------------- defined here
|
||||
14 | //~^ defined here
|
||||
LL | //~^ defined here
|
||||
LL | fn main() { foo(5, 6) }
|
||||
| ^^^^^^^^^ expected 1 parameter
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `x`
|
||||
|
|
||||
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
|
||||
| - consider changing the type of `x` to `&'a i32`
|
||||
17 |
|
||||
LL |
|
||||
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
|
||||
| ^ lifetime `'a` required
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
|
||||
| ---- -------
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
20 |
|
||||
LL |
|
||||
LL | if x > y { x } else { y } //~ ERROR lifetime mismatch
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 |
|
||||
LL |
|
||||
LL | x //~ ERROR lifetime mismatch
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
|
||||
| ----- -------
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 |
|
||||
LL |
|
||||
LL | if true { x } else { self } //~ ERROR lifetime mismatch
|
||||
| ^^^^ ...but data from `self` is returned here
|
||||
|
||||
|
@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
|
||||
|
|
||||
LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
|
||||
| ------------ ------------ these two types are declared with different lifetimes...
|
||||
16 | let z = Ref { data: y.data };
|
||||
LL | let z = Ref { data: y.data };
|
||||
LL | x.push(z); //~ ERROR lifetime mismatch
|
||||
| ^ ...but data from `y` flows into `x` here
|
||||
|
||||
|
@ -1,38 +1,38 @@
|
||||
error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:54:28
|
||||
|
|
||||
54 | pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`
|
||||
LL | pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/lint-ctypes.rs:11:9
|
||||
|
|
||||
11 | #![deny(improper_ctypes)]
|
||||
LL | #![deny(improper_ctypes)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
= help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
|
||||
note: type defined here
|
||||
--> $DIR/lint-ctypes.rs:32:1
|
||||
|
|
||||
32 | pub struct Foo;
|
||||
LL | pub struct Foo;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:55:28
|
||||
|
|
||||
55 | pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`
|
||||
LL | pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
|
||||
note: type defined here
|
||||
--> $DIR/lint-ctypes.rs:32:1
|
||||
|
|
||||
32 | pub struct Foo;
|
||||
LL | pub struct Foo;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `[u32]` which is not FFI-safe: slices have no C equivalent
|
||||
--> $DIR/lint-ctypes.rs:56:26
|
||||
|
|
||||
56 | pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
|
||||
LL | pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: consider using a raw pointer instead
|
||||
@ -40,7 +40,7 @@ error: `extern` block uses type `[u32]` which is not FFI-safe: slices have no C
|
||||
error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
|
||||
--> $DIR/lint-ctypes.rs:57:24
|
||||
|
|
||||
57 | pub fn str_type(p: &str); //~ ERROR: uses type `str`
|
||||
LL | pub fn str_type(p: &str); //~ ERROR: uses type `str`
|
||||
| ^^^^
|
||||
|
|
||||
= help: consider using `*const u8` and a length instead
|
||||
@ -48,7 +48,7 @@ error: `extern` block uses type `str` which is not FFI-safe: string slices have
|
||||
error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:58:24
|
||||
|
|
||||
58 | pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`
|
||||
LL | pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
|
||||
@ -56,7 +56,7 @@ error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: th
|
||||
error: `extern` block uses type `char` which is not FFI-safe: the `char` type has no C equivalent
|
||||
--> $DIR/lint-ctypes.rs:59:25
|
||||
|
|
||||
59 | pub fn char_type(p: char); //~ ERROR uses type `char`
|
||||
LL | pub fn char_type(p: char); //~ ERROR uses type `char`
|
||||
| ^^^^
|
||||
|
|
||||
= help: consider using `u32` or `libc::wchar_t` instead
|
||||
@ -64,25 +64,25 @@ error: `extern` block uses type `char` which is not FFI-safe: the `char` type ha
|
||||
error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
|
||||
--> $DIR/lint-ctypes.rs:60:25
|
||||
|
|
||||
60 | pub fn i128_type(p: i128); //~ ERROR uses type `i128`
|
||||
LL | pub fn i128_type(p: i128); //~ ERROR uses type `i128`
|
||||
| ^^^^
|
||||
|
||||
error: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
|
||||
--> $DIR/lint-ctypes.rs:61:25
|
||||
|
|
||||
61 | pub fn u128_type(p: u128); //~ ERROR uses type `u128`
|
||||
LL | pub fn u128_type(p: u128); //~ ERROR uses type `u128`
|
||||
| ^^^^
|
||||
|
||||
error: `extern` block uses type `std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent
|
||||
--> $DIR/lint-ctypes.rs:62:26
|
||||
|
|
||||
62 | pub fn trait_type(p: &Clone); //~ ERROR uses type `std::clone::Clone`
|
||||
LL | pub fn trait_type(p: &Clone); //~ ERROR uses type `std::clone::Clone`
|
||||
| ^^^^^^
|
||||
|
||||
error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:63:26
|
||||
|
|
||||
63 | pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
|
||||
LL | pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: consider using a struct instead
|
||||
@ -90,7 +90,7 @@ error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have
|
||||
error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:64:27
|
||||
|
|
||||
64 | pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
|
||||
LL | pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: consider using a struct instead
|
||||
@ -98,32 +98,32 @@ error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have
|
||||
error: `extern` block uses type `ZeroSize` which is not FFI-safe: this struct has no fields
|
||||
--> $DIR/lint-ctypes.rs:65:25
|
||||
|
|
||||
65 | pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields
|
||||
LL | pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: consider adding a member to this struct
|
||||
note: type defined here
|
||||
--> $DIR/lint-ctypes.rs:28:1
|
||||
|
|
||||
28 | pub struct ZeroSize;
|
||||
LL | pub struct ZeroSize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData
|
||||
--> $DIR/lint-ctypes.rs:66:33
|
||||
|
|
||||
66 | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData
|
||||
LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData
|
||||
--> $DIR/lint-ctypes.rs:68:12
|
||||
|
|
||||
68 | -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData
|
||||
LL | -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
|
||||
--> $DIR/lint-ctypes.rs:69:23
|
||||
|
|
||||
69 | pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
|
||||
LL | pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: consider using an `fn "extern"(...) -> ...` function pointer instead
|
||||
@ -131,7 +131,7 @@ error: `extern` block uses type `fn()` which is not FFI-safe: this function poin
|
||||
error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
|
||||
--> $DIR/lint-ctypes.rs:70:24
|
||||
|
|
||||
70 | pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
|
||||
LL | pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
|
||||
| ^^^^
|
||||
|
|
||||
= help: consider using an `fn "extern"(...) -> ...` function pointer instead
|
||||
@ -139,7 +139,7 @@ error: `extern` block uses type `fn()` which is not FFI-safe: this function poin
|
||||
error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:71:28
|
||||
|
|
||||
71 | pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`
|
||||
LL | pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
|
||||
@ -147,13 +147,13 @@ error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: th
|
||||
error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
|
||||
--> $DIR/lint-ctypes.rs:72:32
|
||||
|
|
||||
72 | pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`
|
||||
LL | pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
|
||||
--> $DIR/lint-ctypes.rs:73:31
|
||||
|
|
||||
73 | pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
|
||||
LL | pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using `*const u8` and a length instead
|
||||
@ -161,7 +161,7 @@ error: `extern` block uses type `str` which is not FFI-safe: string slices have
|
||||
error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
|
||||
--> $DIR/lint-ctypes.rs:74:30
|
||||
|
|
||||
74 | pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`
|
||||
LL | pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
|
||||
|
@ -3,7 +3,7 @@ error[E0453]: allow(deprecated) overruled by outer forbid(deprecated)
|
||||
|
|
||||
LL | #![forbid(deprecated)]
|
||||
| ---------- `forbid` level set here
|
||||
12 |
|
||||
LL |
|
||||
LL | #[allow(deprecated)]
|
||||
| ^^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
|
@ -18,10 +18,10 @@ error: function cannot return without recurring
|
||||
|
|
||||
LL | fn baz() { //~ ERROR function cannot return without recurring
|
||||
| ^^^^^^^^ cannot return without recurring
|
||||
25 | if true {
|
||||
LL | if true {
|
||||
LL | baz()
|
||||
| ----- recursive call site
|
||||
27 | } else {
|
||||
LL | } else {
|
||||
LL | baz()
|
||||
| ----- recursive call site
|
||||
|
|
||||
@ -32,7 +32,7 @@ error: function cannot return without recurring
|
||||
|
|
||||
LL | fn quz() -> bool { //~ ERROR function cannot return without recurring
|
||||
| ^^^^^^^^^^^^^^^^ cannot return without recurring
|
||||
37 | if true {
|
||||
LL | if true {
|
||||
LL | while quz() {}
|
||||
| ----- recursive call site
|
||||
...
|
||||
@ -56,7 +56,7 @@ error: function cannot return without recurring
|
||||
|
|
||||
LL | fn bar(&self) { //~ ERROR function cannot return without recurring
|
||||
| ^^^^^^^^^^^^^ cannot return without recurring
|
||||
54 | loop {
|
||||
LL | loop {
|
||||
LL | self.bar()
|
||||
| ---------- recursive call site
|
||||
|
|
||||
@ -87,7 +87,7 @@ error: function cannot return without recurring
|
||||
|
|
||||
LL | fn bar(&self) { //~ ERROR function cannot return without recurring
|
||||
| ^^^^^^^^^^^^^ cannot return without recurring
|
||||
82 | loop {
|
||||
LL | loop {
|
||||
LL | Foo2::bar(self)
|
||||
| --------------- recursive call site
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0453]: allow(unused_variables) overruled by outer forbid(unused)
|
||||
|
|
||||
LL | #![forbid(unused, non_snake_case)]
|
||||
| ------ `forbid` level set here
|
||||
18 |
|
||||
LL |
|
||||
LL | #[allow(unused_variables)] //~ ERROR overruled
|
||||
| ^^^^^^^^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
|
@ -116,7 +116,7 @@ LL | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
|
||||
| -----------^^^^^^^^^^^^^
|
||||
| |
|
||||
| help: consider restricting its visibility: `pub(crate)`
|
||||
50 | }
|
||||
LL | }
|
||||
LL | define_empty_struct_with_visibility!(pub, Fluorine);
|
||||
| ---------------------------------------------------- in this macro invocation
|
||||
|
|
||||
|
@ -116,7 +116,7 @@ LL | ($visibility: vis, $name: ident) => { $visibility struct $name {} }
|
||||
| -----------^^^^^^^^^^^^^
|
||||
| |
|
||||
| help: consider restricting its visibility: `crate`
|
||||
45 | }
|
||||
LL | }
|
||||
LL | define_empty_struct_with_visibility!(pub, Fluorine);
|
||||
| ---------------------------------------------------- in this macro invocation
|
||||
|
|
||||
|
@ -374,13 +374,13 @@ LL | let x: Iter;
|
||||
| ^^^^ not found in this scope
|
||||
help: possible candidates are found in other modules, you can import them into scope
|
||||
|
|
||||
20 | use std::collections::binary_heap::Iter;
|
||||
LL | use std::collections::binary_heap::Iter;
|
||||
|
|
||||
20 | use std::collections::btree_map::Iter;
|
||||
LL | use std::collections::btree_map::Iter;
|
||||
|
|
||||
20 | use std::collections::btree_set::Iter;
|
||||
LL | use std::collections::btree_set::Iter;
|
||||
|
|
||||
20 | use std::collections::hash_map::Iter;
|
||||
LL | use std::collections::hash_map::Iter;
|
||||
|
|
||||
and 8 other candidates
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | break 22 //~ ERROR `break` with value from a `for` loop
|
||||
| ^^^^^^^^ can only break with a value inside `loop`
|
||||
help: instead, use `break` on its own without a value inside this `for` loop
|
||||
|
|
||||
22 | break //~ ERROR `break` with value from a `for` loop
|
||||
LL | break //~ ERROR `break` with value from a `for` loop
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -69,7 +69,7 @@ LL | / pub fn main() { //~ ERROR compilation successful
|
||||
LL | | let s = S;
|
||||
LL | | s.m1();
|
||||
LL | | s.m2();
|
||||
53 | | foo();
|
||||
LL | | foo();
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
|
@ -11,7 +11,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
|
|
||||
LL | impl<'bad, 'c> Struct<'bad, 'c> {
|
||||
| ---- first declared here
|
||||
44 | fn meth_bad(&self) {
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
|
||||
@ -20,7 +20,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
|
|
||||
LL | impl<'b, 'bad> Struct<'b, 'bad> {
|
||||
| ---- first declared here
|
||||
51 | fn meth_bad2(&self) {
|
||||
LL | fn meth_bad2(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
|
||||
@ -45,7 +45,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
|
|
||||
LL | impl <'bad, 'e> Enum<'bad, 'e> {
|
||||
| ---- first declared here
|
||||
70 | fn meth_bad(&self) {
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
|
||||
@ -54,7 +54,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
|
|
||||
LL | impl <'d, 'bad> Enum<'d, 'bad> {
|
||||
| ---- first declared here
|
||||
76 | fn meth_bad2(&self) {
|
||||
LL | fn meth_bad2(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
|
||||
@ -88,7 +88,7 @@ warning: label name `'bad` shadows a lifetime name that is already in scope
|
||||
|
|
||||
LL | trait HasDefaultMethod2<'a,'bad> {
|
||||
| ---- first declared here
|
||||
103| fn meth_bad(&self) {
|
||||
LL | fn meth_bad(&self) {
|
||||
LL | 'bad: loop { break 'bad; }
|
||||
| ^^^^ lifetime 'bad already in scope
|
||||
|
||||
|
@ -35,7 +35,7 @@ LL | real_method_stmt!();
|
||||
| -------------------- in this macro invocation
|
||||
help: you must specify a concrete type for this numeric value, like `f32`
|
||||
|
|
||||
51 | 2.0_f32.powi(2) //~ ERROR can't call method `powi` on ambiguous numeric type `{float}`
|
||||
LL | 2.0_f32.powi(2) //~ ERROR can't call method `powi` on ambiguous numeric type `{float}`
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
|
||||
@ -75,7 +75,7 @@ LL | let _ = real_method_expr!();
|
||||
| ------------------- in this macro invocation
|
||||
help: you must specify a concrete type for this numeric value, like `f32`
|
||||
|
|
||||
57 | 2.0_f32.powi(2) //~ ERROR can't call method `powi` on ambiguous numeric type `{float}`
|
||||
LL | 2.0_f32.powi(2) //~ ERROR can't call method `powi` on ambiguous numeric type `{float}`
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
|
||||
--> $DIR/closure-arg-count-expected-type-issue-47244.rs:24:14
|
||||
|
|
||||
24 | m.iter().map( |_, b| {
|
||||
LL | m.iter().map( |_, b| {
|
||||
| ^^^ ------ takes 2 distinct arguments
|
||||
| |
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
help: change the closure to accept a tuple instead of individual arguments
|
||||
|
|
||||
24 | m.iter().map( |(_, b)| {
|
||||
LL | m.iter().map( |(_, b)| {
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -23,7 +23,7 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
|
||||
| expected closure that takes 2 distinct arguments
|
||||
help: change the closure to take multiple arguments instead of a single tuple
|
||||
|
|
||||
19 | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
|
||||
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
|
||||
@ -35,7 +35,7 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2): (usize, _)| panic!());
|
||||
| expected closure that takes 2 distinct arguments
|
||||
help: change the closure to take multiple arguments instead of a single tuple
|
||||
|
|
||||
21 | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
|
||||
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
|
||||
@ -61,7 +61,7 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
help: change the closure to accept a tuple instead of individual arguments
|
||||
|
|
||||
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
|
||||
@ -73,7 +73,7 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
help: change the closure to accept a tuple instead of individual arguments
|
||||
|
|
||||
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
|
||||
|
@ -5,7 +5,7 @@ LL | pub Foo { text }
|
||||
| ^
|
||||
help: add `struct` here to parse `Foo` as a public struct
|
||||
|
|
||||
23 | pub struct Foo { text }
|
||||
LL | pub struct Foo { text }
|
||||
| ^^^^^^
|
||||
|
||||
error: expected one of `(` or `<`, found `{`
|
||||
|
@ -3,7 +3,7 @@ error[E0631]: type mismatch in closure arguments
|
||||
|
|
||||
LL | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
|
||||
| ----------------------------- found signature of `fn(usize, isize) -> _`
|
||||
24 | //~^ NOTE found signature of `fn(usize, isize) -> _`
|
||||
LL | //~^ NOTE found signature of `fn(usize, isize) -> _`
|
||||
LL | let z = call_it(3, f);
|
||||
| ^^^^^^^ expected signature of `fn(isize, isize) -> _`
|
||||
|
|
||||
|
@ -3,7 +3,7 @@ error[E0503]: cannot use `e` because it was mutably borrowed
|
||||
|
|
||||
LL | let f = &mut e;
|
||||
| ------ borrow of `e` occurs here
|
||||
23 | let g = f;
|
||||
LL | let g = f;
|
||||
LL | / match e { //~ cannot use `e` because it was mutably borrowed [E0503]
|
||||
LL | | Xyz::A => println!("a"),
|
||||
LL | | //~^ cannot use `e` because it was mutably borrowed [E0503]
|
||||
|
@ -3,7 +3,7 @@ error[E0502]: cannot borrow `*block.current` as immutable because it is also bor
|
||||
|
|
||||
LL | let x = &mut block;
|
||||
| ---------- mutable borrow occurs here
|
||||
23 | println!("{}", x.current);
|
||||
LL | println!("{}", x.current);
|
||||
LL | let p: &'a u8 = &*block.current;
|
||||
| ^^^^^^^^^^^^^^^ immutable borrow occurs here
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | y: &y,
|
||||
...
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
39 |
|
||||
LL |
|
||||
LL | deref(p);
|
||||
| - borrow later used here
|
||||
|
|
||||
|
@ -28,10 +28,10 @@ error[E0597]: `y` does not live long enough
|
||||
|
|
||||
LL | closure(&mut p, &y);
|
||||
| ^^ borrowed value does not live long enough
|
||||
38 | //~^ ERROR `y` does not live long enough [E0597]
|
||||
LL | //~^ ERROR `y` does not live long enough [E0597]
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
40 |
|
||||
LL |
|
||||
LL | deref(p);
|
||||
| - borrow later used here
|
||||
|
|
||||
|
@ -58,7 +58,7 @@ LL | | };
|
||||
...
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
37 |
|
||||
LL |
|
||||
LL | deref(p);
|
||||
| - borrow later used here
|
||||
|
|
||||
|
@ -35,7 +35,7 @@ LL | let mut closure = || p = &y;
|
||||
...
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
37 |
|
||||
LL |
|
||||
LL | deref(p);
|
||||
| - borrow later used here
|
||||
|
|
||||
|
@ -17,7 +17,7 @@ LL | / |_outlives1, _outlives2, _outlives3, x, y| {
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | let p = x.get();
|
||||
LL | | //~^ WARN not reporting region error due to -Znll
|
||||
57 | | //~| ERROR does not outlive free region
|
||||
LL | | //~| ERROR does not outlive free region
|
||||
LL | | demand_y(x, y, p)
|
||||
LL | | },
|
||||
| |_________^
|
||||
|
@ -12,7 +12,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x,
|
||||
LL | | //~^ ERROR lifetime mismatch
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
57 | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
|
@ -12,7 +12,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
||||
LL | | //~^ ERROR does not outlive free region
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
49 | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
@ -31,7 +31,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
||||
LL | | //~^ ERROR does not outlive free region
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
49 | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
||||
|
@ -12,7 +12,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x,
|
||||
LL | | //~^ ERROR does not outlive free region
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | demand_y(x, y, x.get())
|
||||
52 | | //~^ WARNING not reporting region error due to -Znll
|
||||
LL | | //~^ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
@ -31,7 +31,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x,
|
||||
LL | | //~^ ERROR does not outlive free region
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | demand_y(x, y, x.get())
|
||||
52 | | //~^ WARNING not reporting region error due to -Znll
|
||||
LL | | //~^ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
||||
|
@ -12,7 +12,7 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y|
|
||||
LL | | //~^ ERROR lifetime mismatch
|
||||
LL | |
|
||||
LL | | // Only works if 'x: 'y:
|
||||
50 | | demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to -Znll
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
|
@ -18,7 +18,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
|
||||
LL | | // Only works if 'x: 'y:
|
||||
LL | | demand_y(x, y, x.get())
|
||||
LL | | //~^ WARN not reporting region error due to -Znll
|
||||
49 | | //~| ERROR does not outlive free region
|
||||
LL | | //~| ERROR does not outlive free region
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user