Remove NOTE/HELP annotations from UI tests
This commit is contained in:
parent
d4e51a8fb2
commit
1f5b201aff
462 changed files with 1841 additions and 2899 deletions
|
@ -39,12 +39,7 @@ impl Bar for usize {
|
||||||
fn make_foo() {
|
fn make_foo() {
|
||||||
let x = Box::new(5usize) as Box<Foo>;
|
let x = Box::new(5usize) as Box<Foo>;
|
||||||
//~^ ERROR E0038
|
//~^ ERROR E0038
|
||||||
//~| NOTE method `foo` has a non-standard `self` type
|
|
||||||
//~| NOTE the trait `Foo` cannot be made into an object
|
|
||||||
//~| ERROR E0038
|
//~| 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() {
|
fn make_bar() {
|
||||||
|
|
|
@ -23,12 +23,11 @@ fn foo(x: isize) { println!("{}", x); }
|
||||||
target_arch = "aarch64"))]
|
target_arch = "aarch64"))]
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x: isize;
|
let x: isize;
|
||||||
x = 1; //~ NOTE first assignment
|
x = 1;
|
||||||
foo(x);
|
foo(x);
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||||
//~^ ERROR cannot assign twice to immutable variable `x`
|
//~^ ERROR cannot assign twice to immutable variable `x`
|
||||||
//~| NOTE cannot assign twice to immutable
|
|
||||||
}
|
}
|
||||||
foo(x);
|
foo(x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0384]: cannot assign twice to immutable variable `x`
|
error[E0384]: cannot assign twice to immutable variable `x`
|
||||||
--> $DIR/asm-out-assign-imm.rs:29:9
|
--> $DIR/asm-out-assign-imm.rs:29:9
|
||||||
|
|
|
|
||||||
26 | x = 1; //~ NOTE first assignment
|
26 | x = 1;
|
||||||
| ----- first assignment to `x`
|
| ----- first assignment to `x`
|
||||||
...
|
...
|
||||||
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||||
|
|
|
@ -15,12 +15,8 @@ trait Foo {
|
||||||
|
|
||||||
|
|
||||||
impl<'a> Foo for &'a () {
|
impl<'a> Foo for &'a () {
|
||||||
//~^ NOTE the lifetime 'a as defined
|
|
||||||
const NAME: &'a str = "unit";
|
const NAME: &'a str = "unit";
|
||||||
//~^ ERROR mismatched types [E0308]
|
//~^ ERROR mismatched types [E0308]
|
||||||
//~| NOTE lifetime mismatch
|
|
||||||
//~| NOTE expected type `&'static str`
|
|
||||||
//~| NOTE ...does not necessarily outlive the static lifetime
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0308]: mismatched types
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||||
|
|
|
|
||||||
= note: expected type `&'static str`
|
= 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
|
--> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
|
||||||
|
|
|
|
||||||
17 | / impl<'a> Foo for &'a () {
|
17 | / impl<'a> Foo for &'a () {
|
||||||
18 | | //~^ NOTE the lifetime 'a as defined
|
18 | | const NAME: &'a str = "unit";
|
||||||
19 | | const NAME: &'a str = "unit";
|
19 | | //~^ ERROR mismatched types [E0308]
|
||||||
20 | | //~^ ERROR mismatched types [E0308]
|
20 | | }
|
||||||
... |
|
|
||||||
23 | | //~| NOTE ...does not necessarily outlive the static lifetime
|
|
||||||
24 | | }
|
|
||||||
| |_^
|
| |_^
|
||||||
= note: ...does not necessarily outlive the static lifetime
|
= note: ...does not necessarily outlive the static lifetime
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
const BAR: u32; //~ NOTE type in trait
|
const BAR: u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SignedBar;
|
struct SignedBar;
|
||||||
|
@ -18,7 +18,6 @@ struct SignedBar;
|
||||||
impl Foo for SignedBar {
|
impl Foo for SignedBar {
|
||||||
const BAR: i32 = -1;
|
const BAR: i32 = -1;
|
||||||
//~^ ERROR implemented const `BAR` has an incompatible type for trait [E0326]
|
//~^ ERROR implemented const `BAR` has an incompatible type for trait [E0326]
|
||||||
//~| NOTE expected u32, found i32
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0326]: implemented const `BAR` has an incompatible type for trait
|
error[E0326]: implemented const `BAR` has an incompatible type for trait
|
||||||
--> $DIR/associated-const-impl-wrong-type.rs:19:16
|
--> $DIR/associated-const-impl-wrong-type.rs:19:16
|
||||||
|
|
|
|
||||||
13 | const BAR: u32; //~ NOTE type in trait
|
13 | const BAR: u32;
|
||||||
| --- type in trait
|
| --- type in trait
|
||||||
...
|
...
|
||||||
19 | const BAR: i32 = -1;
|
19 | const BAR: i32 = -1;
|
||||||
|
|
|
@ -13,18 +13,12 @@
|
||||||
|
|
||||||
pub trait Vehicle {
|
pub trait Vehicle {
|
||||||
type Color;
|
type Color;
|
||||||
//~^ NOTE ambiguous `Color` from `Vehicle`
|
|
||||||
//~| NOTE ambiguous `Color` from `Vehicle`
|
|
||||||
//~| NOTE ambiguous `Color` from `Vehicle`
|
|
||||||
|
|
||||||
fn go(&self) { }
|
fn go(&self) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Box {
|
pub trait Box {
|
||||||
type Color;
|
type Color;
|
||||||
//~^ NOTE ambiguous `Color` from `Box`
|
|
||||||
//~| NOTE ambiguous `Color` from `Box`
|
|
||||||
//~| NOTE ambiguous `Color` from `Box`
|
|
||||||
//
|
//
|
||||||
fn mail(&self) { }
|
fn mail(&self) { }
|
||||||
}
|
}
|
||||||
|
@ -34,19 +28,15 @@ pub trait BoxCar : Box + Vehicle {
|
||||||
|
|
||||||
fn dent<C:BoxCar>(c: C, color: C::Color) {
|
fn dent<C:BoxCar>(c: C, color: C::Color) {
|
||||||
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
|
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
|
||||||
//~| NOTE ambiguous associated type `Color`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||||
//~^ ERROR ambiguous associated type
|
//~^ ERROR ambiguous associated type
|
||||||
//~| ERROR the value of the associated type `Color` (from the trait `Vehicle`) must be specified
|
//~| 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) {
|
fn paint<C:BoxCar>(c: C, d: C::Color) {
|
||||||
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
|
//~^ ERROR ambiguous associated type `Color` in bounds of `C`
|
||||||
//~| NOTE ambiguous associated type `Color`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() { }
|
pub fn main() { }
|
||||||
|
|
|
@ -1,43 +1,43 @@
|
||||||
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
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;
|
15 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Vehicle`
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
...
|
...
|
||||||
24 | type Color;
|
21 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Box`
|
| ----------- 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`
|
| ^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
|
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;
|
15 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Vehicle`
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
...
|
...
|
||||||
24 | type Color;
|
21 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Box`
|
| ----------- 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`
|
| ^^^^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
|
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
|
| ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
|
||||||
|
|
||||||
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
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;
|
15 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Vehicle`
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
...
|
...
|
||||||
24 | type Color;
|
21 | type Color;
|
||||||
| ----------- ambiguous `Color` from `Box`
|
| ----------- 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`
|
| ^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
|
@ -32,5 +32,4 @@ fn ice<A>(a: A) {
|
||||||
let r = loop {};
|
let r = loop {};
|
||||||
r = r + a;
|
r = r + a;
|
||||||
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
|
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
|
||||||
//~| NOTE the trait `Add<A>` is not implemented for `()`
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,21 +15,15 @@ trait Get {
|
||||||
|
|
||||||
fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
|
fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
|
||||||
//~^ ERROR ambiguous associated type
|
//~^ ERROR ambiguous associated type
|
||||||
//~| NOTE ambiguous associated type
|
|
||||||
//~| NOTE specify the type using the syntax `<Type as Get>::Value`
|
|
||||||
|
|
||||||
trait Grab {
|
trait Grab {
|
||||||
type Value;
|
type Value;
|
||||||
fn grab(&self) -> Grab::Value;
|
fn grab(&self) -> Grab::Value;
|
||||||
//~^ ERROR ambiguous associated type
|
//~^ 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;
|
type X = std::ops::Deref::Target;
|
||||||
//~^ ERROR ambiguous associated type
|
//~^ ERROR ambiguous associated type
|
||||||
//~| NOTE ambiguous associated type
|
|
||||||
//~| NOTE specify the type using the syntax `<Type as std::ops::Deref>::Target`
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,17 +7,17 @@ error[E0223]: ambiguous associated type
|
||||||
= note: specify the type using the syntax `<Type as Get>::Value`
|
= note: specify the type using the syntax `<Type as Get>::Value`
|
||||||
|
|
||||||
error[E0223]: ambiguous associated type
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
|
||||||
|
|
|
|
||||||
= note: specify the type using the syntax `<Type as std::ops::Deref>::Target`
|
= note: specify the type using the syntax `<Type as std::ops::Deref>::Target`
|
||||||
|
|
||||||
error[E0223]: ambiguous associated type
|
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
|
| ^^^^^^^^^^^ ambiguous associated type
|
||||||
|
|
|
|
||||||
= note: specify the type using the syntax `<Type as Grab>::Value`
|
= note: specify the type using the syntax `<Type as Grab>::Value`
|
||||||
|
|
|
@ -22,7 +22,6 @@ fn main() {
|
||||||
let mut x = Int(1);
|
let mut x = Int(1);
|
||||||
x //~ error: use of moved value: `x`
|
x //~ error: use of moved value: `x`
|
||||||
//~^ value used here after move
|
//~^ value used here after move
|
||||||
//~| note: move occurs because `x` has type `Int`
|
|
||||||
+=
|
+=
|
||||||
x; //~ value moved here
|
x; //~ value moved here
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0596]: cannot borrow immutable local variable `y` as mutable
|
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`
|
| - consider changing this to `mut y`
|
||||||
30 | //~^ consider changing this to `mut y`
|
29 | //~^ consider changing this to `mut y`
|
||||||
31 | y //~ error: cannot borrow immutable local variable `y` as mutable
|
30 | y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||||
| ^ cannot borrow mutably
|
| ^ cannot borrow mutably
|
||||||
|
|
||||||
error[E0382]: use of moved value: `x`
|
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`
|
23 | x //~ error: use of moved value: `x`
|
||||||
| ^ value used here after move
|
| ^ value used here after move
|
||||||
...
|
...
|
||||||
27 | x; //~ value moved here
|
26 | x; //~ value moved here
|
||||||
| - value moved here
|
| - value moved here
|
||||||
|
|
|
|
||||||
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait
|
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait
|
||||||
|
|
|
@ -13,8 +13,6 @@ fn main() {
|
||||||
let vr = v.iter().filter(|x| {
|
let vr = v.iter().filter(|x| {
|
||||||
x % 2 == 0
|
x % 2 == 0
|
||||||
//~^ ERROR binary operation `%` cannot be applied to type `&&{integer}`
|
//~^ 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);
|
println!("{:?}", vr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,10 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// 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;
|
use foo::foo;
|
||||||
//~^ ERROR the name `foo` is defined multiple times
|
//~^ ERROR the name `foo` is defined multiple times
|
||||||
//~| `foo` reimported here
|
//~| `foo` reimported here
|
||||||
//~| NOTE `foo` must be defined only once in the type namespace of this module
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0255]: the name `foo` is defined multiple times
|
error[E0255]: the name `foo` is defined multiple times
|
||||||
--> $DIR/blind-item-item-shadow.rs:13:5
|
--> $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
|
| ---------------------------- previous definition of the module `foo` here
|
||||||
12 |
|
12 |
|
||||||
13 | use foo::foo;
|
13 | use foo::foo;
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
fn f() -> String { //~ ERROR mismatched types
|
fn f() -> String { //~ ERROR mismatched types
|
||||||
0u8;
|
0u8;
|
||||||
"bla".to_string(); //~ HELP consider removing this semicolon
|
"bla".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn g() -> String { //~ ERROR mismatched types
|
fn g() -> String { //~ ERROR mismatched types
|
||||||
"this won't work".to_string();
|
"this won't work".to_string();
|
||||||
"removeme".to_string(); //~ HELP consider removing this semicolon
|
"removeme".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0308]: mismatched types
|
||||||
11 | fn f() -> String { //~ ERROR mismatched types
|
11 | fn f() -> String { //~ ERROR mismatched types
|
||||||
| __________________^
|
| __________________^
|
||||||
12 | | 0u8;
|
12 | | 0u8;
|
||||||
13 | | "bla".to_string(); //~ HELP consider removing this semicolon
|
13 | | "bla".to_string();
|
||||||
| | - help: consider removing this semicolon
|
| | - help: consider removing this semicolon
|
||||||
14 | | }
|
14 | | }
|
||||||
| |_^ expected struct `std::string::String`, found ()
|
| |_^ expected struct `std::string::String`, found ()
|
||||||
|
@ -18,7 +18,7 @@ error[E0308]: mismatched types
|
||||||
16 | fn g() -> String { //~ ERROR mismatched types
|
16 | fn g() -> String { //~ ERROR mismatched types
|
||||||
| __________________^
|
| __________________^
|
||||||
17 | | "this won't work".to_string();
|
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
|
| | - help: consider removing this semicolon
|
||||||
19 | | }
|
19 | | }
|
||||||
| |_^ expected struct `std::string::String`, found ()
|
| |_^ expected struct `std::string::String`, found ()
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
fn blah() -> i32 { //~ ERROR mismatched types
|
fn blah() -> i32 { //~ ERROR mismatched types
|
||||||
1
|
1
|
||||||
|
|
||||||
; //~ HELP consider removing this semicolon
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -5,7 +5,7 @@ error[E0308]: mismatched types
|
||||||
| __________________^
|
| __________________^
|
||||||
12 | | 1
|
12 | | 1
|
||||||
13 | |
|
13 | |
|
||||||
14 | | ; //~ HELP consider removing this semicolon
|
14 | | ;
|
||||||
| | - help: consider removing this semicolon
|
| | - help: consider removing this semicolon
|
||||||
15 | | }
|
15 | | }
|
||||||
| |_^ expected i32, found ()
|
| |_^ expected i32, found ()
|
||||||
|
|
|
@ -15,12 +15,12 @@ fn foo() -> String { //~ ERROR mismatched types
|
||||||
"world")
|
"world")
|
||||||
// Put the trailing semicolon on its own line to test that the
|
// Put the trailing semicolon on its own line to test that the
|
||||||
// note message gets the offending semicolon exactly
|
// note message gets the offending semicolon exactly
|
||||||
; //~ HELP consider removing this semicolon
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bar() -> String { //~ ERROR mismatched types
|
fn bar() -> String { //~ ERROR mismatched types
|
||||||
"foobar".to_string()
|
"foobar".to_string()
|
||||||
; //~ HELP consider removing this semicolon
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
|
@ -7,7 +7,7 @@ error[E0308]: mismatched types
|
||||||
15 | | "world")
|
15 | | "world")
|
||||||
16 | | // Put the trailing semicolon on its own line to test that the
|
16 | | // Put the trailing semicolon on its own line to test that the
|
||||||
17 | | // note message gets the offending semicolon exactly
|
17 | | // note message gets the offending semicolon exactly
|
||||||
18 | | ; //~ HELP consider removing this semicolon
|
18 | | ;
|
||||||
| | - help: consider removing this semicolon
|
| | - help: consider removing this semicolon
|
||||||
19 | | }
|
19 | | }
|
||||||
| |_^ expected struct `std::string::String`, found ()
|
| |_^ expected struct `std::string::String`, found ()
|
||||||
|
@ -21,7 +21,7 @@ error[E0308]: mismatched types
|
||||||
21 | fn bar() -> String { //~ ERROR mismatched types
|
21 | fn bar() -> String { //~ ERROR mismatched types
|
||||||
| ____________________^
|
| ____________________^
|
||||||
22 | | "foobar".to_string()
|
22 | | "foobar".to_string()
|
||||||
23 | | ; //~ HELP consider removing this semicolon
|
23 | | ;
|
||||||
| | - help: consider removing this semicolon
|
| | - help: consider removing this semicolon
|
||||||
24 | | }
|
24 | | }
|
||||||
| |_^ expected struct `std::string::String`, found ()
|
| |_^ expected struct `std::string::String`, found ()
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
|
|
||||||
enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
||||||
//~^ NOTE variant `hsl` not found here
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let red: color = color::rgb(255, 0, 0);
|
let red: color = color::rgb(255, 0, 0);
|
||||||
|
@ -18,6 +17,5 @@ fn main() {
|
||||||
color::rgb(r, g, b) => { println!("rgb"); }
|
color::rgb(r, g, b) => { println!("rgb"); }
|
||||||
color::hsl(h, s, l) => { println!("hsl"); }
|
color::hsl(h, s, l) => { println!("hsl"); }
|
||||||
//~^ ERROR no variant
|
//~^ ERROR no variant
|
||||||
//~| NOTE variant not found in `color`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0599]: no variant named `hsl` found for type `color` in the current scope
|
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), }
|
12 | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
||||||
| ---------- variant `hsl` not found here
|
| ---------- 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`
|
| ^^^^^^^^^^^^^^^^^^^ variant not found in `color`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
|
@ -60,7 +60,6 @@ fn borrow_after_move() {
|
||||||
fn move_after_borrow() {
|
fn move_after_borrow() {
|
||||||
let a: Box<_> = box B { x: box 0, y: box 1 };
|
let a: Box<_> = box B { x: box 0, y: box 1 };
|
||||||
let _x = &a.x;
|
let _x = &a.x;
|
||||||
//~^ NOTE borrow of `a.x` occurs here
|
|
||||||
let _y = a.y;
|
let _y = a.y;
|
||||||
//~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
//~| move out of
|
//~| move out of
|
||||||
|
@ -69,15 +68,12 @@ fn move_after_borrow() {
|
||||||
fn copy_after_mut_borrow() {
|
fn copy_after_mut_borrow() {
|
||||||
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
||||||
let _x = &mut a.x;
|
let _x = &mut a.x;
|
||||||
//~^ NOTE borrow of `a.x` occurs here
|
|
||||||
let _y = a.y; //~ ERROR cannot use
|
let _y = a.y; //~ ERROR cannot use
|
||||||
//~^ NOTE use of borrowed `a.x`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_after_mut_borrow() {
|
fn move_after_mut_borrow() {
|
||||||
let mut a: Box<_> = box B { x: box 0, y: box 1 };
|
let mut a: Box<_> = box B { x: box 0, y: box 1 };
|
||||||
let _x = &mut a.x;
|
let _x = &mut a.x;
|
||||||
//~^ NOTE borrow of `a.x` occurs here
|
|
||||||
let _y = a.y;
|
let _y = a.y;
|
||||||
//~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
//~| move out of
|
//~| move out of
|
||||||
|
@ -86,27 +82,22 @@ fn move_after_mut_borrow() {
|
||||||
fn borrow_after_mut_borrow() {
|
fn borrow_after_mut_borrow() {
|
||||||
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
||||||
let _x = &mut a.x;
|
let _x = &mut a.x;
|
||||||
//~^ NOTE mutable borrow occurs here (via `a.x`)
|
|
||||||
let _y = &a.y; //~ ERROR cannot borrow
|
let _y = &a.y; //~ ERROR cannot borrow
|
||||||
//~^ immutable borrow occurs here (via `a.y`)
|
//~^ immutable borrow occurs here (via `a.y`)
|
||||||
}
|
}
|
||||||
//~^ NOTE mutable borrow ends here
|
|
||||||
|
|
||||||
fn mut_borrow_after_borrow() {
|
fn mut_borrow_after_borrow() {
|
||||||
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
let mut a: Box<_> = box A { x: box 0, y: 1 };
|
||||||
let _x = &a.x;
|
let _x = &a.x;
|
||||||
//~^ NOTE immutable borrow occurs here (via `a.x`)
|
|
||||||
let _y = &mut a.y; //~ ERROR cannot borrow
|
let _y = &mut a.y; //~ ERROR cannot borrow
|
||||||
//~^ mutable borrow occurs here (via `a.y`)
|
//~^ mutable borrow occurs here (via `a.y`)
|
||||||
}
|
}
|
||||||
//~^ NOTE immutable borrow ends here
|
|
||||||
|
|
||||||
fn copy_after_move_nested() {
|
fn copy_after_move_nested() {
|
||||||
let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
|
let a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
|
||||||
let _x = a.x.x;
|
let _x = a.x.x;
|
||||||
//~^ value moved here
|
//~^ value moved here
|
||||||
let _y = a.y; //~ ERROR use of collaterally moved
|
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
|
//~| value used here after move
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +106,6 @@ fn move_after_move_nested() {
|
||||||
let _x = a.x.x;
|
let _x = a.x.x;
|
||||||
//~^ value moved here
|
//~^ value moved here
|
||||||
let _y = a.y; //~ ERROR use of collaterally moved
|
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
|
//~| value used here after move
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +114,6 @@ fn borrow_after_move_nested() {
|
||||||
let _x = a.x.x;
|
let _x = a.x.x;
|
||||||
//~^ value moved here
|
//~^ value moved here
|
||||||
let _y = &a.y; //~ ERROR use of collaterally moved
|
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
|
//~| value used here after move
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,15 +129,12 @@ fn move_after_borrow_nested() {
|
||||||
fn copy_after_mut_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 mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
|
||||||
let _x = &mut a.x.x;
|
let _x = &mut a.x.x;
|
||||||
//~^ NOTE borrow of `a.x.x` occurs here
|
|
||||||
let _y = a.y; //~ ERROR cannot use
|
let _y = a.y; //~ ERROR cannot use
|
||||||
//~^ NOTE use of borrowed `a.x.x`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_after_mut_borrow_nested() {
|
fn move_after_mut_borrow_nested() {
|
||||||
let mut a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
|
let mut a: Box<_> = box D { x: box A { x: box 0, y: 1 }, y: box 2 };
|
||||||
let _x = &mut a.x.x;
|
let _x = &mut a.x.x;
|
||||||
//~^ NOTE borrow of `a.x.x` occurs here
|
|
||||||
let _y = a.y;
|
let _y = a.y;
|
||||||
//~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
//~| move out of
|
//~| move out of
|
||||||
|
@ -161,7 +147,6 @@ fn borrow_after_mut_borrow_nested() {
|
||||||
let _y = &a.y; //~ ERROR cannot borrow
|
let _y = &a.y; //~ ERROR cannot borrow
|
||||||
//~^ immutable borrow occurs here
|
//~^ immutable borrow occurs here
|
||||||
}
|
}
|
||||||
//~^ NOTE mutable borrow ends here
|
|
||||||
|
|
||||||
fn mut_borrow_after_borrow_nested() {
|
fn mut_borrow_after_borrow_nested() {
|
||||||
let mut a: Box<_> = box C { x: box A { x: box 0, y: 1 }, y: 2 };
|
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
|
let _y = &mut a.y; //~ ERROR cannot borrow
|
||||||
//~^ mutable borrow occurs here
|
//~^ mutable borrow occurs here
|
||||||
}
|
}
|
||||||
//~^ NOTE immutable borrow ends here
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
copy_after_move();
|
copy_after_move();
|
||||||
|
|
|
@ -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
|
= 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
|
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;
|
62 | let _x = &a.x;
|
||||||
| --- borrow of `a.x` occurs here
|
| --- borrow of `a.x` occurs here
|
||||||
63 | //~^ NOTE borrow of `a.x` occurs here
|
63 | let _y = a.y;
|
||||||
64 | let _y = a.y;
|
|
||||||
| ^^ move out of `a.y` occurs here
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
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
|
| --- borrow of `a.x` occurs here
|
||||||
72 | //~^ NOTE borrow of `a.x` occurs here
|
71 | let _y = a.y; //~ ERROR cannot use
|
||||||
73 | let _y = a.y; //~ ERROR cannot use
|
|
||||||
| ^^ use of borrowed `a.x`
|
| ^^ use of borrowed `a.x`
|
||||||
|
|
||||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
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
|
| --- borrow of `a.x` occurs here
|
||||||
80 | //~^ NOTE borrow of `a.x` occurs here
|
77 | let _y = a.y;
|
||||||
81 | let _y = a.y;
|
|
||||||
| ^^ move out of `a.y` occurs here
|
| ^^ 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`)
|
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`)
|
| --- mutable borrow occurs here (via `a.x`)
|
||||||
89 | //~^ NOTE mutable borrow occurs here (via `a.x`)
|
85 | let _y = &a.y; //~ ERROR cannot borrow
|
||||||
90 | let _y = &a.y; //~ ERROR cannot borrow
|
|
||||||
| ^^^ immutable borrow occurs here (via `a.y`)
|
| ^^^ immutable borrow occurs here (via `a.y`)
|
||||||
91 | //~^ immutable borrow occurs here (via `a.y`)
|
86 | //~^ immutable borrow occurs here (via `a.y`)
|
||||||
92 | }
|
87 | }
|
||||||
| - mutable borrow ends here
|
| - mutable borrow ends here
|
||||||
|
|
||||||
error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`)
|
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;
|
98 | let _x = a.x.x;
|
||||||
| --- immutable borrow occurs here (via `a.x`)
|
| -- value moved here
|
||||||
98 | //~^ NOTE immutable borrow occurs here (via `a.x`)
|
99 | //~^ value moved here
|
||||||
99 | let _y = &mut a.y; //~ ERROR cannot borrow
|
100 | let _y = a.y; //~ ERROR use of collaterally moved
|
||||||
| ^^^ mutable borrow occurs here (via `a.y`)
|
| ^^ value used here after move
|
||||||
100 | //~^ mutable borrow occurs here (via `a.y`)
|
|
|
||||||
101 | }
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
| - immutable borrow ends here
|
|
||||||
|
|
||||||
error[E0382]: use of collaterally moved value: `a.y`
|
error[E0382]: use of collaterally moved value: `a.y`
|
||||||
--> $DIR/borrowck-box-insensitivity.rs:108:9
|
--> $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
|
= 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`
|
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
|
| -- value moved here
|
||||||
116 | //~^ value moved here
|
115 | //~^ value moved here
|
||||||
117 | let _y = a.y; //~ ERROR use of collaterally moved
|
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[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
|
|
||||||
| ^^^ value used here after move
|
| ^^^ 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
|
= 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
|
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
|
| ----- borrow of `a.x.x` occurs here
|
||||||
134 | //~^ borrow of `a.x.x` occurs here
|
123 | //~^ borrow of `a.x.x` occurs here
|
||||||
135 | let _y = a.y;
|
124 | let _y = a.y;
|
||||||
| ^^ move out of `a.y` occurs here
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
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
|
| ----- borrow of `a.x.x` occurs here
|
||||||
143 | //~^ NOTE borrow of `a.x.x` occurs here
|
132 | let _y = a.y; //~ ERROR cannot use
|
||||||
144 | let _y = a.y; //~ ERROR cannot use
|
|
||||||
| ^^ use of borrowed `a.x.x`
|
| ^^ use of borrowed `a.x.x`
|
||||||
|
|
||||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
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
|
| ----- borrow of `a.x.x` occurs here
|
||||||
151 | //~^ NOTE borrow of `a.x.x` occurs here
|
138 | let _y = a.y;
|
||||||
152 | let _y = a.y;
|
|
||||||
| ^^ move out of `a.y` occurs here
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable
|
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
|
| ----- mutable borrow occurs here
|
||||||
160 | //~^ mutable borrow occurs here
|
146 | //~^ mutable borrow occurs here
|
||||||
161 | let _y = &a.y; //~ ERROR cannot borrow
|
147 | let _y = &a.y; //~ ERROR cannot borrow
|
||||||
| ^^^ immutable borrow occurs here
|
| ^^^ immutable borrow occurs here
|
||||||
162 | //~^ immutable borrow occurs here
|
148 | //~^ immutable borrow occurs here
|
||||||
163 | }
|
149 | }
|
||||||
| - mutable borrow ends here
|
| - mutable borrow ends here
|
||||||
|
|
||||||
error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable
|
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
|
| ----- immutable borrow occurs here
|
||||||
169 | //~^ immutable borrow occurs here
|
154 | //~^ immutable borrow occurs here
|
||||||
170 | let _y = &mut a.y; //~ ERROR cannot borrow
|
155 | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||||
| ^^^ mutable borrow occurs here
|
| ^^^ mutable borrow occurs here
|
||||||
171 | //~^ mutable borrow occurs here
|
156 | //~^ mutable borrow occurs here
|
||||||
172 | }
|
157 | }
|
||||||
| - immutable borrow ends here
|
| - immutable borrow ends here
|
||||||
|
|
||||||
error: aborting due to 16 previous errors
|
error: aborting due to 16 previous errors
|
||||||
|
|
|
@ -22,6 +22,4 @@ fn main() {
|
||||||
let mut books = vec![1,2,3];
|
let mut books = vec![1,2,3];
|
||||||
spawn(|| books.push(4));
|
spawn(|| books.push(4));
|
||||||
//~^ ERROR E0373
|
//~^ ERROR E0373
|
||||||
//~| NOTE `books` is borrowed here
|
|
||||||
//~| NOTE may outlive borrowed value `books`
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@ fn foo<'a>(x: &'a i32) -> Box<FnMut()+'a> {
|
||||||
let mut books = vec![1,2,3];
|
let mut books = vec![1,2,3];
|
||||||
Box::new(|| books.push(4))
|
Box::new(|| books.push(4))
|
||||||
//~^ ERROR E0373
|
//~^ ERROR E0373
|
||||||
//~| NOTE `books` is borrowed here
|
|
||||||
//~| NOTE may outlive borrowed value `books`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -11,9 +11,8 @@
|
||||||
// check that borrowck looks inside consts/statics
|
// check that borrowck looks inside consts/statics
|
||||||
|
|
||||||
static FN : &'static (Fn() -> (Box<Fn()->Box<i32>>) + Sync) = &|| {
|
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
|
Box::new(|| x) //~ ERROR cannot move out of captured outer variable
|
||||||
//~^ NOTE cannot move out of captured outer variable
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
||||||
--> $DIR/borrowck-in-static.rs:15:17
|
--> $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
|
| - captured outer variable
|
||||||
15 | Box::new(|| x) //~ ERROR cannot move out of 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
|
| ^ cannot move out of captured outer variable in an `Fn` closure
|
||||||
|
|
|
@ -20,9 +20,9 @@ fn blah() {
|
||||||
let f = &Foo::Foo1(box 1, box 2);
|
let f = &Foo::Foo1(box 1, box 2);
|
||||||
match *f { //~ ERROR cannot move out of
|
match *f { //~ ERROR cannot move out of
|
||||||
//~| cannot move out
|
//~| cannot move out
|
||||||
Foo::Foo1(num1, //~ NOTE to prevent move
|
Foo::Foo1(num1,
|
||||||
num2) => (), //~ NOTE and here
|
num2) => (),
|
||||||
Foo::Foo2(num) => (), //~ NOTE and here
|
Foo::Foo2(num) => (),
|
||||||
Foo::Foo3 => ()
|
Foo::Foo3 => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ fn move_in_match() {
|
||||||
match (S {f: "foo".to_string(), g: "bar".to_string()}) {
|
match (S {f: "foo".to_string(), g: "bar".to_string()}) {
|
||||||
S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
||||||
//~| cannot move out of here
|
//~| cannot move out of here
|
||||||
f: _s, //~ NOTE to prevent move
|
f: _s,
|
||||||
g: _t //~ NOTE and here
|
g: _t
|
||||||
} => {}
|
} => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ fn blah2() {
|
||||||
let a = &A { a: box 1 };
|
let a = &A { a: box 1 };
|
||||||
match a.a { //~ ERROR cannot move out of
|
match a.a { //~ ERROR cannot move out of
|
||||||
//~| cannot move out
|
//~| cannot move out
|
||||||
n => { //~ NOTE to prevent move
|
n => {
|
||||||
free(n)
|
free(n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@ error[E0507]: cannot move out of borrowed content
|
||||||
21 | match *f { //~ ERROR cannot move out of
|
21 | match *f { //~ ERROR cannot move out of
|
||||||
| ^^ cannot move out of borrowed content
|
| ^^ cannot move out of borrowed content
|
||||||
22 | //~| cannot move out
|
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`
|
| ---- 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`)
|
| ---- ...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`)
|
| --- ...and here (use `ref num` or `ref mut num`)
|
||||||
|
|
||||||
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
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
|
40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
||||||
41 | | //~| cannot move out of here
|
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`
|
| | -- 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`)
|
| | -- ...and here (use `ref _t` or `ref mut _t`)
|
||||||
44 | | } => {}
|
44 | | } => {}
|
||||||
| |_________^ cannot move out of here
|
| |_________^ 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
|
57 | match a.a { //~ ERROR cannot move out of
|
||||||
| ^ cannot move out of borrowed content
|
| ^ cannot move out of borrowed content
|
||||||
58 | //~| cannot move out
|
58 | //~| cannot move out
|
||||||
59 | n => { //~ NOTE to prevent move
|
59 | n => {
|
||||||
| - hint: to prevent move, use `ref n` or `ref mut n`
|
| - hint: to prevent move, use `ref n` or `ref mut n`
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
|
@ -32,7 +32,6 @@ pub fn main() {
|
||||||
//~| cannot move out
|
//~| cannot move out
|
||||||
//~| to prevent move
|
//~| to prevent move
|
||||||
Foo { string: b }] => {
|
Foo { string: b }] => {
|
||||||
//~^ NOTE and here
|
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
unreachable!();
|
unreachable!();
|
||||||
|
|
|
@ -17,7 +17,6 @@ fn main() {
|
||||||
let z = &x; //~ ERROR cannot borrow
|
let z = &x; //~ ERROR cannot borrow
|
||||||
//~^ immutable borrow occurs here
|
//~^ immutable borrow occurs here
|
||||||
}
|
}
|
||||||
//~^ NOTE mutable borrow ends here
|
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
match true {
|
match true {
|
||||||
|
@ -29,7 +28,6 @@ fn foo() {
|
||||||
let z = &mut x; //~ ERROR cannot borrow
|
let z = &mut x; //~ ERROR cannot borrow
|
||||||
//~^ mutable borrow occurs here
|
//~^ mutable borrow occurs here
|
||||||
}
|
}
|
||||||
//~^ NOTE immutable borrow ends here
|
|
||||||
false => ()
|
false => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,5 +41,4 @@ fn bar() {
|
||||||
let z = &mut x; //~ ERROR cannot borrow
|
let z = &mut x; //~ ERROR cannot borrow
|
||||||
//~^ second mutable borrow occurs here
|
//~^ second mutable borrow occurs here
|
||||||
};
|
};
|
||||||
//~^ NOTE first borrow ends here
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,27 +11,27 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
|
||||||
| - mutable borrow ends here
|
| - mutable borrow ends here
|
||||||
|
|
||||||
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
|
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
|
| - immutable borrow occurs here
|
||||||
28 | //~^ immutable borrow occurs here
|
27 | //~^ immutable borrow occurs here
|
||||||
29 | let z = &mut x; //~ ERROR cannot borrow
|
28 | let z = &mut x; //~ ERROR cannot borrow
|
||||||
| ^ mutable borrow occurs here
|
| ^ mutable borrow occurs here
|
||||||
30 | //~^ mutable borrow occurs here
|
29 | //~^ mutable borrow occurs here
|
||||||
31 | }
|
30 | }
|
||||||
| - immutable borrow ends here
|
| - immutable borrow ends here
|
||||||
|
|
||||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
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
|
| - first mutable borrow occurs here
|
||||||
42 | //~^ first mutable borrow occurs here
|
40 | //~^ first mutable borrow occurs here
|
||||||
43 | let z = &mut x; //~ ERROR cannot borrow
|
41 | let z = &mut x; //~ ERROR cannot borrow
|
||||||
| ^ second mutable borrow occurs here
|
| ^ second mutable borrow occurs here
|
||||||
44 | //~^ second mutable borrow occurs here
|
42 | //~^ second mutable borrow occurs here
|
||||||
45 | };
|
43 | };
|
||||||
| - first borrow ends here
|
| - first borrow ends here
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
|
@ -63,7 +63,7 @@ fn d() {
|
||||||
match vec {
|
match vec {
|
||||||
&mut [ //~ ERROR cannot move out
|
&mut [ //~ ERROR cannot move out
|
||||||
//~^ cannot move out
|
//~^ cannot move out
|
||||||
_b] => {} //~ NOTE to prevent move
|
_b] => {}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
let a = vec[0]; //~ ERROR cannot move out
|
let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
@ -76,9 +76,6 @@ fn e() {
|
||||||
match vec {
|
match vec {
|
||||||
&mut [_a, _b, _c] => {} //~ ERROR cannot move out
|
&mut [_a, _b, _c] => {} //~ ERROR cannot move out
|
||||||
//~| cannot move out
|
//~| cannot move out
|
||||||
//~| NOTE to prevent move
|
|
||||||
//~| NOTE and here
|
|
||||||
//~| NOTE and here
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
let a = vec[0]; //~ ERROR cannot move out
|
let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
|
|
@ -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
|
64 | &mut [ //~ ERROR cannot move out
|
||||||
| ______________^
|
| ______________^
|
||||||
65 | | //~^ cannot move out
|
65 | | //~^ cannot move out
|
||||||
66 | | _b] => {} //~ NOTE to prevent move
|
66 | | _b] => {}
|
||||||
| |__________--^ cannot move out of here
|
| |__________--^ cannot move out of here
|
||||||
| |
|
| |
|
||||||
| hint: to prevent move, use `ref _b` or `ref mut _b`
|
| 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
|
| cannot move out of here
|
||||||
|
|
||||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
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
|
| cannot move out of here
|
||||||
|
|
|
@ -16,10 +16,9 @@ fn call<F>(f: F) where F : Fn() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let y = vec![format!("World")]; //~ NOTE captured outer variable
|
let y = vec![format!("World")];
|
||||||
call(|| {
|
call(|| {
|
||||||
y.into_iter();
|
y.into_iter();
|
||||||
//~^ ERROR cannot move out of captured outer variable in an `Fn` closure
|
//~^ ERROR cannot move out of captured outer variable in an `Fn` closure
|
||||||
//~| NOTE cannot move out of
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
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
|
--> $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
|
| - captured outer variable
|
||||||
20 | call(|| {
|
20 | call(|| {
|
||||||
21 | y.into_iter();
|
21 | y.into_iter();
|
||||||
|
|
|
@ -11,5 +11,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let u = 5 as bool;
|
let u = 5 as bool;
|
||||||
//~^ ERROR cannot cast as `bool`
|
//~^ ERROR cannot cast as `bool`
|
||||||
//~| HELP compare with zero instead
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let _ = 3 as bool;
|
let _ = 3 as bool;
|
||||||
//~^ ERROR cannot cast as `bool`
|
//~^ ERROR cannot cast as `bool`
|
||||||
//~| HELP compare with zero
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,5 @@
|
||||||
|
|
||||||
extern crate a;
|
extern crate a;
|
||||||
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
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() {}
|
fn main() {}
|
||||||
|
|
|
@ -14,13 +14,10 @@ fn main() {
|
||||||
let dict: HashMap<i32, i32> = HashMap::new();
|
let dict: HashMap<i32, i32> = HashMap::new();
|
||||||
let debug_dump_dict = || {
|
let debug_dump_dict = || {
|
||||||
for (key, value) in dict {
|
for (key, value) in dict {
|
||||||
//~^ NOTE closure cannot be invoked more than once
|
|
||||||
println!("{:?} - {:?}", key, value);
|
println!("{:?} - {:?}", key, value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
debug_dump_dict();
|
debug_dump_dict();
|
||||||
//~^ NOTE: value moved here
|
|
||||||
debug_dump_dict();
|
debug_dump_dict();
|
||||||
//~^ ERROR use of moved value: `debug_dump_dict`
|
//~^ ERROR use of moved value: `debug_dump_dict`
|
||||||
//~| NOTE value used here after move
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
error[E0382]: use of moved value: `debug_dump_dict`
|
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
|
| --------------- value moved here
|
||||||
22 | //~^ NOTE: value moved here
|
21 | debug_dump_dict();
|
||||||
23 | debug_dump_dict();
|
|
||||||
| ^^^^^^^^^^^^^^^ value used here after move
|
| ^^^^^^^^^^^^^^^ value used here after move
|
||||||
|
|
|
|
||||||
note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
|
note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
|
||||||
|
|
|
@ -28,36 +28,22 @@ impl Copy for MyType {}
|
||||||
|
|
||||||
impl Copy for &'static mut MyType {}
|
impl Copy for &'static mut MyType {}
|
||||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
//~^ 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 Clone for MyType { fn clone(&self) -> Self { *self } }
|
||||||
|
|
||||||
impl Copy for (MyType, MyType) {}
|
impl Copy for (MyType, MyType) {}
|
||||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
//~^ 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
|
//~| 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 {}
|
impl Copy for &'static NotSync {}
|
||||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
//~^ ERROR the trait `Copy` may not be implemented for this type
|
||||||
//~| NOTE type is not a structure or enumeration
|
|
||||||
|
|
||||||
impl Copy for [MyType] {}
|
impl Copy for [MyType] {}
|
||||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
//~^ 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
|
//~| 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] {}
|
impl Copy for &'static [NotSync] {}
|
||||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
//~^ 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
|
//~| 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() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,51 +5,51 @@ error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
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
|
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
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
|
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
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
|
| ^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
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
|
| ^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
|
||||||
= note: the impl does not reference any types defined in this crate
|
= note: the impl does not reference any types defined in this crate
|
||||||
= note: define and implement a trait or new type instead
|
= 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
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
|
||||||
= note: the impl does not reference any types defined in this crate
|
= note: the impl does not reference any types defined in this crate
|
||||||
= note: define and implement a trait or new type instead
|
= 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
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
|
||||||
= note: the impl does not reference any types defined in this crate
|
= note: the impl does not reference any types defined in this crate
|
||||||
|
|
|
@ -16,17 +16,12 @@ pub trait Sugar {}
|
||||||
pub trait Fruit {}
|
pub trait Fruit {}
|
||||||
impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||||
//~^ ERROR E0592
|
//~^ ERROR E0592
|
||||||
//~| NOTE duplicate definitions for `dummy`
|
|
||||||
impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||||
//~^ NOTE other definition for `dummy`
|
|
||||||
|
|
||||||
trait Bar<X> {}
|
trait Bar<X> {}
|
||||||
struct A<T, X>(T, X);
|
struct A<T, X>(T, X);
|
||||||
impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
||||||
//~^ ERROR E0592
|
//~^ 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) {} }
|
impl<X> A<i32, X> { fn f(&self) {} }
|
||||||
//~^ NOTE other definition for `f`
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -3,17 +3,17 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
|
|
|
||||||
17 | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
17 | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
...
|
18 | //~^ ERROR E0592
|
||||||
20 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
19 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||||
| ------------------- other definition for `dummy`
|
| ------------------- other definition for `dummy`
|
||||||
|
|
||||||
error[E0592]: duplicate definitions with name `f`
|
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`
|
| ^^^^^^^^^^^^^^ duplicate definitions for `f`
|
||||||
...
|
24 | //~^ ERROR E0592
|
||||||
29 | impl<X> A<i32, X> { fn f(&self) {} }
|
25 | impl<X> A<i32, X> { fn f(&self) {} }
|
||||||
| -------------- other definition for `f`
|
| -------------- other definition for `f`
|
||||||
|
|
|
|
||||||
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||||
|
|
|
@ -15,18 +15,13 @@ pub trait Sugar {}
|
||||||
pub trait Fruit {}
|
pub trait Fruit {}
|
||||||
pub trait Sweet {}
|
pub trait Sweet {}
|
||||||
impl<T:Sugar> Sweet for T { }
|
impl<T:Sugar> Sweet for T { }
|
||||||
//~^ NOTE first implementation here
|
|
||||||
impl<T:Fruit> Sweet for T { }
|
impl<T:Fruit> Sweet for T { }
|
||||||
//~^ ERROR E0119
|
//~^ ERROR E0119
|
||||||
//~| NOTE conflicting implementation
|
|
||||||
|
|
||||||
pub trait Foo<X> {}
|
pub trait Foo<X> {}
|
||||||
pub trait Bar<X> {}
|
pub trait Bar<X> {}
|
||||||
impl<X, T> Foo<X> for T where T: Bar<X> {}
|
impl<X, T> Foo<X> for T where T: Bar<X> {}
|
||||||
//~^ NOTE first implementation here
|
|
||||||
impl<X> Foo<X> for i32 {}
|
impl<X> Foo<X> for i32 {}
|
||||||
//~^ ERROR E0119
|
//~^ ERROR E0119
|
||||||
//~| NOTE conflicting implementation for `i32`
|
|
||||||
//~| NOTE downstream crates may implement trait `Bar<_>` for type `i32`
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
error[E0119]: conflicting implementations of trait `Sweet`:
|
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 { }
|
17 | impl<T:Sugar> Sweet for T { }
|
||||||
| ----------------------------- first implementation here
|
| ----------------------------- first implementation here
|
||||||
18 | //~^ NOTE first implementation here
|
18 | impl<T:Fruit> Sweet for T { }
|
||||||
19 | impl<T:Fruit> Sweet for T { }
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||||
|
|
||||||
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
|
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
|
| ------------------------------------------ first implementation here
|
||||||
26 | //~^ NOTE first implementation here
|
24 | impl<X> Foo<X> for i32 {}
|
||||||
27 | impl<X> Foo<X> for i32 {}
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
||||||
|
|
|
|
||||||
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||||
|
|
|
@ -18,9 +18,6 @@ struct Cake<X>(X);
|
||||||
|
|
||||||
impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||||
//~^ ERROR E0592
|
//~^ 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) { } }
|
impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||||
//~^ NOTE other definition for `dummy`
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -3,8 +3,8 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
|
|
|
||||||
19 | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
19 | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
...
|
20 | //~^ ERROR E0592
|
||||||
23 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
21 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||||
| ------------------- other definition for `dummy`
|
| ------------------- other definition for `dummy`
|
||||||
|
|
|
|
||||||
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||||
|
|
|
@ -15,10 +15,7 @@
|
||||||
pub trait Sugar { fn dummy(&self) { } }
|
pub trait Sugar { fn dummy(&self) { } }
|
||||||
pub trait Sweet { fn dummy(&self) { } }
|
pub trait Sweet { fn dummy(&self) { } }
|
||||||
impl<T:Sugar> Sweet for T { }
|
impl<T:Sugar> Sweet for T { }
|
||||||
//~^ NOTE first implementation here
|
|
||||||
impl<U:Sugar> Sweet for Box<U> { }
|
impl<U:Sugar> Sweet for Box<U> { }
|
||||||
//~^ ERROR E0119
|
//~^ ERROR E0119
|
||||||
//~| NOTE conflicting implementation for `std::boxed::Box<_>`
|
|
||||||
//~| NOTE downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
|
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 { }
|
17 | impl<T:Sugar> Sweet for T { }
|
||||||
| ----------------------------- first implementation here
|
| ----------------------------- first implementation here
|
||||||
18 | //~^ NOTE first implementation here
|
18 | impl<U:Sugar> Sweet for Box<U> { }
|
||||||
19 | impl<U:Sugar> Sweet for Box<U> { }
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
||||||
|
|
|
|
||||||
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||||
|
|
|
@ -20,9 +20,6 @@ use coherence_lib::Remote;
|
||||||
struct A<X>(X);
|
struct A<X>(X);
|
||||||
impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||||
//~^ ERROR E0592
|
//~^ 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) { } }
|
impl A<i16> { fn dummy(&self) { } }
|
||||||
//~^ NOTE other definition for `dummy`
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -3,8 +3,8 @@ error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
|
|
|
||||||
21 | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
21 | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
...
|
22 | //~^ ERROR E0592
|
||||||
25 | impl A<i16> { fn dummy(&self) { } }
|
23 | impl A<i16> { fn dummy(&self) { } }
|
||||||
| ------------------- other definition for `dummy`
|
| ------------------- other definition for `dummy`
|
||||||
|
|
|
|
||||||
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
||||||
|
|
|
@ -19,10 +19,7 @@ use coherence_lib::Remote;
|
||||||
|
|
||||||
trait Foo {}
|
trait Foo {}
|
||||||
impl<T> Foo for T where T: Remote {}
|
impl<T> Foo for T where T: Remote {}
|
||||||
//~^ NOTE first implementation here
|
|
||||||
impl Foo for i16 {}
|
impl Foo for i16 {}
|
||||||
//~^ ERROR E0119
|
//~^ ERROR E0119
|
||||||
//~| NOTE conflicting implementation for `i16`
|
|
||||||
//~| NOTE upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16`
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
|
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 {}
|
21 | impl<T> Foo for T where T: Remote {}
|
||||||
| ------------------------------------ first implementation here
|
| ------------------------------------ first implementation here
|
||||||
22 | //~^ NOTE first implementation here
|
22 | impl Foo for i16 {}
|
||||||
23 | impl Foo for i16 {}
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
|
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
|
||||||
|
|
|
|
||||||
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
||||||
|
|
|
@ -12,6 +12,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
|
static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
|
||||||
//~| NOTE dereference of raw pointer in constant
|
|
||||||
println!("{}", C);
|
println!("{}", C);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ const NEG_NEG_128: i8 = -NEG_128;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match -128i8 {
|
match -128i8 {
|
||||||
NEG_NEG_128 => println!("A"), //~ NOTE for pattern here
|
NEG_NEG_128 => println!("A"),
|
||||||
_ => println!("B"),
|
_ => println!("B"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
|
||||||
note: for pattern here
|
note: for pattern here
|
||||||
--> $DIR/const-eval-overflow-2.rs:27:9
|
--> $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
|
error: aborting due to previous error
|
||||||
|
|
|
@ -22,9 +22,7 @@ use std::{u8, u16, u32, u64, usize};
|
||||||
const A_I8_T
|
const A_I8_T
|
||||||
: [u32; (i8::MAX as i8 + 1i8) as usize]
|
: [u32; (i8::MAX as i8 + 1i8) as usize]
|
||||||
//~^ ERROR constant evaluation error
|
//~^ ERROR constant evaluation error
|
||||||
//~^^ NOTE attempt to add with overflow
|
|
||||||
//~| WARNING constant evaluation error
|
//~| WARNING constant evaluation error
|
||||||
//~| NOTE on by default
|
|
||||||
= [0; (i8::MAX as usize) + 1];
|
= [0; (i8::MAX as usize) + 1];
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -34,4 +32,3 @@ fn main() {
|
||||||
fn foo<T:fmt::Debug>(x: T) {
|
fn foo<T:fmt::Debug>(x: T) {
|
||||||
println!("{:?}", x);
|
println!("{:?}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ enum E {
|
||||||
V = CONSTANT,
|
V = CONSTANT,
|
||||||
//~^ ERROR mismatched types
|
//~^ ERROR mismatched types
|
||||||
//~| expected isize, found struct `S`
|
//~| expected isize, found struct `S`
|
||||||
//~| NOTE expected type `isize`
|
|
||||||
//~| found type `S`
|
//~| found type `S`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ const fn f(x: usize) -> usize {
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn main() {
|
fn main() {
|
||||||
let a : [i32; f(X)]; //~ NOTE for constant expression here
|
let a : [i32; f(X)];
|
||||||
//~| WARNING constant evaluation error: non-constant path
|
//~^ WARNING constant evaluation error: non-constant path
|
||||||
//~| on by default
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
|
||||||
note: for constant expression here
|
note: for constant expression here
|
||||||
--> $DIR/const-fn-error.rs:26:13
|
--> $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
|
error: aborting due to previous error
|
||||||
|
|
|
@ -22,7 +22,6 @@ trait Foo {
|
||||||
impl Foo for u32 {
|
impl Foo for u32 {
|
||||||
const fn f() -> u32 { 22 }
|
const fn f() -> u32 { 22 }
|
||||||
//~^ ERROR trait fns cannot be declared const
|
//~^ ERROR trait fns cannot be declared const
|
||||||
//~| NOTE trait fns cannot be const
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -16,10 +16,8 @@
|
||||||
trait Foo {
|
trait Foo {
|
||||||
const fn f() -> u32;
|
const fn f() -> u32;
|
||||||
//~^ ERROR trait fns cannot be declared const
|
//~^ ERROR trait fns cannot be declared const
|
||||||
//~| NOTE trait fns cannot be const
|
|
||||||
const fn g() -> u32 { 0 }
|
const fn g() -> u32 { 0 }
|
||||||
//~^ ERROR trait fns cannot be declared const
|
//~^ ERROR trait fns cannot be declared const
|
||||||
//~| NOTE trait fns cannot be const
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -5,9 +5,9 @@ error[E0379]: trait fns cannot be declared const
|
||||||
| ^^^^^ trait fns cannot be const
|
| ^^^^^ trait fns cannot be const
|
||||||
|
|
||||||
error[E0379]: trait fns cannot be declared 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
|
| ^^^^^ trait fns cannot be const
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
|
@ -22,5 +22,4 @@ const LEN: usize = ONE - TWO;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let a: [i8; LEN] = unimplemented!();
|
let a: [i8; LEN] = unimplemented!();
|
||||||
//~^ NOTE for constant expression here
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ const GOO: Cake = foo();
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match BlackForest {
|
match BlackForest {
|
||||||
FOO => println!("hi"), //~ NOTE: for pattern here
|
FOO => println!("hi"),
|
||||||
GOO => println!("meh"),
|
GOO => println!("meh"),
|
||||||
WORKS => println!("möp"),
|
WORKS => println!("möp"),
|
||||||
_ => println!("bye"),
|
_ => println!("bye"),
|
||||||
|
|
|
@ -7,7 +7,7 @@ error[E0080]: constant evaluation error
|
||||||
note: for pattern here
|
note: for pattern here
|
||||||
--> $DIR/const-pattern-not-const-evaluable.rs:37:9
|
--> $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
|
error: aborting due to previous error
|
||||||
|
|
|
@ -12,23 +12,15 @@ use std::fmt::Debug;
|
||||||
|
|
||||||
const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
|
const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
|
||||||
//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
|
//~^ 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";
|
const CONST_FOO: str = *"foo";
|
||||||
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
//~^ 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));
|
static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
|
||||||
//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
|
//~^ 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";
|
static STATIC_BAR: str = *"bar";
|
||||||
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
//~^ 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() {
|
fn main() {
|
||||||
println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
|
println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
|
||||||
|
|
|
@ -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
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
|
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
|
| ^^^^^^ `str` does not have a constant size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: constant expressions must have a statically known size
|
= 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
|
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
|
| ^^^^^^^^^^^^^^^^^^^^^^ `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`
|
= 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
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
|
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
|
| ^^^^^^ `str` does not have a constant size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
|
|
|
@ -12,16 +12,13 @@
|
||||||
// a direct participant in the cycle.
|
// a direct participant in the cycle.
|
||||||
|
|
||||||
trait A: B {
|
trait A: B {
|
||||||
//~^ NOTE the cycle begins when computing the supertraits of `B`...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait B: C {
|
trait B: C {
|
||||||
//~^ NOTE ...which then requires computing the supertraits of `C`...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait C: B { }
|
trait C: B { }
|
||||||
//~^ ERROR unsupported cyclic reference
|
//~^ ERROR unsupported cyclic reference
|
||||||
//~| cyclic reference
|
//~| cyclic reference
|
||||||
//~| NOTE ...which then again requires computing the supertraits of `B`, completing the cycle
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0391]: unsupported cyclic reference between types/traits detected
|
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
|
| ^^^^^^^^^^ cyclic reference
|
||||||
|
|
|
|
||||||
note: the cycle begins when computing the supertraits of `B`...
|
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 {
|
14 | trait A: B {
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
note: ...which then requires computing the supertraits of `C`...
|
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.
|
= note: ...which then again requires computing the supertraits of `B`, completing the cycle.
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
#![macro_escape] //~ WARNING macro_escape is a deprecated synonym for macro_use
|
#![macro_escape] //~ WARNING macro_escape is a deprecated synonym for macro_use
|
||||||
//~^ HELP consider an outer attribute
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -29,7 +29,6 @@ fn main() {
|
||||||
|
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
//~^ ERROR E0433
|
//~^ ERROR E0433
|
||||||
//~| NOTE Use of undeclared type or module `HashMap`
|
|
||||||
|
|
||||||
for line in input.lines() {
|
for line in input.lines() {
|
||||||
let line = line.unwrap();
|
let line = line.unwrap();
|
||||||
|
|
|
@ -25,8 +25,6 @@ fn f_i8() {
|
||||||
Ok = i8::MAX - 1,
|
Ok = i8::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = u8::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = i16::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = u16::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = i32::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = u32::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = i64::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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,
|
Ok = u64::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| NOTE overflowed on value after 18446744073709551615u64
|
|
||||||
//~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,60 +7,60 @@ error[E0370]: enum discriminant overflowed
|
||||||
= note: explicitly set `OhNo = -128i8` if that is desired outcome
|
= note: explicitly set `OhNo = -128i8` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 255u8
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u8` if that is desired outcome
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 32767i16
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 65535u16
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u16` if that is desired outcome
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 2147483647i32
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 4294967295u32
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u32` if that is desired outcome
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 9223372036854775807i64
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
error[E0370]: enum discriminant overflowed
|
||||||
--> $DIR/discrim-overflow-2.rs:104:9
|
--> $DIR/discrim-overflow-2.rs:90:9
|
||||||
|
|
|
|
||||||
104 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
90 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
| ^^^^ overflowed on value after 18446744073709551615u64
|
| ^^^^ overflowed on value after 18446744073709551615u64
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u64` if that is desired outcome
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
|
||||||
|
|
||||||
error: aborting due to 8 previous errors
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,6 @@ fn f_i8() {
|
||||||
Ok = i8::MAX - 1,
|
Ok = i8::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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;
|
let x = A::Ok;
|
||||||
|
@ -36,8 +34,6 @@ fn f_u8() {
|
||||||
Ok = u8::MAX - 1,
|
Ok = u8::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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;
|
let x = A::Ok;
|
||||||
|
@ -49,8 +45,6 @@ fn f_i16() {
|
||||||
Ok = i16::MAX - 1,
|
Ok = i16::MAX - 1,
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
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;
|
let x = A::Ok;
|
||||||
|
@ -63,7 +57,6 @@ fn f_u16() {
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| overflowed on value after 65535u16
|
//~| overflowed on value after 65535u16
|
||||||
//~| NOTE explicitly set `OhNo = 0u16` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = A::Ok;
|
let x = A::Ok;
|
||||||
|
@ -76,7 +69,6 @@ fn f_i32() {
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| overflowed on value after 2147483647i32
|
//~| overflowed on value after 2147483647i32
|
||||||
//~| NOTE explicitly set `OhNo = -2147483648i32` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = A::Ok;
|
let x = A::Ok;
|
||||||
|
@ -89,7 +81,6 @@ fn f_u32() {
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| overflowed on value after 4294967295u32
|
//~| overflowed on value after 4294967295u32
|
||||||
//~| NOTE explicitly set `OhNo = 0u32` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = A::Ok;
|
let x = A::Ok;
|
||||||
|
@ -102,7 +93,6 @@ fn f_i64() {
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| overflowed on value after 9223372036854775807i64
|
//~| overflowed on value after 9223372036854775807i64
|
||||||
//~| NOTE explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = A::Ok;
|
let x = A::Ok;
|
||||||
|
@ -115,7 +105,6 @@ fn f_u64() {
|
||||||
Ok2,
|
Ok2,
|
||||||
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
//~| overflowed on value after 18446744073709551615u64
|
//~| overflowed on value after 18446744073709551615u64
|
||||||
//~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = A::Ok;
|
let x = A::Ok;
|
||||||
|
|
|
@ -7,57 +7,57 @@ error[E0370]: enum discriminant overflowed
|
||||||
= note: explicitly set `OhNo = -128i8` if that is desired outcome
|
= note: explicitly set `OhNo = -128i8` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 255u8
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u8` if that is desired outcome
|
= note: explicitly set `OhNo = 0u8` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 32767i16
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
|
= note: explicitly set `OhNo = -32768i16` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 65535u16
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u16` if that is desired outcome
|
= note: explicitly set `OhNo = 0u16` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 2147483647i32
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
|
= note: explicitly set `OhNo = -2147483648i32` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 4294967295u32
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u32` if that is desired outcome
|
= note: explicitly set `OhNo = 0u32` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
error[E0370]: enum discriminant overflowed
|
||||||
--> $DIR/discrim-overflow.rs:103:9
|
--> $DIR/discrim-overflow.rs:94:9
|
||||||
|
|
|
|
||||||
103 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
94 | OhNo, //~ ERROR enum discriminant overflowed [E0370]
|
||||||
| ^^^^ overflowed on value after 9223372036854775807i64
|
| ^^^^ overflowed on value after 9223372036854775807i64
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
|
= note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
|
||||||
|
|
||||||
error[E0370]: enum discriminant overflowed
|
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
|
| ^^^^ overflowed on value after 18446744073709551615u64
|
||||||
|
|
|
|
||||||
= note: explicitly set `OhNo = 0u64` if that is desired outcome
|
= note: explicitly set `OhNo = 0u64` if that is desired outcome
|
||||||
|
|
|
@ -19,9 +19,7 @@ mod sub2 {
|
||||||
pub fn foo() {} // implementation 2
|
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
|
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() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
error[E0252]: the name `foo` is defined multiple times
|
error[E0252]: the name `foo` is defined multiple times
|
||||||
--> $DIR/double-import.rs:23:5
|
--> $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
|
| --------- previous import of the value `foo` here
|
||||||
23 | use sub2::foo; //~ ERROR the name `foo` is defined multiple times
|
23 | use sub2::foo; //~ ERROR the name `foo` is defined multiple times
|
||||||
| ^^^^^^^^^ `foo` reimported here
|
| ^^^^^^^^^ `foo` reimported here
|
||||||
|
|
|
@ -10,10 +10,9 @@
|
||||||
|
|
||||||
#![feature(use_extern_macros)]
|
#![feature(use_extern_macros)]
|
||||||
|
|
||||||
pub use std::panic; //~ NOTE previous macro export here
|
pub use std::panic;
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! panic { () => {} } //~ ERROR a macro named `panic` has already been exported
|
macro_rules! panic { () => {} } //~ ERROR a macro named `panic` has already been exported
|
||||||
//~| NOTE `panic` already exported
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -7,7 +7,7 @@ error: a macro named `panic` has already been exported
|
||||||
note: previous macro export here
|
note: previous macro export here
|
||||||
--> $DIR/duplicate-check-macro-exports.rs:13:9
|
--> $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
|
error: aborting due to previous error
|
||||||
|
|
|
@ -25,9 +25,7 @@ fn main() {
|
||||||
let e2 = Empty2(); //~ ERROR expected function, found `Empty2`
|
let e2 = Empty2(); //~ ERROR expected function, found `Empty2`
|
||||||
let e4 = E::Empty4();
|
let e4 = E::Empty4();
|
||||||
//~^ ERROR expected function, found `E::Empty4` [E0618]
|
//~^ 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 xe2 = XEmpty2(); //~ ERROR expected function, found `empty_struct::XEmpty2`
|
||||||
let xe4 = XE::XEmpty4();
|
let xe4 = XE::XEmpty4();
|
||||||
//~^ ERROR expected function, found `XE::XEmpty4` [E0618]
|
//~^ ERROR expected function, found `XE::XEmpty4` [E0618]
|
||||||
//~| HELP did you mean to write `XE::XEmpty4`?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,15 +24,15 @@ note: defined here
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
||||||
error[E0618]: expected function, found `empty_struct::XEmpty2`
|
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`
|
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`?
|
= help: did you mean to write `XE::XEmpty4`?
|
||||||
|
|
|
@ -8,13 +8,11 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
enum Foo { //~ NOTE previous definition of the type `Foo` here
|
enum Foo {
|
||||||
X
|
X
|
||||||
}
|
}
|
||||||
|
|
||||||
mod Foo { //~ ERROR the name `Foo` is defined multiple times
|
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;
|
pub static X: isize = 42;
|
||||||
fn f() { f() } // Check that this does not result in a resolution error
|
fn f() { f() } // Check that this does not result in a resolution error
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
error[E0428]: the name `Foo` is defined multiple times
|
error[E0428]: the name `Foo` is defined multiple times
|
||||||
--> $DIR/enum-and-module-in-same-scope.rs:15:1
|
--> $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
|
12 | | X
|
||||||
13 | | }
|
13 | | }
|
||||||
| |_- previous definition of the type `Foo` here
|
| |_- previous definition of the type `Foo` here
|
||||||
14 |
|
14 |
|
||||||
15 | / mod Foo { //~ ERROR the name `Foo` is defined multiple times
|
15 | / mod Foo { //~ ERROR the name `Foo` is defined multiple times
|
||||||
16 | | //~| NOTE `Foo` redefined here
|
16 | | pub static X: isize = 42;
|
||||||
17 | | //~| NOTE `Foo` must be defined only once in the type namespace of this module
|
17 | | fn f() { f() } // Check that this does not result in a resolution error
|
||||||
18 | | pub static X: isize = 42;
|
18 | | }
|
||||||
19 | | fn f() { f() } // Check that this does not result in a resolution error
|
|
||||||
20 | | }
|
|
||||||
| |_^ `Foo` redefined here
|
| |_^ `Foo` redefined here
|
||||||
|
|
|
|
||||||
= note: `Foo` must be defined only once in the type namespace of this module
|
= note: `Foo` must be defined only once in the type namespace of this module
|
||||||
|
|
|
@ -18,14 +18,12 @@ fn main() {
|
||||||
let q = a.as_ptr();
|
let q = a.as_ptr();
|
||||||
|
|
||||||
a as usize; //~ ERROR casting
|
a as usize; //~ ERROR casting
|
||||||
//~^ HELP cast through a raw pointer first
|
|
||||||
a as isize; //~ ERROR casting
|
a as isize; //~ ERROR casting
|
||||||
a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
|
a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
|
||||||
a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
|
a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
|
||||||
b as usize; //~ ERROR non-primitive cast
|
b as usize; //~ ERROR non-primitive cast
|
||||||
p as usize;
|
p as usize;
|
||||||
//~^ ERROR casting
|
//~^ ERROR casting
|
||||||
//~^^ HELP cast through a thin pointer
|
|
||||||
|
|
||||||
// #22955
|
// #22955
|
||||||
q as *const [i32]; //~ ERROR cannot cast
|
q as *const [i32]; //~ ERROR cannot cast
|
||||||
|
|
|
@ -7,55 +7,55 @@ error[E0606]: casting `&[i32]` as `usize` is invalid
|
||||||
= help: cast through a raw pointer first
|
= help: cast through a raw pointer first
|
||||||
|
|
||||||
error[E0606]: casting `&[i32]` as `isize` is invalid
|
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
|
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
|
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`
|
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
|
= 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
|
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
|
= help: cast through a thin pointer first
|
||||||
|
|
||||||
error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32]`
|
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
|
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
|
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
|
error: aborting due to 9 previous errors
|
||||||
|
|
|
@ -11,6 +11,5 @@
|
||||||
#![allow(unused_macros)]
|
#![allow(unused_macros)]
|
||||||
|
|
||||||
macro m() {} //~ ERROR `macro` is experimental (see issue #39412)
|
macro m() {} //~ ERROR `macro` is experimental (see issue #39412)
|
||||||
//~| HELP add #![feature(decl_macro)] to the crate attributes to enable
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -17,6 +17,5 @@
|
||||||
struct Pt<A>(A);
|
struct Pt<A>(A);
|
||||||
impl<#[may_dangle] A> Drop for Pt<A> {
|
impl<#[may_dangle] A> Drop for Pt<A> {
|
||||||
//~^ ERROR may_dangle has unstable semantics and may be removed in the future
|
//~^ 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) { }
|
fn drop(&mut self) { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#[repr(u128)]
|
#[repr(u128)]
|
||||||
enum A { //~ ERROR repr with 128-bit type is unstable
|
enum A { //~ ERROR repr with 128-bit type is unstable
|
||||||
//~| HELP: add #![feature(repr128)]
|
|
||||||
A(u64)
|
A(u64)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,8 @@ error: repr with 128-bit type is unstable (see issue #35118)
|
||||||
--> $DIR/feature-gate-repr128.rs:12:1
|
--> $DIR/feature-gate-repr128.rs:12:1
|
||||||
|
|
|
|
||||||
12 | / enum A { //~ ERROR repr with 128-bit type is unstable
|
12 | / enum A { //~ ERROR repr with 128-bit type is unstable
|
||||||
13 | | //~| HELP: add #![feature(repr128)]
|
13 | | A(u64)
|
||||||
14 | | A(u64)
|
14 | | }
|
||||||
15 | | }
|
|
||||||
| |_^
|
| |_^
|
||||||
|
|
|
|
||||||
= help: add #![feature(repr128)] to the crate attributes to enable
|
= help: add #![feature(repr128)] to the crate attributes to enable
|
||||||
|
|
|
@ -18,5 +18,4 @@ struct Vec<T, A = Heap>(
|
||||||
fn main() {
|
fn main() {
|
||||||
let _: Vec;
|
let _: Vec;
|
||||||
//~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0243]
|
//~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0243]
|
||||||
//~| NOTE expected at least 1 type argument
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,5 +18,4 @@ struct Vec<T, A = Heap>(
|
||||||
fn main() {
|
fn main() {
|
||||||
let _: Vec<isize, Heap, bool>;
|
let _: Vec<isize, Heap, bool>;
|
||||||
//~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0244]
|
//~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0244]
|
||||||
//~| NOTE expected at most 2 type arguments
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
||||||
//~| expected type `()`
|
//~| expected type `()`
|
||||||
//~| found type `{integer}`
|
//~| found type `{integer}`
|
||||||
()
|
()
|
||||||
} else { //~ NOTE: `if let` arm with an incompatible type
|
} else {
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ error[E0308]: `if let` arms have incompatible types
|
||||||
note: `if let` arm with an incompatible type
|
note: `if let` arm with an incompatible type
|
||||||
--> $DIR/if-let-arm-types.rs:17:12
|
--> $DIR/if-let-arm-types.rs:17:12
|
||||||
|
|
|
|
||||||
17 | } else { //~ NOTE: `if let` arm with an incompatible type
|
17 | } else {
|
||||||
| ____________^
|
| ____________^
|
||||||
18 | | 1
|
18 | | 1
|
||||||
19 | | };
|
19 | | };
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue