Remove NOTE/HELP annotations from UI tests

This commit is contained in:
Vadim Petrochenkov 2017-12-10 23:29:24 +03:00
parent d4e51a8fb2
commit 1f5b201aff
462 changed files with 1841 additions and 2899 deletions

View File

@ -39,12 +39,7 @@ impl Bar for usize {
fn make_foo() {
let x = Box::new(5usize) as Box<Foo>;
//~^ ERROR E0038
//~| NOTE method `foo` has a non-standard `self` type
//~| NOTE the trait `Foo` cannot be made into an object
//~| ERROR E0038
//~| NOTE method `foo` has a non-standard `self` type
//~| NOTE the trait `Foo` cannot be made into an object
//~| NOTE requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<Foo>>`
}
fn make_bar() {

View File

@ -23,12 +23,11 @@ fn foo(x: isize) { println!("{}", x); }
target_arch = "aarch64"))]
pub fn main() {
let x: isize;
x = 1; //~ NOTE first assignment
x = 1;
foo(x);
unsafe {
asm!("mov $1, $0" : "=r"(x) : "r"(5));
//~^ ERROR cannot assign twice to immutable variable `x`
//~| NOTE cannot assign twice to immutable
}
foo(x);
}

View File

@ -1,7 +1,7 @@
error[E0384]: cannot assign twice to immutable variable `x`
--> $DIR/asm-out-assign-imm.rs:29:9
|
26 | x = 1; //~ NOTE first assignment
26 | x = 1;
| ----- first assignment to `x`
...
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));

View File

@ -15,12 +15,8 @@ trait Foo {
impl<'a> Foo for &'a () {
//~^ NOTE the lifetime 'a as defined
const NAME: &'a str = "unit";
//~^ ERROR mismatched types [E0308]
//~| NOTE lifetime mismatch
//~| NOTE expected type `&'static str`
//~| NOTE ...does not necessarily outlive the static lifetime
}
fn main() {}

View File

@ -1,7 +1,7 @@
error[E0308]: mismatched types
--> $DIR/associated-const-impl-wrong-lifetime.rs:19:5
--> $DIR/associated-const-impl-wrong-lifetime.rs:18:5
|
19 | const NAME: &'a str = "unit";
18 | const NAME: &'a str = "unit";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected type `&'static str`
@ -10,12 +10,9 @@ note: the lifetime 'a as defined on the impl at 17:1...
--> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
|
17 | / impl<'a> Foo for &'a () {
18 | | //~^ NOTE the lifetime 'a as defined
19 | | const NAME: &'a str = "unit";
20 | | //~^ ERROR mismatched types [E0308]
... |
23 | | //~| NOTE ...does not necessarily outlive the static lifetime
24 | | }
18 | | const NAME: &'a str = "unit";
19 | | //~^ ERROR mismatched types [E0308]
20 | | }
| |_^
= note: ...does not necessarily outlive the static lifetime

View File

@ -10,7 +10,7 @@
trait Foo {
const BAR: u32; //~ NOTE type in trait
const BAR: u32;
}
struct SignedBar;
@ -18,7 +18,6 @@ struct SignedBar;
impl Foo for SignedBar {
const BAR: i32 = -1;
//~^ ERROR implemented const `BAR` has an incompatible type for trait [E0326]
//~| NOTE expected u32, found i32
}
fn main() {}

View File

@ -1,7 +1,7 @@
error[E0326]: implemented const `BAR` has an incompatible type for trait
--> $DIR/associated-const-impl-wrong-type.rs:19:16
|
13 | const BAR: u32; //~ NOTE type in trait
13 | const BAR: u32;
| --- type in trait
...
19 | const BAR: i32 = -1;

View File

@ -13,18 +13,12 @@
pub trait Vehicle {
type Color;
//~^ NOTE ambiguous `Color` from `Vehicle`
//~| NOTE ambiguous `Color` from `Vehicle`
//~| NOTE ambiguous `Color` from `Vehicle`
fn go(&self) { }
}
pub trait Box {
type Color;
//~^ NOTE ambiguous `Color` from `Box`
//~| NOTE ambiguous `Color` from `Box`
//~| NOTE ambiguous `Color` from `Box`
//
fn mail(&self) { }
}
@ -34,19 +28,15 @@ pub trait BoxCar : Box + Vehicle {
fn dent<C:BoxCar>(c: C, color: C::Color) {
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
//~| NOTE ambiguous associated type `Color`
}
fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
//~^ ERROR ambiguous associated type
//~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
//~| NOTE ambiguous associated type `Color`
//~| NOTE missing associated type `Color` value
}
fn paint<C:BoxCar>(c: C, d: C::Color) {
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
//~| NOTE ambiguous associated type `Color`
}
pub fn main() { }

View File

@ -1,43 +1,43 @@
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:35:32
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:29:32
|
15 | type Color;
| ----------- ambiguous `Color` from `Vehicle`
...
24 | type Color;
21 | type Color;
| ----------- ambiguous `Color` from `Box`
...
35 | fn dent<C:BoxCar>(c: C, color: C::Color) {
29 | fn dent<C:BoxCar>(c: C, color: C::Color) {
| ^^^^^^^^ ambiguous associated type `Color`
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:33
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:33:33
|
15 | type Color;
| ----------- ambiguous `Color` from `Vehicle`
...
24 | type Color;
21 | type Color;
| ----------- ambiguous `Color` from `Box`
...
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
33 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
| ^^^^^^^^^^^ ambiguous associated type `Color`
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:26
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:33:26
|
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
33 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
| ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:47:29
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:38:29
|
15 | type Color;
| ----------- ambiguous `Color` from `Vehicle`
...
24 | type Color;
21 | type Color;
| ----------- ambiguous `Color` from `Box`
...
47 | fn paint<C:BoxCar>(c: C, d: C::Color) {
38 | fn paint<C:BoxCar>(c: C, d: C::Color) {
| ^^^^^^^^ ambiguous associated type `Color`
error: aborting due to 4 previous errors

View File

@ -32,5 +32,4 @@ fn ice<A>(a: A) {
let r = loop {};
r = r + a;
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
//~| NOTE the trait `Add<A>` is not implemented for `()`
}

View File

@ -15,21 +15,15 @@ trait Get {
fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
//~^ ERROR ambiguous associated type
//~| NOTE ambiguous associated type
//~| NOTE specify the type using the syntax `<Type as Get>::Value`
trait Grab {
type Value;
fn grab(&self) -> Grab::Value;
//~^ ERROR ambiguous associated type
//~| NOTE ambiguous associated type
//~| NOTE specify the type using the syntax `<Type as Grab>::Value`
}
type X = std::ops::Deref::Target;
//~^ ERROR ambiguous associated type
//~| NOTE ambiguous associated type
//~| NOTE specify the type using the syntax `<Type as std::ops::Deref>::Target`
fn main() {
}

View File

@ -7,17 +7,17 @@ error[E0223]: ambiguous associated type
= note: specify the type using the syntax `<Type as Get>::Value`
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:29:10
--> $DIR/associated-types-in-ambiguous-context.rs:25:10
|
29 | type X = std::ops::Deref::Target;
25 | type X = std::ops::Deref::Target;
| ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
|
= note: specify the type using the syntax `<Type as std::ops::Deref>::Target`
error[E0223]: ambiguous associated type
--> $DIR/associated-types-in-ambiguous-context.rs:23:23
--> $DIR/associated-types-in-ambiguous-context.rs:21:23
|
23 | fn grab(&self) -> Grab::Value;
21 | fn grab(&self) -> Grab::Value;
| ^^^^^^^^^^^ ambiguous associated type
|
= note: specify the type using the syntax `<Type as Grab>::Value`

View File

@ -22,7 +22,6 @@ fn main() {
let mut x = Int(1);
x //~ error: use of moved value: `x`
//~^ value used here after move
//~| note: move occurs because `x` has type `Int`
+=
x; //~ value moved here

View File

@ -1,10 +1,10 @@
error[E0596]: cannot borrow immutable local variable `y` as mutable
--> $DIR/augmented-assignments.rs:31:5
--> $DIR/augmented-assignments.rs:30:5
|
29 | let y = Int(2);
28 | let y = Int(2);
| - consider changing this to `mut y`
30 | //~^ consider changing this to `mut y`
31 | y //~ error: cannot borrow immutable local variable `y` as mutable
29 | //~^ consider changing this to `mut y`
30 | y //~ error: cannot borrow immutable local variable `y` as mutable
| ^ cannot borrow mutably
error[E0382]: use of moved value: `x`
@ -13,7 +13,7 @@ error[E0382]: use of moved value: `x`
23 | x //~ error: use of moved value: `x`
| ^ value used here after move
...
27 | x; //~ value moved here
26 | x; //~ value moved here
| - value moved here
|
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait

View File

@ -13,8 +13,6 @@ fn main() {
let vr = v.iter().filter(|x| {
x % 2 == 0
//~^ ERROR binary operation `%` cannot be applied to type `&&{integer}`
//~| NOTE this is a reference to a type that `%` can be applied to
//~| NOTE an implementation of `std::ops::Rem` might be missing for `&&{integer}`
});
println!("{:?}", vr);
}

View File

@ -8,11 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod foo { pub mod foo { } } //~ NOTE previous definition of the module `foo` here
mod foo { pub mod foo { } }
use foo::foo;
//~^ ERROR the name `foo` is defined multiple times
//~| `foo` reimported here
//~| NOTE `foo` must be defined only once in the type namespace of this module
fn main() {}

View File

@ -1,7 +1,7 @@
error[E0255]: the name `foo` is defined multiple times
--> $DIR/blind-item-item-shadow.rs:13:5
|
11 | mod foo { pub mod foo { } } //~ NOTE previous definition of the module `foo` here
11 | mod foo { pub mod foo { } }
| ---------------------------- previous definition of the module `foo` here
12 |
13 | use foo::foo;

View File

@ -10,12 +10,12 @@
fn f() -> String { //~ ERROR mismatched types
0u8;
"bla".to_string(); //~ HELP consider removing this semicolon
"bla".to_string();
}
fn g() -> String { //~ ERROR mismatched types
"this won't work".to_string();
"removeme".to_string(); //~ HELP consider removing this semicolon
"removeme".to_string();
}
fn main() {}

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
11 | fn f() -> String { //~ ERROR mismatched types
| __________________^
12 | | 0u8;
13 | | "bla".to_string(); //~ HELP consider removing this semicolon
13 | | "bla".to_string();
| | - help: consider removing this semicolon
14 | | }
| |_^ expected struct `std::string::String`, found ()
@ -18,7 +18,7 @@ error[E0308]: mismatched types
16 | fn g() -> String { //~ ERROR mismatched types
| __________________^
17 | | "this won't work".to_string();
18 | | "removeme".to_string(); //~ HELP consider removing this semicolon
18 | | "removeme".to_string();
| | - help: consider removing this semicolon
19 | | }
| |_^ expected struct `std::string::String`, found ()

View File

@ -11,7 +11,7 @@
fn blah() -> i32 { //~ ERROR mismatched types
1
; //~ HELP consider removing this semicolon
;
}
fn main() { }

View File

@ -5,7 +5,7 @@ error[E0308]: mismatched types
| __________________^
12 | | 1
13 | |
14 | | ; //~ HELP consider removing this semicolon
14 | | ;
| | - help: consider removing this semicolon
15 | | }
| |_^ expected i32, found ()

View File

@ -15,12 +15,12 @@ fn foo() -> String { //~ ERROR mismatched types
"world")
// Put the trailing semicolon on its own line to test that the
// note message gets the offending semicolon exactly
; //~ HELP consider removing this semicolon
;
}
fn bar() -> String { //~ ERROR mismatched types
"foobar".to_string()
; //~ HELP consider removing this semicolon
;
}
pub fn main() {}

View File

@ -7,7 +7,7 @@ error[E0308]: mismatched types
15 | | "world")
16 | | // Put the trailing semicolon on its own line to test that the
17 | | // note message gets the offending semicolon exactly
18 | | ; //~ HELP consider removing this semicolon
18 | | ;
| | - help: consider removing this semicolon
19 | | }
| |_^ expected struct `std::string::String`, found ()
@ -21,7 +21,7 @@ error[E0308]: mismatched types
21 | fn bar() -> String { //~ ERROR mismatched types
| ____________________^
22 | | "foobar".to_string()
23 | | ; //~ HELP consider removing this semicolon
23 | | ;
| | - help: consider removing this semicolon
24 | | }
| |_^ expected struct `std::string::String`, found ()

View File

@ -10,7 +10,6 @@
enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
//~^ NOTE variant `hsl` not found here
fn main() {
let red: color = color::rgb(255, 0, 0);
@ -18,6 +17,5 @@ fn main() {
color::rgb(r, g, b) => { println!("rgb"); }
color::hsl(h, s, l) => { println!("hsl"); }
//~^ ERROR no variant
//~| NOTE variant not found in `color`
}
}

View File

@ -1,10 +1,10 @@
error[E0599]: no variant named `hsl` found for type `color` in the current scope
--> $DIR/bogus-tag.rs:19:7
--> $DIR/bogus-tag.rs:18:7
|
12 | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
| ---------- variant `hsl` not found here
...
19 | color::hsl(h, s, l) => { println!("hsl"); }
18 | color::hsl(h, s, l) => { println!("hsl"); }
| ^^^^^^^^^^^^^^^^^^^ variant not found in `color`
error: aborting due to previous error

View File

@ -60,7 +60,6 @@ fn borrow_after_move() {
fn move_after_borrow() {
let a: Box<_> = box B { x: box 0, y: box 1 };
let _x = &a.x;
//~^ NOTE borrow of `a.x` occurs here
let _y = a.y;
//~^ ERROR cannot move
//~| move out of
@ -69,15 +68,12 @@ fn move_after_borrow() {
fn copy_after_mut_borrow() {
let mut a: Box<_> = box A { x: box 0, y: 1 };
let _x = &mut a.x;
//~^ NOTE borrow of `a.x` occurs here
let _y = a.y; //~ ERROR cannot use
//~^ NOTE use of borrowed `a.x`
}
fn move_after_mut_borrow() {
let mut a: Box<_> = box B { x: box 0, y: box 1 };
let _x = &mut a.x;
//~^ NOTE borrow of `a.x` occurs here
let _y = a.y;
//~^ ERROR cannot move
//~| move out of
@ -86,27 +82,22 @@ fn move_after_mut_borrow() {
fn borrow_after_mut_borrow() {
let mut a: Box<_> = box A { x: box 0, y: 1 };
let _x = &mut a.x;
//~^ NOTE mutable borrow occurs here (via `a.x`)
let _y = &a.y; //~ ERROR cannot borrow
//~^ immutable borrow occurs here (via `a.y`)
}
//~^ NOTE mutable borrow ends here
fn mut_borrow_after_borrow() {
let mut a: Box<_> = box A { x: box 0, y: 1 };
let _x = &a.x;
//~^ NOTE immutable borrow occurs here (via `a.x`)
let _y = &mut a.y; //~ ERROR cannot borrow
//~^ mutable borrow occurs here (via `a.y`)
}
//~^ NOTE immutable borrow ends here
fn copy_after_move_nested() {
let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
let _x = a.x.x;
//~^ value moved here
let _y = a.y; //~ ERROR use of collaterally moved
//~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
//~| value used here after move
}
@ -115,7 +106,6 @@ fn move_after_move_nested() {
let _x = a.x.x;
//~^ value moved here
let _y = a.y; //~ ERROR use of collaterally moved
//~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
//~| value used here after move
}
@ -124,7 +114,6 @@ fn borrow_after_move_nested() {
let _x = a.x.x;
//~^ value moved here
let _y = &a.y; //~ ERROR use of collaterally moved
//~^ NOTE move occurs because `a.x.x` has type `std::boxed::Box<isize>`
//~| value used here after move
}
@ -140,15 +129,12 @@ fn move_after_borrow_nested() {
fn copy_after_mut_borrow_nested() {
let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
let _x = &mut a.x.x;
//~^ NOTE borrow of `a.x.x` occurs here
let _y = a.y; //~ ERROR cannot use
//~^ NOTE use of borrowed `a.x.x`
}
fn move_after_mut_borrow_nested() {
let mut a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
let _x = &mut a.x.x;
//~^ NOTE borrow of `a.x.x` occurs here
let _y = a.y;
//~^ ERROR cannot move
//~| move out of
@ -161,7 +147,6 @@ fn borrow_after_mut_borrow_nested() {
let _y = &a.y; //~ ERROR cannot borrow
//~^ immutable borrow occurs here
}
//~^ NOTE mutable borrow ends here
fn mut_borrow_after_borrow_nested() {
let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
@ -170,7 +155,6 @@ fn mut_borrow_after_borrow_nested() {
let _y = &mut a.y; //~ ERROR cannot borrow
//~^ mutable borrow occurs here
}
//~^ NOTE immutable borrow ends here
fn main() {
copy_after_move();

View File

@ -32,55 +32,61 @@ error[E0382]: use of moved value: `a`
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0505]: cannot move out of `a.y` because it is borrowed
--> $DIR/borrowck-box-insensitivity.rs:64:9
--> $DIR/borrowck-box-insensitivity.rs:63:9
|
62 | let _x = &a.x;
| --- borrow of `a.x` occurs here
63 | //~^ NOTE borrow of `a.x` occurs here
64 | let _y = a.y;
63 | let _y = a.y;
| ^^ move out of `a.y` occurs here
error[E0503]: cannot use `a.y` because it was mutably borrowed
--> $DIR/borrowck-box-insensitivity.rs:73:9
--> $DIR/borrowck-box-insensitivity.rs:71:9
|
71 | let _x = &mut a.x;
70 | let _x = &mut a.x;
| --- borrow of `a.x` occurs here
72 | //~^ NOTE borrow of `a.x` occurs here
73 | let _y = a.y; //~ ERROR cannot use
71 | let _y = a.y; //~ ERROR cannot use
| ^^ use of borrowed `a.x`
error[E0505]: cannot move out of `a.y` because it is borrowed
--> $DIR/borrowck-box-insensitivity.rs:81:9
--> $DIR/borrowck-box-insensitivity.rs:77:9
|
79 | let _x = &mut a.x;
76 | let _x = &mut a.x;
| --- borrow of `a.x` occurs here
80 | //~^ NOTE borrow of `a.x` occurs here
81 | let _y = a.y;
77 | let _y = a.y;
| ^^ move out of `a.y` occurs here
error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`)
--> $DIR/borrowck-box-insensitivity.rs:90:15
--> $DIR/borrowck-box-insensitivity.rs:85:15
|
88 | let _x = &mut a.x;
84 | let _x = &mut a.x;
| --- mutable borrow occurs here (via `a.x`)
89 | //~^ NOTE mutable borrow occurs here (via `a.x`)
90 | let _y = &a.y; //~ ERROR cannot borrow
85 | let _y = &a.y; //~ ERROR cannot borrow
| ^^^ immutable borrow occurs here (via `a.y`)
91 | //~^ immutable borrow occurs here (via `a.y`)
92 | }
86 | //~^ immutable borrow occurs here (via `a.y`)
87 | }
| - mutable borrow ends here
error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`)
--> $DIR/borrowck-box-insensitivity.rs:99:19
--> $DIR/borrowck-box-insensitivity.rs:92:19
|
91 | let _x = &a.x;
| --- immutable borrow occurs here (via `a.x`)
92 | let _y = &mut a.y; //~ ERROR cannot borrow
| ^^^ mutable borrow occurs here (via `a.y`)
93 | //~^ mutable borrow occurs here (via `a.y`)
94 | }
| - immutable borrow ends here
error[E0382]: use of collaterally moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:100:9
|
97 | let _x = &a.x;
| --- immutable borrow occurs here (via `a.x`)
98 | //~^ NOTE immutable borrow occurs here (via `a.x`)
99 | let _y = &mut a.y; //~ ERROR cannot borrow
| ^^^ mutable borrow occurs here (via `a.y`)
100 | //~^ mutable borrow occurs here (via `a.y`)
101 | }
| - immutable borrow ends here
98 | let _x = a.x.x;
| -- value moved here
99 | //~^ value moved here
100 | let _y = a.y; //~ ERROR use of collaterally moved
| ^^ value used here after move
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0382]: use of collaterally moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:108:9
@ -94,76 +100,63 @@ error[E0382]: use of collaterally moved value: `a.y`
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0382]: use of collaterally moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:117:9
--> $DIR/borrowck-box-insensitivity.rs:116:15
|
115 | let _x = a.x.x;
114 | let _x = a.x.x;
| -- value moved here
116 | //~^ value moved here
117 | let _y = a.y; //~ ERROR use of collaterally moved
| ^^ value used here after move
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0382]: use of collaterally moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:126:15
|
124 | let _x = a.x.x;
| -- value moved here
125 | //~^ value moved here
126 | let _y = &a.y; //~ ERROR use of collaterally moved
115 | //~^ value moved here
116 | let _y = &a.y; //~ ERROR use of collaterally moved
| ^^^ value used here after move
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
error[E0505]: cannot move out of `a.y` because it is borrowed
--> $DIR/borrowck-box-insensitivity.rs:135:9
--> $DIR/borrowck-box-insensitivity.rs:124:9
|
133 | let _x = &a.x.x;
122 | let _x = &a.x.x;
| ----- borrow of `a.x.x` occurs here
134 | //~^ borrow of `a.x.x` occurs here
135 | let _y = a.y;
123 | //~^ borrow of `a.x.x` occurs here
124 | let _y = a.y;
| ^^ move out of `a.y` occurs here
error[E0503]: cannot use `a.y` because it was mutably borrowed
--> $DIR/borrowck-box-insensitivity.rs:144:9
--> $DIR/borrowck-box-insensitivity.rs:132:9
|
142 | let _x = &mut a.x.x;
131 | let _x = &mut a.x.x;
| ----- borrow of `a.x.x` occurs here
143 | //~^ NOTE borrow of `a.x.x` occurs here
144 | let _y = a.y; //~ ERROR cannot use
132 | let _y = a.y; //~ ERROR cannot use
| ^^ use of borrowed `a.x.x`
error[E0505]: cannot move out of `a.y` because it is borrowed
--> $DIR/borrowck-box-insensitivity.rs:152:9
--> $DIR/borrowck-box-insensitivity.rs:138:9
|
150 | let _x = &mut a.x.x;
137 | let _x = &mut a.x.x;
| ----- borrow of `a.x.x` occurs here
151 | //~^ NOTE borrow of `a.x.x` occurs here
152 | let _y = a.y;
138 | let _y = a.y;
| ^^ move out of `a.y` occurs here
error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable
--> $DIR/borrowck-box-insensitivity.rs:161:15
--> $DIR/borrowck-box-insensitivity.rs:147:15
|
159 | let _x = &mut a.x.x;
145 | let _x = &mut a.x.x;
| ----- mutable borrow occurs here
160 | //~^ mutable borrow occurs here
161 | let _y = &a.y; //~ ERROR cannot borrow
146 | //~^ mutable borrow occurs here
147 | let _y = &a.y; //~ ERROR cannot borrow
| ^^^ immutable borrow occurs here
162 | //~^ immutable borrow occurs here
163 | }
148 | //~^ immutable borrow occurs here
149 | }
| - mutable borrow ends here
error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable
--> $DIR/borrowck-box-insensitivity.rs:170:19
--> $DIR/borrowck-box-insensitivity.rs:155:19
|
168 | let _x = &a.x.x;
153 | let _x = &a.x.x;
| ----- immutable borrow occurs here
169 | //~^ immutable borrow occurs here
170 | let _y = &mut a.y; //~ ERROR cannot borrow
154 | //~^ immutable borrow occurs here
155 | let _y = &mut a.y; //~ ERROR cannot borrow
| ^^^ mutable borrow occurs here
171 | //~^ mutable borrow occurs here
172 | }
156 | //~^ mutable borrow occurs here
157 | }
| - immutable borrow ends here
error: aborting due to 16 previous errors

View File

@ -22,6 +22,4 @@ fn main() {
let mut books = vec![1,2,3];
spawn(|| books.push(4));
//~^ ERROR E0373
//~| NOTE `books` is borrowed here
//~| NOTE may outlive borrowed value `books`
}

View File

@ -20,8 +20,6 @@ fn foo<'a>(x: &'a i32) -> Box<FnMut()+'a> {
let mut books = vec![1,2,3];
Box::new(|| books.push(4))
//~^ ERROR E0373
//~| NOTE `books` is borrowed here
//~| NOTE may outlive borrowed value `books`
}
fn main() { }

View File

@ -11,9 +11,8 @@
// check that borrowck looks inside consts/statics
static FN : &'static (Fn() -> (Box<Fn()->Box<i32>>) + Sync) = &|| {
let x = Box::new(0); //~ NOTE captured outer variable
let x = Box::new(0);
Box::new(|| x) //~ ERROR cannot move out of captured outer variable
//~^ NOTE cannot move out of captured outer variable
};
fn main() {

View File

@ -1,7 +1,7 @@
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
--> $DIR/borrowck-in-static.rs:15:17
|
14 | let x = Box::new(0); //~ NOTE captured outer variable
14 | let x = Box::new(0);
| - captured outer variable
15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
| ^ cannot move out of captured outer variable in an `Fn` closure

View File

@ -20,9 +20,9 @@ fn blah() {
let f = &Foo::Foo1(box 1, box 2);
match *f { //~ ERROR cannot move out of
//~| cannot move out
Foo::Foo1(num1, //~ NOTE to prevent move
num2) => (), //~ NOTE and here
Foo::Foo2(num) => (), //~ NOTE and here
Foo::Foo1(num1,
num2) => (),
Foo::Foo2(num) => (),
Foo::Foo3 => ()
}
}
@ -39,8 +39,8 @@ fn move_in_match() {
match (S {f: "foo".to_string(), g: "bar".to_string()}) {
S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
//~| cannot move out of here
f: _s, //~ NOTE to prevent move
g: _t //~ NOTE and here
f: _s,
g: _t
} => {}
}
}
@ -56,7 +56,7 @@ fn blah2() {
let a = &A { a: box 1 };
match a.a { //~ ERROR cannot move out of
//~| cannot move out
n => { //~ NOTE to prevent move
n => {
free(n)
}
}

View File

@ -4,11 +4,11 @@ error[E0507]: cannot move out of borrowed content
21 | match *f { //~ ERROR cannot move out of
| ^^ cannot move out of borrowed content
22 | //~| cannot move out
23 | Foo::Foo1(num1, //~ NOTE to prevent move
23 | Foo::Foo1(num1,
| ---- hint: to prevent move, use `ref num1` or `ref mut num1`
24 | num2) => (), //~ NOTE and here
24 | num2) => (),
| ---- ...and here (use `ref num2` or `ref mut num2`)
25 | Foo::Foo2(num) => (), //~ NOTE and here
25 | Foo::Foo2(num) => (),
| --- ...and here (use `ref num` or `ref mut num`)
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
@ -16,9 +16,9 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
41 | | //~| cannot move out of here
42 | | f: _s, //~ NOTE to prevent move
42 | | f: _s,
| | -- hint: to prevent move, use `ref _s` or `ref mut _s`
43 | | g: _t //~ NOTE and here
43 | | g: _t
| | -- ...and here (use `ref _t` or `ref mut _t`)
44 | | } => {}
| |_________^ cannot move out of here
@ -29,7 +29,7 @@ error[E0507]: cannot move out of borrowed content
57 | match a.a { //~ ERROR cannot move out of
| ^ cannot move out of borrowed content
58 | //~| cannot move out
59 | n => { //~ NOTE to prevent move
59 | n => {
| - hint: to prevent move, use `ref n` or `ref mut n`
error: aborting due to 3 previous errors

View File

@ -32,7 +32,6 @@ pub fn main() {
//~| cannot move out
//~| to prevent move
Foo { string: b }] => {
//~^ NOTE and here
}
_ => {
unreachable!();

View File

@ -17,7 +17,6 @@ fn main() {
let z = &x; //~ ERROR cannot borrow
//~^ immutable borrow occurs here
}
//~^ NOTE mutable borrow ends here
fn foo() {
match true {
@ -29,7 +28,6 @@ fn foo() {
let z = &mut x; //~ ERROR cannot borrow
//~^ mutable borrow occurs here
}
//~^ NOTE immutable borrow ends here
false => ()
}
}
@ -43,5 +41,4 @@ fn bar() {
let z = &mut x; //~ ERROR cannot borrow
//~^ second mutable borrow occurs here
};
//~^ NOTE first borrow ends here
}

View File

@ -11,27 +11,27 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
| - mutable borrow ends here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-report-with-custom-diagnostic.rs:29:26
--> $DIR/borrowck-report-with-custom-diagnostic.rs:28:26
|
27 | let y = &x;
26 | let y = &x;
| - immutable borrow occurs here
28 | //~^ immutable borrow occurs here
29 | let z = &mut x; //~ ERROR cannot borrow
27 | //~^ immutable borrow occurs here
28 | let z = &mut x; //~ ERROR cannot borrow
| ^ mutable borrow occurs here
30 | //~^ mutable borrow occurs here
31 | }
29 | //~^ mutable borrow occurs here
30 | }
| - immutable borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-report-with-custom-diagnostic.rs:43:22
--> $DIR/borrowck-report-with-custom-diagnostic.rs:41:22
|
41 | let y = &mut x;
39 | let y = &mut x;
| - first mutable borrow occurs here
42 | //~^ first mutable borrow occurs here
43 | let z = &mut x; //~ ERROR cannot borrow
40 | //~^ first mutable borrow occurs here
41 | let z = &mut x; //~ ERROR cannot borrow
| ^ second mutable borrow occurs here
44 | //~^ second mutable borrow occurs here
45 | };
42 | //~^ second mutable borrow occurs here
43 | };
| - first borrow ends here
error: aborting due to 3 previous errors

View File

@ -63,7 +63,7 @@ fn d() {
match vec {
&mut [ //~ ERROR cannot move out
//~^ cannot move out
_b] => {} //~ NOTE to prevent move
_b] => {}
_ => {}
}
let a = vec[0]; //~ ERROR cannot move out
@ -76,9 +76,6 @@ fn e() {
match vec {
&mut [_a, _b, _c] => {} //~ ERROR cannot move out
//~| cannot move out
//~| NOTE to prevent move
//~| NOTE and here
//~| NOTE and here
_ => {}
}
let a = vec[0]; //~ ERROR cannot move out

View File

@ -44,7 +44,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
64 | &mut [ //~ ERROR cannot move out
| ______________^
65 | | //~^ cannot move out
66 | | _b] => {} //~ NOTE to prevent move
66 | | _b] => {}
| |__________--^ cannot move out of here
| |
| hint: to prevent move, use `ref _b` or `ref mut _b`
@ -70,9 +70,9 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
| cannot move out of here
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
--> $DIR/borrowck-vec-pattern-nesting.rs:84:13
--> $DIR/borrowck-vec-pattern-nesting.rs:81:13
|
84 | let a = vec[0]; //~ ERROR cannot move out
81 | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^
| |
| cannot move out of here

View File

@ -16,10 +16,9 @@ fn call<F>(f: F) where F : Fn() {
}
fn main() {
let y = vec![format!("World")]; //~ NOTE captured outer variable
let y = vec![format!("World")];
call(|| {
y.into_iter();
//~^ ERROR cannot move out of captured outer variable in an `Fn` closure
//~| NOTE cannot move out of
});
}

View File

@ -1,7 +1,7 @@
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
--> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9
|
19 | let y = vec![format!("World")]; //~ NOTE captured outer variable
19 | let y = vec![format!("World")];
| - captured outer variable
20 | call(|| {
21 | y.into_iter();

View File

@ -11,5 +11,4 @@
fn main() {
let u = 5 as bool;
//~^ ERROR cannot cast as `bool`
//~| HELP compare with zero instead
}

View File

@ -15,5 +15,4 @@
fn main() {
let _ = 3 as bool;
//~^ ERROR cannot cast as `bool`
//~| HELP compare with zero
}

View File

@ -17,7 +17,5 @@
extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
//~| NOTE: the following crate versions were found
//~| NOTE: perhaps that crate needs to be recompiled
fn main() {}

View File

@ -14,13 +14,10 @@ fn main() {
let dict: HashMap<i32, i32> = HashMap::new();
let debug_dump_dict = || {
for (key, value) in dict {
//~^ NOTE closure cannot be invoked more than once
println!("{:?} - {:?}", key, value);
}
};
debug_dump_dict();
//~^ NOTE: value moved here
debug_dump_dict();
//~^ ERROR use of moved value: `debug_dump_dict`
//~| NOTE value used here after move
}

View File

@ -1,10 +1,9 @@
error[E0382]: use of moved value: `debug_dump_dict`
--> $DIR/issue-42065.rs:23:5
--> $DIR/issue-42065.rs:21:5
|
21 | debug_dump_dict();
20 | debug_dump_dict();
| --------------- value moved here
22 | //~^ NOTE: value moved here
23 | debug_dump_dict();
21 | debug_dump_dict();
| ^^^^^^^^^^^^^^^ value used here after move
|
note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment

View File

@ -28,36 +28,22 @@ impl Copy for MyType {}
impl Copy for &'static mut MyType {}
//~^ ERROR the trait `Copy` may not be implemented for this type
//~| NOTE type is not a structure or enumeration
impl Clone for MyType { fn clone(&self) -> Self { *self } }
impl Copy for (MyType, MyType) {}
//~^ ERROR the trait `Copy` may not be implemented for this type
//~| NOTE type is not a structure or enumeration
//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
//~| NOTE impl doesn't use types inside crate
//~| NOTE the impl does not reference any types defined in this crate
//~| NOTE define and implement a trait or new type instead
impl Copy for &'static NotSync {}
//~^ ERROR the trait `Copy` may not be implemented for this type
//~| NOTE type is not a structure or enumeration
impl Copy for [MyType] {}
//~^ ERROR the trait `Copy` may not be implemented for this type
//~| NOTE type is not a structure or enumeration
//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
//~| NOTE the impl does not reference any types defined in this crate
//~| NOTE define and implement a trait or new type instead
//~| NOTE impl doesn't use types inside crate
impl Copy for &'static [NotSync] {}
//~^ ERROR the trait `Copy` may not be implemented for this type
//~| NOTE type is not a structure or enumeration
//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
//~| NOTE impl doesn't use types inside crate
//~| NOTE the impl does not reference any types defined in this crate
//~| NOTE define and implement a trait or new type instead
fn main() {
}

View File

@ -5,51 +5,51 @@ error[E0206]: the trait `Copy` may not be implemented for this type
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
error[E0206]: the trait `Copy` may not be implemented for this type
--> $DIR/coherence-impls-copy.rs:34:15
--> $DIR/coherence-impls-copy.rs:33:15
|
34 | impl Copy for (MyType, MyType) {}
33 | impl Copy for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
error[E0206]: the trait `Copy` may not be implemented for this type
--> $DIR/coherence-impls-copy.rs:42:15
--> $DIR/coherence-impls-copy.rs:37:15
|
42 | impl Copy for &'static NotSync {}
37 | impl Copy for &'static NotSync {}
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
error[E0206]: the trait `Copy` may not be implemented for this type
--> $DIR/coherence-impls-copy.rs:46:15
--> $DIR/coherence-impls-copy.rs:40:15
|
46 | impl Copy for [MyType] {}
40 | impl Copy for [MyType] {}
| ^^^^^^^^ type is not a structure or enumeration
error[E0206]: the trait `Copy` may not be implemented for this type
--> $DIR/coherence-impls-copy.rs:54:15
--> $DIR/coherence-impls-copy.rs:44:15
|
54 | impl Copy for &'static [NotSync] {}
44 | impl Copy for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:34:1
--> $DIR/coherence-impls-copy.rs:33:1
|
34 | impl Copy for (MyType, MyType) {}
33 | impl Copy for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
= note: the impl does not reference any types defined in this crate
= note: define and implement a trait or new type instead
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:46:1
--> $DIR/coherence-impls-copy.rs:40:1
|
46 | impl Copy for [MyType] {}
40 | impl Copy for [MyType] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
= note: the impl does not reference any types defined in this crate
= note: define and implement a trait or new type instead
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/coherence-impls-copy.rs:54:1
--> $DIR/coherence-impls-copy.rs:44:1
|
54 | impl Copy for &'static [NotSync] {}
44 | impl Copy for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
= note: the impl does not reference any types defined in this crate

View File

@ -16,17 +16,12 @@ pub trait Sugar {}
pub trait Fruit {}
impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `dummy`
impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
//~^ NOTE other definition for `dummy`
trait Bar<X> {}
struct A<T, X>(T, X);
impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `f`
//~| NOTE downstream crates may implement trait `Bar<_>` for type `i32`
impl<X> A<i32, X> { fn f(&self) {} }
//~^ NOTE other definition for `f`
fn main() {}

View File

@ -3,17 +3,17 @@ error[E0592]: duplicate definitions with name `dummy`
|
17 | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
...
20 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
18 | //~^ ERROR E0592
19 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
| ------------------- other definition for `dummy`
error[E0592]: duplicate definitions with name `f`
--> $DIR/coherence-overlap-downstream-inherent.rs:25:38
--> $DIR/coherence-overlap-downstream-inherent.rs:23:38
|
25 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
23 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
| ^^^^^^^^^^^^^^ duplicate definitions for `f`
...
29 | impl<X> A<i32, X> { fn f(&self) {} }
24 | //~^ ERROR E0592
25 | impl<X> A<i32, X> { fn f(&self) {} }
| -------------- other definition for `f`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`

View File

@ -15,18 +15,13 @@ pub trait Sugar {}
pub trait Fruit {}
pub trait Sweet {}
impl<T:Sugar> Sweet for T { }
//~^ NOTE first implementation here
impl<T:Fruit> Sweet for T { }
//~^ ERROR E0119
//~| NOTE conflicting implementation
pub trait Foo<X> {}
pub trait Bar<X> {}
impl<X, T> Foo<X> for T where T: Bar<X> {}
//~^ NOTE first implementation here
impl<X> Foo<X> for i32 {}
//~^ ERROR E0119
//~| NOTE conflicting implementation for `i32`
//~| NOTE downstream crates may implement trait `Bar<_>` for type `i32`
fn main() { }

View File

@ -1,19 +1,17 @@
error[E0119]: conflicting implementations of trait `Sweet`:
--> $DIR/coherence-overlap-downstream.rs:19:1
--> $DIR/coherence-overlap-downstream.rs:18:1
|
17 | impl<T:Sugar> Sweet for T { }
| ----------------------------- first implementation here
18 | //~^ NOTE first implementation here
19 | impl<T:Fruit> Sweet for T { }
18 | impl<T:Fruit> Sweet for T { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
--> $DIR/coherence-overlap-downstream.rs:27:1
--> $DIR/coherence-overlap-downstream.rs:24:1
|
25 | impl<X, T> Foo<X> for T where T: Bar<X> {}
23 | impl<X, T> Foo<X> for T where T: Bar<X> {}
| ------------------------------------------ first implementation here
26 | //~^ NOTE first implementation here
27 | impl<X> Foo<X> for i32 {}
24 | impl<X> Foo<X> for i32 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`

View File

@ -18,9 +18,6 @@ struct Cake<X>(X);
impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `dummy`
//~| NOTE downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
//~^ NOTE other definition for `dummy`
fn main() { }

View File

@ -3,8 +3,8 @@ error[E0592]: duplicate definitions with name `dummy`
|
19 | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
...
23 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
20 | //~^ ERROR E0592
21 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
| ------------------- other definition for `dummy`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`

View File

@ -15,10 +15,7 @@
pub trait Sugar { fn dummy(&self) { } }
pub trait Sweet { fn dummy(&self) { } }
impl<T:Sugar> Sweet for T { }
//~^ NOTE first implementation here
impl<U:Sugar> Sweet for Box<U> { }
//~^ ERROR E0119
//~| NOTE conflicting implementation for `std::boxed::Box<_>`
//~| NOTE downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
fn main() { }

View File

@ -1,10 +1,9 @@
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
--> $DIR/coherence-overlap-issue-23516.rs:19:1
--> $DIR/coherence-overlap-issue-23516.rs:18:1
|
17 | impl<T:Sugar> Sweet for T { }
| ----------------------------- first implementation here
18 | //~^ NOTE first implementation here
19 | impl<U:Sugar> Sweet for Box<U> { }
18 | impl<U:Sugar> Sweet for Box<U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`

View File

@ -20,9 +20,6 @@ use coherence_lib::Remote;
struct A<X>(X);
impl<T> A<T> where T: Remote { fn dummy(&self) { } }
//~^ ERROR E0592
//~| NOTE duplicate definitions for `dummy`
//~| NOTE upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16`
impl A<i16> { fn dummy(&self) { } }
//~^ NOTE other definition for `dummy`
fn main() {}

View File

@ -3,8 +3,8 @@ error[E0592]: duplicate definitions with name `dummy`
|
21 | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
...
25 | impl A<i16> { fn dummy(&self) { } }
22 | //~^ ERROR E0592
23 | impl A<i16> { fn dummy(&self) { } }
| ------------------- other definition for `dummy`
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions

View File

@ -19,10 +19,7 @@ use coherence_lib::Remote;
trait Foo {}
impl<T> Foo for T where T: Remote {}
//~^ NOTE first implementation here
impl Foo for i16 {}
//~^ ERROR E0119
//~| NOTE conflicting implementation for `i16`
//~| NOTE upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16`
fn main() {}

View File

@ -1,10 +1,9 @@
error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
--> $DIR/coherence-overlap-upstream.rs:23:1
--> $DIR/coherence-overlap-upstream.rs:22:1
|
21 | impl<T> Foo for T where T: Remote {}
| ------------------------------------ first implementation here
22 | //~^ NOTE first implementation here
23 | impl Foo for i16 {}
22 | impl Foo for i16 {}
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions

View File

@ -12,6 +12,5 @@
fn main() {
static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
//~| NOTE dereference of raw pointer in constant
println!("{}", C);
}

View File

@ -24,7 +24,7 @@ const NEG_NEG_128: i8 = -NEG_128;
fn main() {
match -128i8 {
NEG_NEG_128 => println!("A"), //~ NOTE for pattern here
NEG_NEG_128 => println!("A"),
_ => println!("B"),
}
}

View File

@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
note: for pattern here
--> $DIR/const-eval-overflow-2.rs:27:9
|
27 | NEG_NEG_128 => println!("A"), //~ NOTE for pattern here
27 | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
error: aborting due to previous error

View File

@ -22,9 +22,7 @@ use std::{u8, u16, u32, u64, usize};
const A_I8_T
: [u32; (i8::MAX as i8 + 1i8) as usize]
//~^ ERROR constant evaluation error
//~^^ NOTE attempt to add with overflow
//~| WARNING constant evaluation error
//~| NOTE on by default
= [0; (i8::MAX as usize) + 1];
fn main() {
@ -34,4 +32,3 @@ fn main() {
fn foo<T:fmt::Debug>(x: T) {
println!("{:?}", x);
}

View File

@ -19,7 +19,6 @@ enum E {
V = CONSTANT,
//~^ ERROR mismatched types
//~| expected isize, found struct `S`
//~| NOTE expected type `isize`
//~| found type `S`
}

View File

@ -24,7 +24,6 @@ const fn f(x: usize) -> usize {
#[allow(unused_variables)]
fn main() {
let a : [i32; f(X)]; //~ NOTE for constant expression here
//~| WARNING constant evaluation error: non-constant path
//~| on by default
let a : [i32; f(X)];
//~^ WARNING constant evaluation error: non-constant path
}

View File

@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
note: for constant expression here
--> $DIR/const-fn-error.rs:26:13
|
26 | let a : [i32; f(X)]; //~ NOTE for constant expression here
26 | let a : [i32; f(X)];
| ^^^^^^^^^^^
error: aborting due to previous error

View File

@ -22,7 +22,6 @@ trait Foo {
impl Foo for u32 {
const fn f() -> u32 { 22 }
//~^ ERROR trait fns cannot be declared const
//~| NOTE trait fns cannot be const
}
fn main() { }

View File

@ -16,10 +16,8 @@
trait Foo {
const fn f() -> u32;
//~^ ERROR trait fns cannot be declared const
//~| NOTE trait fns cannot be const
const fn g() -> u32 { 0 }
//~^ ERROR trait fns cannot be declared const
//~| NOTE trait fns cannot be const
}
fn main() { }

View File

@ -5,9 +5,9 @@ error[E0379]: trait fns cannot be declared const
| ^^^^^ trait fns cannot be const
error[E0379]: trait fns cannot be declared const
--> $DIR/const-fn-not-in-trait.rs:20:5
--> $DIR/const-fn-not-in-trait.rs:19:5
|
20 | const fn g() -> u32 { 0 }
19 | const fn g() -> u32 { 0 }
| ^^^^^ trait fns cannot be const
error: aborting due to 2 previous errors

View File

@ -22,5 +22,4 @@ const LEN: usize = ONE - TWO;
fn main() {
let a: [i8; LEN] = unimplemented!();
//~^ NOTE for constant expression here
}

View File

@ -34,7 +34,7 @@ const GOO: Cake = foo();
fn main() {
match BlackForest {
FOO => println!("hi"), //~ NOTE: for pattern here
FOO => println!("hi"),
GOO => println!("meh"),
WORKS => println!("möp"),
_ => println!("bye"),

View File

@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
note: for pattern here
--> $DIR/const-pattern-not-const-evaluable.rs:37:9
|
37 | FOO => println!("hi"), //~ NOTE: for pattern here
37 | FOO => println!("hi"),
| ^^^
error: aborting due to previous error

View File

@ -12,23 +12,15 @@ use std::fmt::Debug;
const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
const CONST_FOO: str = *"foo";
//~^ ERROR `str: std::marker::Sized` is not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
static STATIC_BAR: str = *"bar";
//~^ ERROR `str: std::marker::Sized` is not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
fn main() {
println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);

View File

@ -8,27 +8,27 @@ error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: st
= note: constant expressions must have a statically known size
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
--> $DIR/const-unsized.rs:18:24
--> $DIR/const-unsized.rs:16:24
|
18 | const CONST_FOO: str = *"foo";
16 | const CONST_FOO: str = *"foo";
| ^^^^^^ `str` does not have a constant size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: constant expressions must have a statically known size
error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
--> $DIR/const-unsized.rs:23:31
--> $DIR/const-unsized.rs:19:31
|
23 | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
19 | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
| ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
= note: constant expressions must have a statically known size
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
--> $DIR/const-unsized.rs:28:26
--> $DIR/const-unsized.rs:22:26
|
28 | static STATIC_BAR: str = *"bar";
22 | static STATIC_BAR: str = *"bar";
| ^^^^^^ `str` does not have a constant size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`

View File

@ -12,16 +12,13 @@
// a direct participant in the cycle.
trait A: B {
//~^ NOTE the cycle begins when computing the supertraits of `B`...
}
trait B: C {
//~^ NOTE ...which then requires computing the supertraits of `C`...
}
trait C: B { }
//~^ ERROR unsupported cyclic reference
//~| cyclic reference
//~| NOTE ...which then again requires computing the supertraits of `B`, completing the cycle
fn main() { }

View File

@ -1,7 +1,7 @@
error[E0391]: unsupported cyclic reference between types/traits detected
--> $DIR/cycle-trait-supertrait-indirect.rs:22:1
--> $DIR/cycle-trait-supertrait-indirect.rs:20:1
|
22 | trait C: B { }
20 | trait C: B { }
| ^^^^^^^^^^ cyclic reference
|
note: the cycle begins when computing the supertraits of `B`...
@ -10,9 +10,9 @@ note: the cycle begins when computing the supertraits of `B`...
14 | trait A: B {
| ^^^^^^^^^^
note: ...which then requires computing the supertraits of `C`...
--> $DIR/cycle-trait-supertrait-indirect.rs:18:1
--> $DIR/cycle-trait-supertrait-indirect.rs:17:1
|
18 | trait B: C {
17 | trait B: C {
| ^^^^^^^^^^
= note: ...which then again requires computing the supertraits of `B`, completing the cycle.

View File

@ -12,7 +12,6 @@
mod foo {
#![macro_escape] //~ WARNING macro_escape is a deprecated synonym for macro_use
//~^ HELP consider an outer attribute
}
fn main() {

View File

@ -29,7 +29,6 @@ fn main() {
let mut map = HashMap::new();
//~^ ERROR E0433
//~| NOTE Use of undeclared type or module `HashMap`
for line in input.lines() {
let line = line.unwrap();

View File

@ -25,8 +25,6 @@ fn f_i8() {
Ok = i8::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 127i8
//~| NOTE explicitly set `OhNo = -128i8` if that is desired outcome
}
}
@ -36,8 +34,6 @@ fn f_u8() {
Ok = u8::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 255u8
//~| NOTE explicitly set `OhNo = 0u8` if that is desired outcome
}
}
@ -47,8 +43,6 @@ fn f_i16() {
Ok = i16::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 32767i16
//~| NOTE explicitly set `OhNo = -32768i16` if that is desired outcome
}
}
@ -58,8 +52,6 @@ fn f_u16() {
Ok = u16::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 65535u16
//~| NOTE explicitly set `OhNo = 0u16` if that is desired outcome
}
}
@ -69,8 +61,6 @@ fn f_i32() {
Ok = i32::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 2147483647i32
//~| NOTE explicitly set `OhNo = -2147483648i32` if that is desired outcome
}
}
@ -80,8 +70,6 @@ fn f_u32() {
Ok = u32::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 4294967295u32
//~| NOTE explicitly set `OhNo = 0u32` if that is desired outcome
}
}
@ -91,8 +79,6 @@ fn f_i64() {
Ok = i64::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 9223372036854775807i64
//~| NOTE explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
}
}
@ -102,8 +88,6 @@ fn f_u64() {
Ok = u64::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 18446744073709551615u64
//~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
}
}

View File

@ -7,60 +7,60 @@ error[E0370]: enum discriminant overflowed
= note: explicitly set `OhNo = -128i8` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:38:9
--> $DIR/discrim-overflow-2.rs:36:9
|
38 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
36 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 255u8
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:49:9
--> $DIR/discrim-overflow-2.rs:45:9
|
49 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
45 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 32767i16
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:60:9
--> $DIR/discrim-overflow-2.rs:54:9
|
60 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
54 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 65535u16
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:71:9
--> $DIR/discrim-overflow-2.rs:63:9
|
71 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
63 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 2147483647i32
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:82:9
--> $DIR/discrim-overflow-2.rs:72:9
|
82 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
72 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 4294967295u32
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:93:9
--> $DIR/discrim-overflow-2.rs:81:9
|
93 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
81 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 9223372036854775807i64
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow-2.rs:104:9
|
104 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 18446744073709551615u64
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
--> $DIR/discrim-overflow-2.rs:90:9
|
90 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 18446744073709551615u64
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
error: aborting due to 8 previous errors

View File

@ -23,8 +23,6 @@ fn f_i8() {
Ok = i8::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 127i8
//~| NOTE explicitly set `OhNo = -128i8` if that is desired outcome
}
let x = A::Ok;
@ -36,8 +34,6 @@ fn f_u8() {
Ok = u8::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 255u8
//~| NOTE explicitly set `OhNo = 0u8` if that is desired outcome
}
let x = A::Ok;
@ -49,8 +45,6 @@ fn f_i16() {
Ok = i16::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| NOTE overflowed on value after 32767i16
//~| NOTE explicitly set `OhNo = -32768i16` if that is desired outcome
}
let x = A::Ok;
@ -63,7 +57,6 @@ fn f_u16() {
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| overflowed on value after 65535u16
//~| NOTE explicitly set `OhNo = 0u16` if that is desired outcome
}
let x = A::Ok;
@ -76,7 +69,6 @@ fn f_i32() {
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| overflowed on value after 2147483647i32
//~| NOTE explicitly set `OhNo = -2147483648i32` if that is desired outcome
}
let x = A::Ok;
@ -89,7 +81,6 @@ fn f_u32() {
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| overflowed on value after 4294967295u32
//~| NOTE explicitly set `OhNo = 0u32` if that is desired outcome
}
let x = A::Ok;
@ -102,7 +93,6 @@ fn f_i64() {
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| overflowed on value after 9223372036854775807i64
//~| NOTE explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
}
let x = A::Ok;
@ -115,7 +105,6 @@ fn f_u64() {
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
//~| overflowed on value after 18446744073709551615u64
//~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
}
let x = A::Ok;

View File

@ -7,57 +7,57 @@ error[E0370]: enum discriminant overflowed
= note: explicitly set `OhNo = -128i8` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:38:9
--> $DIR/discrim-overflow.rs:36:9
|
38 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
36 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 255u8
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:51:9
--> $DIR/discrim-overflow.rs:47:9
|
51 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
47 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 32767i16
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:64:9
--> $DIR/discrim-overflow.rs:58:9
|
64 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
58 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 65535u16
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:77:9
--> $DIR/discrim-overflow.rs:70:9
|
77 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
70 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 2147483647i32
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:90:9
--> $DIR/discrim-overflow.rs:82:9
|
90 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
82 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 4294967295u32
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:103:9
|
103 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 9223372036854775807i64
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
--> $DIR/discrim-overflow.rs:94:9
|
94 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 9223372036854775807i64
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
error[E0370]: enum discriminant overflowed
--> $DIR/discrim-overflow.rs:116:9
--> $DIR/discrim-overflow.rs:106:9
|
116 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
106 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
| ^^^^ overflowed on value after 18446744073709551615u64
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome

View File

@ -19,9 +19,7 @@ mod sub2 {
pub fn foo() {} // implementation 2
}
use sub1::foo; //~ NOTE previous import of the value `foo` here
use sub1::foo;
use sub2::foo; //~ ERROR the name `foo` is defined multiple times
//~| NOTE `foo` reimported here
//~| NOTE `foo` must be defined only once in the value namespace of this module
fn main() {}

View File

@ -1,7 +1,7 @@
error[E0252]: the name `foo` is defined multiple times
--> $DIR/double-import.rs:23:5
|
22 | use sub1::foo; //~ NOTE previous import of the value `foo` here
22 | use sub1::foo;
| --------- previous import of the value `foo` here
23 | use sub2::foo; //~ ERROR the name `foo` is defined multiple times
| ^^^^^^^^^ `foo` reimported here

View File

@ -10,10 +10,9 @@
#![feature(use_extern_macros)]
pub use std::panic; //~ NOTE previous macro export here
pub use std::panic;
#[macro_export]
macro_rules! panic { () => {} } //~ ERROR a macro named `panic` has already been exported
//~| NOTE `panic` already exported
fn main() {}

View File

@ -7,7 +7,7 @@ error: a macro named `panic` has already been exported
note: previous macro export here
--> $DIR/duplicate-check-macro-exports.rs:13:9
|
13 | pub use std::panic; //~ NOTE previous macro export here
13 | pub use std::panic;
| ^^^^^^^^^^
error: aborting due to previous error

View File

@ -25,9 +25,7 @@ fn main() {
let e2 = Empty2(); //~ ERROR expected function, found `Empty2`
let e4 = E::Empty4();
//~^ ERROR expected function, found `E::Empty4` [E0618]
//~| HELP did you mean to write `E::Empty4`?
let xe2 = XEmpty2(); //~ ERROR expected function, found `empty_struct::XEmpty2`
let xe4 = XE::XEmpty4();
//~^ ERROR expected function, found `XE::XEmpty4` [E0618]
//~| HELP did you mean to write `XE::XEmpty4`?
}

View File

@ -24,15 +24,15 @@ note: defined here
| ^^^^^^
error[E0618]: expected function, found `empty_struct::XEmpty2`
--> $DIR/empty-struct-unit-expr.rs:29:15
--> $DIR/empty-struct-unit-expr.rs:28:15
|
29 | let xe2 = XEmpty2(); //~ ERROR expected function, found `empty_struct::XEmpty2`
28 | let xe2 = XEmpty2(); //~ ERROR expected function, found `empty_struct::XEmpty2`
| ^^^^^^^^^
error[E0618]: expected function, found `XE::XEmpty4`
--> $DIR/empty-struct-unit-expr.rs:30:15
--> $DIR/empty-struct-unit-expr.rs:29:15
|
30 | let xe4 = XE::XEmpty4();
29 | let xe4 = XE::XEmpty4();
| ^^^^^^^^^^^^^
|
= help: did you mean to write `XE::XEmpty4`?

View File

@ -8,13 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
enum Foo { //~ NOTE previous definition of the type `Foo` here
enum Foo {
X
}
mod Foo { //~ ERROR the name `Foo` is defined multiple times
//~| NOTE `Foo` redefined here
//~| NOTE `Foo` must be defined only once in the type namespace of this module
pub static X: isize = 42;
fn f() { f() } // Check that this does not result in a resolution error
}

View File

@ -1,17 +1,15 @@
error[E0428]: the name `Foo` is defined multiple times
--> $DIR/enum-and-module-in-same-scope.rs:15:1
|
11 | / enum Foo { //~ NOTE previous definition of the type `Foo` here
11 | / enum Foo {
12 | | X
13 | | }
| |_- previous definition of the type `Foo` here
14 |
15 | / mod Foo { //~ ERROR the name `Foo` is defined multiple times
16 | | //~| NOTE `Foo` redefined here
17 | | //~| NOTE `Foo` must be defined only once in the type namespace of this module
18 | | pub static X: isize = 42;
19 | | fn f() { f() } // Check that this does not result in a resolution error
20 | | }
16 | | pub static X: isize = 42;
17 | | fn f() { f() } // Check that this does not result in a resolution error
18 | | }
| |_^ `Foo` redefined here
|
= note: `Foo` must be defined only once in the type namespace of this module

View File

@ -18,14 +18,12 @@ fn main() {
let q = a.as_ptr();
a as usize; //~ ERROR casting
//~^ HELP cast through a raw pointer first
a as isize; //~ ERROR casting
a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
b as usize; //~ ERROR non-primitive cast
p as usize;
//~^ ERROR casting
//~^^ HELP cast through a thin pointer
// #22955
q as *const [i32]; //~ ERROR cannot cast

View File

@ -7,55 +7,55 @@ error[E0606]: casting `&[i32]` as `usize` is invalid
= help: cast through a raw pointer first
error[E0606]: casting `&[i32]` as `isize` is invalid
--> $DIR/fat-ptr-cast.rs:22:5
--> $DIR/fat-ptr-cast.rs:21:5
|
22 | a as isize; //~ ERROR casting
21 | a as isize; //~ ERROR casting
| ^^^^^^^^^^
error[E0606]: casting `&[i32]` as `i16` is invalid
--> $DIR/fat-ptr-cast.rs:23:5
--> $DIR/fat-ptr-cast.rs:22:5
|
23 | a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
22 | a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
| ^^^^^^^^
error[E0606]: casting `&[i32]` as `u32` is invalid
--> $DIR/fat-ptr-cast.rs:24:5
--> $DIR/fat-ptr-cast.rs:23:5
|
24 | a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
23 | a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
| ^^^^^^^^
error[E0605]: non-primitive cast: `std::boxed::Box<[i32]>` as `usize`
--> $DIR/fat-ptr-cast.rs:25:5
--> $DIR/fat-ptr-cast.rs:24:5
|
25 | b as usize; //~ ERROR non-primitive cast
24 | b as usize; //~ ERROR non-primitive cast
| ^^^^^^^^^^
|
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
error[E0606]: casting `*const [i32]` as `usize` is invalid
--> $DIR/fat-ptr-cast.rs:26:5
--> $DIR/fat-ptr-cast.rs:25:5
|
26 | p as usize;
25 | p as usize;
| ^^^^^^^^^^
|
= help: cast through a thin pointer first
error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32]`
--> $DIR/fat-ptr-cast.rs:31:5
--> $DIR/fat-ptr-cast.rs:29:5
|
31 | q as *const [i32]; //~ ERROR cannot cast
29 | q as *const [i32]; //~ ERROR cannot cast
| ^^^^^^^^^^^^^^^^^
error[E0606]: casting `usize` as `*mut Trait + 'static` is invalid
--> $DIR/fat-ptr-cast.rs:34:37
--> $DIR/fat-ptr-cast.rs:32:37
|
34 | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting
32 | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting
| ^^^^^^^^^^^
error[E0606]: casting `usize` as `*const str` is invalid
--> $DIR/fat-ptr-cast.rs:35:32
--> $DIR/fat-ptr-cast.rs:33:32
|
35 | let mut fail: *const str = 0 as *const str; //~ ERROR casting
33 | let mut fail: *const str = 0 as *const str; //~ ERROR casting
| ^^^^^^^^^^^^^^^
error: aborting due to 9 previous errors

View File

@ -11,6 +11,5 @@
#![allow(unused_macros)]
macro m() {} //~ ERROR `macro` is experimental (see issue #39412)
//~| HELP add #![feature(decl_macro)] to the crate attributes to enable
fn main() {}

View File

@ -17,6 +17,5 @@
struct Pt<A>(A);
impl<#[may_dangle] A> Drop for Pt<A> {
//~^ ERROR may_dangle has unstable semantics and may be removed in the future
//~| HELP add #![feature(dropck_eyepatch)] to the crate attributes to enable
fn drop(&mut self) { }
}

View File

@ -10,7 +10,6 @@
#[repr(u128)]
enum A { //~ ERROR repr with 128-bit type is unstable
//~| HELP: add #![feature(repr128)]
A(u64)
}

View File

@ -2,9 +2,8 @@ error: repr with 128-bit type is unstable (see issue #35118)
--> $DIR/feature-gate-repr128.rs:12:1
|
12 | / enum A { //~ ERROR repr with 128-bit type is unstable
13 | | //~| HELP: add #![feature(repr128)]
14 | | A(u64)
15 | | }
13 | | A(u64)
14 | | }
| |_^
|
= help: add #![feature(repr128)] to the crate attributes to enable

View File

@ -18,5 +18,4 @@ struct Vec<T, A = Heap>(
fn main() {
let _: Vec;
//~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0243]
//~| NOTE expected at least 1 type argument
}

View File

@ -18,5 +18,4 @@ struct Vec<T, A = Heap>(
fn main() {
let _: Vec<isize, Heap, bool>;
//~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0244]
//~| NOTE expected at most 2 type arguments
}

View File

@ -14,7 +14,7 @@ fn main() {
//~| expected type `()`
//~| found type `{integer}`
()
} else { //~ NOTE: `if let` arm with an incompatible type
} else {
1
};
}

View File

@ -15,7 +15,7 @@ error[E0308]: `if let` arms have incompatible types
note: `if let` arm with an incompatible type
--> $DIR/if-let-arm-types.rs:17:12
|
17 | } else { //~ NOTE: `if let` arm with an incompatible type
17 | } else {
| ____________^
18 | | 1
19 | | };

Some files were not shown because too many files have changed in this diff Show More