Move compile-fail tests with NOTE/HELP annotations to UI
This commit is contained in:
parent
3a2ad576c5
commit
d4e51a8fb2
451 changed files with 5821 additions and 7 deletions
19
src/test/ui/arbitrary-self-types-not-object-safe.stderr
Normal file
19
src/test/ui/arbitrary-self-types-not-object-safe.stderr
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
error[E0038]: the trait `Foo` cannot be made into an object
|
||||||
|
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:33
|
||||||
|
|
|
||||||
|
40 | let x = Box::new(5usize) as Box<Foo>;
|
||||||
|
| ^^^^^^^^ the trait `Foo` cannot be made into an object
|
||||||
|
|
|
||||||
|
= note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box<Self>` are currently supported for trait objects
|
||||||
|
|
||||||
|
error[E0038]: the trait `Foo` cannot be made into an object
|
||||||
|
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:13
|
||||||
|
|
|
||||||
|
40 | let x = Box::new(5usize) as Box<Foo>;
|
||||||
|
| ^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
|
||||||
|
|
|
||||||
|
= note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box<Self>` are currently supported for trait objects
|
||||||
|
= note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<Foo>>` for `std::boxed::Box<usize>`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
11
src/test/ui/asm-out-assign-imm.stderr
Normal file
11
src/test/ui/asm-out-assign-imm.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0384]: cannot assign twice to immutable variable `x`
|
||||||
|
--> $DIR/asm-out-assign-imm.rs:29:9
|
||||||
|
|
|
||||||
|
26 | x = 1; //~ NOTE first assignment
|
||||||
|
| ----- first assignment to `x`
|
||||||
|
...
|
||||||
|
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
23
src/test/ui/associated-const-impl-wrong-lifetime.stderr
Normal file
23
src/test/ui/associated-const-impl-wrong-lifetime.stderr
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/associated-const-impl-wrong-lifetime.rs:19:5
|
||||||
|
|
|
||||||
|
19 | const NAME: &'a str = "unit";
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||||
|
|
|
||||||
|
= note: expected type `&'static str`
|
||||||
|
found type `&'a str`
|
||||||
|
note: the lifetime 'a as defined on the impl at 17:1...
|
||||||
|
--> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
|
||||||
|
|
|
||||||
|
17 | / impl<'a> Foo for &'a () {
|
||||||
|
18 | | //~^ NOTE the lifetime 'a as defined
|
||||||
|
19 | | const NAME: &'a str = "unit";
|
||||||
|
20 | | //~^ ERROR mismatched types [E0308]
|
||||||
|
... |
|
||||||
|
23 | | //~| NOTE ...does not necessarily outlive the static lifetime
|
||||||
|
24 | | }
|
||||||
|
| |_^
|
||||||
|
= note: ...does not necessarily outlive the static lifetime
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
11
src/test/ui/associated-const-impl-wrong-type.stderr
Normal file
11
src/test/ui/associated-const-impl-wrong-type.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0326]: implemented const `BAR` has an incompatible type for trait
|
||||||
|
--> $DIR/associated-const-impl-wrong-type.rs:19:16
|
||||||
|
|
|
||||||
|
13 | const BAR: u32; //~ NOTE type in trait
|
||||||
|
| --- type in trait
|
||||||
|
...
|
||||||
|
19 | const BAR: i32 = -1;
|
||||||
|
| ^^^ expected u32, found i32
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
||||||
|
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:35:32
|
||||||
|
|
|
||||||
|
15 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
|
...
|
||||||
|
24 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Box`
|
||||||
|
...
|
||||||
|
35 | fn dent<C:BoxCar>(c: C, color: C::Color) {
|
||||||
|
| ^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
|
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
|
||||||
|
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:33
|
||||||
|
|
|
||||||
|
15 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
|
...
|
||||||
|
24 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Box`
|
||||||
|
...
|
||||||
|
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||||
|
| ^^^^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
|
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
|
||||||
|
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:26
|
||||||
|
|
|
||||||
|
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
|
||||||
|
|
||||||
|
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
||||||
|
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:47:29
|
||||||
|
|
|
||||||
|
15 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Vehicle`
|
||||||
|
...
|
||||||
|
24 | type Color;
|
||||||
|
| ----------- ambiguous `Color` from `Box`
|
||||||
|
...
|
||||||
|
47 | fn paint<C:BoxCar>(c: C, d: C::Color) {
|
||||||
|
| ^^^^^^^^ ambiguous associated type `Color`
|
||||||
|
|
||||||
|
error: aborting due to 4 previous errors
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
error[E0277]: the trait bound `(): Add<A>` is not satisfied
|
||||||
|
--> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:33:11
|
||||||
|
|
|
||||||
|
33 | r = r + a;
|
||||||
|
| ^ the trait `Add<A>` is not implemented for `()`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
26
src/test/ui/associated-types-in-ambiguous-context.stderr
Normal file
26
src/test/ui/associated-types-in-ambiguous-context.stderr
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
error[E0223]: ambiguous associated type
|
||||||
|
--> $DIR/associated-types-in-ambiguous-context.rs:16:36
|
||||||
|
|
|
||||||
|
16 | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
|
||||||
|
| ^^^^^^^^^^ ambiguous associated type
|
||||||
|
|
|
||||||
|
= note: specify the type using the syntax `<Type as Get>::Value`
|
||||||
|
|
||||||
|
error[E0223]: ambiguous associated type
|
||||||
|
--> $DIR/associated-types-in-ambiguous-context.rs:29:10
|
||||||
|
|
|
||||||
|
29 | type X = std::ops::Deref::Target;
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
|
||||||
|
|
|
||||||
|
= note: specify the type using the syntax `<Type as std::ops::Deref>::Target`
|
||||||
|
|
||||||
|
error[E0223]: ambiguous associated type
|
||||||
|
--> $DIR/associated-types-in-ambiguous-context.rs:23:23
|
||||||
|
|
|
||||||
|
23 | fn grab(&self) -> Grab::Value;
|
||||||
|
| ^^^^^^^^^^^ ambiguous associated type
|
||||||
|
|
|
||||||
|
= note: specify the type using the syntax `<Type as Grab>::Value`
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
22
src/test/ui/augmented-assignments.stderr
Normal file
22
src/test/ui/augmented-assignments.stderr
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
error[E0596]: cannot borrow immutable local variable `y` as mutable
|
||||||
|
--> $DIR/augmented-assignments.rs:31:5
|
||||||
|
|
|
||||||
|
29 | let y = Int(2);
|
||||||
|
| - consider changing this to `mut y`
|
||||||
|
30 | //~^ consider changing this to `mut y`
|
||||||
|
31 | y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||||
|
| ^ cannot borrow mutably
|
||||||
|
|
||||||
|
error[E0382]: use of moved value: `x`
|
||||||
|
--> $DIR/augmented-assignments.rs:23:5
|
||||||
|
|
|
||||||
|
23 | x //~ error: use of moved value: `x`
|
||||||
|
| ^ value used here after move
|
||||||
|
...
|
||||||
|
27 | x; //~ value moved here
|
||||||
|
| - value moved here
|
||||||
|
|
|
||||||
|
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
25
src/test/ui/auxiliary/coherence_lib.rs
Normal file
25
src/test/ui/auxiliary/coherence_lib.rs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![crate_type="lib"]
|
||||||
|
|
||||||
|
pub trait Remote {
|
||||||
|
fn foo(&self) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Remote1<T> {
|
||||||
|
fn foo(&self, t: T) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Remote2<T, U> {
|
||||||
|
fn foo(&self, t: T, u: U) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Pair<T,U>(T,U);
|
19
src/test/ui/auxiliary/empty-struct.rs
Normal file
19
src/test/ui/auxiliary/empty-struct.rs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
pub struct XEmpty1 {}
|
||||||
|
pub struct XEmpty2;
|
||||||
|
pub struct XEmpty6();
|
||||||
|
|
||||||
|
pub enum XE {
|
||||||
|
XEmpty3 {},
|
||||||
|
XEmpty4,
|
||||||
|
XEmpty5(),
|
||||||
|
}
|
30
src/test/ui/auxiliary/lint_output_format.rs
Normal file
30
src/test/ui/auxiliary/lint_output_format.rs
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![crate_name="lint_output_format"]
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
#![feature(staged_api)]
|
||||||
|
#![unstable(feature = "test_feature", issue = "0")]
|
||||||
|
|
||||||
|
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||||
|
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||||
|
pub fn foo() -> usize {
|
||||||
|
20
|
||||||
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "test_feature", issue = "0")]
|
||||||
|
pub fn bar() -> usize {
|
||||||
|
40
|
||||||
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "test_feature", issue = "0")]
|
||||||
|
pub fn baz() -> usize {
|
||||||
|
30
|
||||||
|
}
|
19
src/test/ui/auxiliary/struct_field_privacy.rs
Normal file
19
src/test/ui/auxiliary/struct_field_privacy.rs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
pub struct A {
|
||||||
|
a: isize,
|
||||||
|
pub b: isize,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct B {
|
||||||
|
pub a: isize,
|
||||||
|
b: isize,
|
||||||
|
}
|
15
src/test/ui/auxiliary/two_macros.rs
Normal file
15
src/test/ui/auxiliary/two_macros.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! macro_one { () => ("one") }
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! macro_two { () => ("two") }
|
11
src/test/ui/binary-op-on-double-ref.stderr
Normal file
11
src/test/ui/binary-op-on-double-ref.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0369]: binary operation `%` cannot be applied to type `&&{integer}`
|
||||||
|
--> $DIR/binary-op-on-double-ref.rs:14:9
|
||||||
|
|
|
||||||
|
14 | x % 2 == 0
|
||||||
|
| ^^^^^
|
||||||
|
|
|
||||||
|
= note: this is a reference to a type that `%` can be applied to; you need to dereference this variable once for this operation to work
|
||||||
|
= note: an implementation of `std::ops::Rem` might be missing for `&&{integer}`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
17
src/test/ui/blind-item-item-shadow.stderr
Normal file
17
src/test/ui/blind-item-item-shadow.stderr
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
error[E0255]: the name `foo` is defined multiple times
|
||||||
|
--> $DIR/blind-item-item-shadow.rs:13:5
|
||||||
|
|
|
||||||
|
11 | mod foo { pub mod foo { } } //~ NOTE previous definition of the module `foo` here
|
||||||
|
| ---------------------------- previous definition of the module `foo` here
|
||||||
|
12 |
|
||||||
|
13 | use foo::foo;
|
||||||
|
| ^^^^^^^^ `foo` reimported here
|
||||||
|
|
|
||||||
|
= note: `foo` must be defined only once in the type namespace of this module
|
||||||
|
help: You can use `as` to change the binding name of the import
|
||||||
|
|
|
||||||
|
13 | use foo::foo as Otherfoo;
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
11
src/test/ui/bogus-tag.stderr
Normal file
11
src/test/ui/bogus-tag.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0599]: no variant named `hsl` found for type `color` in the current scope
|
||||||
|
--> $DIR/bogus-tag.rs:19:7
|
||||||
|
|
|
||||||
|
12 | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
||||||
|
| ---------- variant `hsl` not found here
|
||||||
|
...
|
||||||
|
19 | color::hsl(h, s, l) => { println!("hsl"); }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ variant not found in `color`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
170
src/test/ui/borrowck/borrowck-box-insensitivity.stderr
Normal file
170
src/test/ui/borrowck/borrowck-box-insensitivity.stderr
Normal file
|
@ -0,0 +1,170 @@
|
||||||
|
error[E0382]: use of moved value: `a`
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:37:9
|
||||||
|
|
|
||||||
|
35 | let _x = a.x;
|
||||||
|
| -- value moved here
|
||||||
|
36 | //~^ value moved here
|
||||||
|
37 | let _y = a.y; //~ ERROR use of moved
|
||||||
|
| ^^ value used here after move
|
||||||
|
|
|
||||||
|
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0382]: use of moved value: `a`
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:46:9
|
||||||
|
|
|
||||||
|
44 | let _x = a.x;
|
||||||
|
| -- value moved here
|
||||||
|
45 | //~^ value moved here
|
||||||
|
46 | let _y = a.y; //~ ERROR use of moved
|
||||||
|
| ^^ value used here after move
|
||||||
|
|
|
||||||
|
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0382]: use of moved value: `a`
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:55:15
|
||||||
|
|
|
||||||
|
53 | let _x = a.x;
|
||||||
|
| -- value moved here
|
||||||
|
54 | //~^ value moved here
|
||||||
|
55 | let _y = &a.y; //~ ERROR use of moved
|
||||||
|
| ^^^ value used here after move
|
||||||
|
|
|
||||||
|
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:64:9
|
||||||
|
|
|
||||||
|
62 | let _x = &a.x;
|
||||||
|
| --- borrow of `a.x` occurs here
|
||||||
|
63 | //~^ NOTE borrow of `a.x` occurs here
|
||||||
|
64 | let _y = a.y;
|
||||||
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
|
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:73:9
|
||||||
|
|
|
||||||
|
71 | let _x = &mut a.x;
|
||||||
|
| --- borrow of `a.x` occurs here
|
||||||
|
72 | //~^ NOTE borrow of `a.x` occurs here
|
||||||
|
73 | let _y = a.y; //~ ERROR cannot use
|
||||||
|
| ^^ use of borrowed `a.x`
|
||||||
|
|
||||||
|
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:81:9
|
||||||
|
|
|
||||||
|
79 | let _x = &mut a.x;
|
||||||
|
| --- borrow of `a.x` occurs here
|
||||||
|
80 | //~^ NOTE borrow of `a.x` occurs here
|
||||||
|
81 | let _y = a.y;
|
||||||
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
|
error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`)
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:90:15
|
||||||
|
|
|
||||||
|
88 | let _x = &mut a.x;
|
||||||
|
| --- mutable borrow occurs here (via `a.x`)
|
||||||
|
89 | //~^ NOTE mutable borrow occurs here (via `a.x`)
|
||||||
|
90 | let _y = &a.y; //~ ERROR cannot borrow
|
||||||
|
| ^^^ immutable borrow occurs here (via `a.y`)
|
||||||
|
91 | //~^ immutable borrow occurs here (via `a.y`)
|
||||||
|
92 | }
|
||||||
|
| - mutable borrow ends here
|
||||||
|
|
||||||
|
error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`)
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:99:19
|
||||||
|
|
|
||||||
|
97 | let _x = &a.x;
|
||||||
|
| --- immutable borrow occurs here (via `a.x`)
|
||||||
|
98 | //~^ NOTE immutable borrow occurs here (via `a.x`)
|
||||||
|
99 | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||||
|
| ^^^ mutable borrow occurs here (via `a.y`)
|
||||||
|
100 | //~^ mutable borrow occurs here (via `a.y`)
|
||||||
|
101 | }
|
||||||
|
| - immutable borrow ends here
|
||||||
|
|
||||||
|
error[E0382]: use of collaterally moved value: `a.y`
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:108:9
|
||||||
|
|
|
||||||
|
106 | let _x = a.x.x;
|
||||||
|
| -- value moved here
|
||||||
|
107 | //~^ value moved here
|
||||||
|
108 | 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:117:9
|
||||||
|
|
|
||||||
|
115 | let _x = a.x.x;
|
||||||
|
| -- value moved here
|
||||||
|
116 | //~^ value moved here
|
||||||
|
117 | let _y = a.y; //~ ERROR use of collaterally moved
|
||||||
|
| ^^ value used here after move
|
||||||
|
|
|
||||||
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0382]: use of collaterally moved value: `a.y`
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:126:15
|
||||||
|
|
|
||||||
|
124 | let _x = a.x.x;
|
||||||
|
| -- value moved here
|
||||||
|
125 | //~^ value moved here
|
||||||
|
126 | let _y = &a.y; //~ ERROR use of collaterally moved
|
||||||
|
| ^^^ value used here after move
|
||||||
|
|
|
||||||
|
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||||
|
|
||||||
|
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:135:9
|
||||||
|
|
|
||||||
|
133 | let _x = &a.x.x;
|
||||||
|
| ----- borrow of `a.x.x` occurs here
|
||||||
|
134 | //~^ borrow of `a.x.x` occurs here
|
||||||
|
135 | let _y = a.y;
|
||||||
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
|
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:144:9
|
||||||
|
|
|
||||||
|
142 | let _x = &mut a.x.x;
|
||||||
|
| ----- borrow of `a.x.x` occurs here
|
||||||
|
143 | //~^ NOTE borrow of `a.x.x` occurs here
|
||||||
|
144 | let _y = a.y; //~ ERROR cannot use
|
||||||
|
| ^^ use of borrowed `a.x.x`
|
||||||
|
|
||||||
|
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:152:9
|
||||||
|
|
|
||||||
|
150 | let _x = &mut a.x.x;
|
||||||
|
| ----- borrow of `a.x.x` occurs here
|
||||||
|
151 | //~^ NOTE borrow of `a.x.x` occurs here
|
||||||
|
152 | let _y = a.y;
|
||||||
|
| ^^ move out of `a.y` occurs here
|
||||||
|
|
||||||
|
error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:161:15
|
||||||
|
|
|
||||||
|
159 | let _x = &mut a.x.x;
|
||||||
|
| ----- mutable borrow occurs here
|
||||||
|
160 | //~^ mutable borrow occurs here
|
||||||
|
161 | let _y = &a.y; //~ ERROR cannot borrow
|
||||||
|
| ^^^ immutable borrow occurs here
|
||||||
|
162 | //~^ immutable borrow occurs here
|
||||||
|
163 | }
|
||||||
|
| - mutable borrow ends here
|
||||||
|
|
||||||
|
error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable
|
||||||
|
--> $DIR/borrowck-box-insensitivity.rs:170:19
|
||||||
|
|
|
||||||
|
168 | let _x = &a.x.x;
|
||||||
|
| ----- immutable borrow occurs here
|
||||||
|
169 | //~^ immutable borrow occurs here
|
||||||
|
170 | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||||
|
| ^^^ mutable borrow occurs here
|
||||||
|
171 | //~^ mutable borrow occurs here
|
||||||
|
172 | }
|
||||||
|
| - immutable borrow ends here
|
||||||
|
|
||||||
|
error: aborting due to 16 previous errors
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function
|
||||||
|
--> $DIR/borrowck-escaping-closure-error-1.rs:23:11
|
||||||
|
|
|
||||||
|
23 | spawn(|| books.push(4));
|
||||||
|
| ^^ ----- `books` is borrowed here
|
||||||
|
| |
|
||||||
|
| may outlive borrowed value `books`
|
||||||
|
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||||
|
|
|
||||||
|
23 | spawn(move || books.push(4));
|
||||||
|
| ^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function
|
||||||
|
--> $DIR/borrowck-escaping-closure-error-2.rs:21:14
|
||||||
|
|
|
||||||
|
21 | Box::new(|| books.push(4))
|
||||||
|
| ^^ ----- `books` is borrowed here
|
||||||
|
| |
|
||||||
|
| may outlive borrowed value `books`
|
||||||
|
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||||
|
|
|
||||||
|
21 | Box::new(move || books.push(4))
|
||||||
|
| ^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
36
src/test/ui/borrowck/borrowck-move-error-with-note.stderr
Normal file
36
src/test/ui/borrowck/borrowck-move-error-with-note.stderr
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
error[E0507]: cannot move out of borrowed content
|
||||||
|
--> $DIR/borrowck-move-error-with-note.rs:21:11
|
||||||
|
|
|
||||||
|
21 | match *f { //~ ERROR cannot move out of
|
||||||
|
| ^^ cannot move out of borrowed content
|
||||||
|
22 | //~| cannot move out
|
||||||
|
23 | Foo::Foo1(num1, //~ NOTE to prevent move
|
||||||
|
| ---- hint: to prevent move, use `ref num1` or `ref mut num1`
|
||||||
|
24 | num2) => (), //~ NOTE and here
|
||||||
|
| ---- ...and here (use `ref num2` or `ref mut num2`)
|
||||||
|
25 | Foo::Foo2(num) => (), //~ NOTE and here
|
||||||
|
| --- ...and here (use `ref num` or `ref mut num`)
|
||||||
|
|
||||||
|
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||||
|
--> $DIR/borrowck-move-error-with-note.rs:40:9
|
||||||
|
|
|
||||||
|
40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
||||||
|
41 | | //~| cannot move out of here
|
||||||
|
42 | | f: _s, //~ NOTE to prevent move
|
||||||
|
| | -- hint: to prevent move, use `ref _s` or `ref mut _s`
|
||||||
|
43 | | g: _t //~ NOTE and here
|
||||||
|
| | -- ...and here (use `ref _t` or `ref mut _t`)
|
||||||
|
44 | | } => {}
|
||||||
|
| |_________^ cannot move out of here
|
||||||
|
|
||||||
|
error[E0507]: cannot move out of borrowed content
|
||||||
|
--> $DIR/borrowck-move-error-with-note.rs:57:11
|
||||||
|
|
|
||||||
|
57 | match a.a { //~ ERROR cannot move out of
|
||||||
|
| ^ cannot move out of borrowed content
|
||||||
|
58 | //~| cannot move out
|
||||||
|
59 | n => { //~ NOTE to prevent move
|
||||||
|
| - hint: to prevent move, use `ref n` or `ref mut n`
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
17
src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr
Normal file
17
src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:18
|
||||||
|
|
|
||||||
|
30 | &[Foo { string: a },
|
||||||
|
| ^ - hint: to prevent move, use `ref a` or `ref mut a`
|
||||||
|
| __________________|
|
||||||
|
| |
|
||||||
|
31 | | //~^ ERROR cannot move out of type `[Foo]`
|
||||||
|
32 | | //~| cannot move out
|
||||||
|
33 | | //~| to prevent move
|
||||||
|
34 | | Foo { string: b }] => {
|
||||||
|
| |_________________________________-__^ cannot move out of here
|
||||||
|
| |
|
||||||
|
| ...and here (use `ref b` or `ref mut b`)
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||||
|
--> $DIR/borrowck-report-with-custom-diagnostic.rs:17:14
|
||||||
|
|
|
||||||
|
15 | let y = &mut x;
|
||||||
|
| - mutable borrow occurs here
|
||||||
|
16 | //~^ mutable borrow occurs here
|
||||||
|
17 | let z = &x; //~ ERROR cannot borrow
|
||||||
|
| ^ immutable borrow occurs here
|
||||||
|
18 | //~^ immutable borrow occurs here
|
||||||
|
19 | }
|
||||||
|
| - mutable borrow ends here
|
||||||
|
|
||||||
|
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||||
|
--> $DIR/borrowck-report-with-custom-diagnostic.rs:29:26
|
||||||
|
|
|
||||||
|
27 | let y = &x;
|
||||||
|
| - immutable borrow occurs here
|
||||||
|
28 | //~^ immutable borrow occurs here
|
||||||
|
29 | let z = &mut x; //~ ERROR cannot borrow
|
||||||
|
| ^ mutable borrow occurs here
|
||||||
|
30 | //~^ mutable borrow occurs here
|
||||||
|
31 | }
|
||||||
|
| - immutable borrow ends here
|
||||||
|
|
||||||
|
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||||
|
--> $DIR/borrowck-report-with-custom-diagnostic.rs:43:22
|
||||||
|
|
|
||||||
|
41 | let y = &mut x;
|
||||||
|
| - first mutable borrow occurs here
|
||||||
|
42 | //~^ first mutable borrow occurs here
|
||||||
|
43 | let z = &mut x; //~ ERROR cannot borrow
|
||||||
|
| ^ second mutable borrow occurs here
|
||||||
|
44 | //~^ second mutable borrow occurs here
|
||||||
|
45 | };
|
||||||
|
| - first borrow ends here
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
82
src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Normal file
82
src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:21:13
|
||||||
|
|
|
||||||
|
19 | [box ref _a, _, _] => {
|
||||||
|
| ------ borrow of `vec[..]` occurs here
|
||||||
|
20 | //~^ borrow of `vec[..]` occurs here
|
||||||
|
21 | vec[0] = box 4; //~ ERROR cannot assign
|
||||||
|
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||||
|
|
||||||
|
error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:33:13
|
||||||
|
|
|
||||||
|
31 | &mut [ref _b..] => {
|
||||||
|
| ------ borrow of `vec[..]` occurs here
|
||||||
|
32 | //~^ borrow of `vec[..]` occurs here
|
||||||
|
33 | vec[0] = box 4; //~ ERROR cannot assign
|
||||||
|
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:43:14
|
||||||
|
|
|
||||||
|
43 | &mut [_a, //~ ERROR cannot move out
|
||||||
|
| ^-- hint: to prevent move, use `ref _a` or `ref mut _a`
|
||||||
|
| ______________|
|
||||||
|
| |
|
||||||
|
44 | | //~| cannot move out
|
||||||
|
45 | | //~| to prevent move
|
||||||
|
46 | | ..
|
||||||
|
47 | | ] => {
|
||||||
|
| |_________^ cannot move out of here
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:56:13
|
||||||
|
|
|
||||||
|
56 | let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
| ^^^^^^
|
||||||
|
| |
|
||||||
|
| cannot move out of here
|
||||||
|
| help: consider using a reference instead: `&vec[0]`
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:64:14
|
||||||
|
|
|
||||||
|
64 | &mut [ //~ ERROR cannot move out
|
||||||
|
| ______________^
|
||||||
|
65 | | //~^ cannot move out
|
||||||
|
66 | | _b] => {} //~ NOTE to prevent move
|
||||||
|
| |__________--^ cannot move out of here
|
||||||
|
| |
|
||||||
|
| hint: to prevent move, use `ref _b` or `ref mut _b`
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:69:13
|
||||||
|
|
|
||||||
|
69 | let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
| ^^^^^^
|
||||||
|
| |
|
||||||
|
| cannot move out of here
|
||||||
|
| help: consider using a reference instead: `&vec[0]`
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:77:14
|
||||||
|
|
|
||||||
|
77 | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
|
||||||
|
| ^--^^--^^--^
|
||||||
|
| || | |
|
||||||
|
| || | ...and here (use `ref _c` or `ref mut _c`)
|
||||||
|
| || ...and here (use `ref _b` or `ref mut _b`)
|
||||||
|
| |hint: to prevent move, use `ref _a` or `ref mut _a`
|
||||||
|
| cannot move out of here
|
||||||
|
|
||||||
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
|
--> $DIR/borrowck-vec-pattern-nesting.rs:84:13
|
||||||
|
|
|
||||||
|
84 | let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
| ^^^^^^
|
||||||
|
| |
|
||||||
|
| cannot move out of here
|
||||||
|
| help: consider using a reference instead: `&vec[0]`
|
||||||
|
|
||||||
|
error: aborting due to 8 previous errors
|
||||||
|
|
10
src/test/ui/cast-as-bool.stderr
Normal file
10
src/test/ui/cast-as-bool.stderr
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
error[E0054]: cannot cast as `bool`
|
||||||
|
--> $DIR/cast-as-bool.rs:12:13
|
||||||
|
|
|
||||||
|
12 | let u = 5 as bool;
|
||||||
|
| ^^^^^^^^^ unsupported cast
|
||||||
|
|
|
||||||
|
= help: compare with zero instead
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
10
src/test/ui/cast-rfc0401-2.stderr
Normal file
10
src/test/ui/cast-rfc0401-2.stderr
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
error[E0054]: cannot cast as `bool`
|
||||||
|
--> $DIR/cast-rfc0401-2.rs:16:13
|
||||||
|
|
|
||||||
|
16 | let _ = 3 as bool;
|
||||||
|
| ^^^^^^^^^ unsupported cast
|
||||||
|
|
|
||||||
|
= help: compare with zero instead
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
13
src/test/ui/changing-crates.stderr
Normal file
13
src/test/ui/changing-crates.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0460]: found possibly newer version of crate `a` which `b` depends on
|
||||||
|
--> $DIR/changing-crates.rs:19:1
|
||||||
|
|
|
||||||
|
19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: perhaps that crate needs to be recompiled?
|
||||||
|
= note: the following crate versions were found:
|
||||||
|
crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/changing-crates.stage1-x86_64-pc-windows-gnu.aux/a.dll
|
||||||
|
crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/changing-crates.stage1-x86_64-pc-windows-gnu.aux/b.dll
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
8
src/test/ui/coherence-error-suppression.stderr
Normal file
8
src/test/ui/coherence-error-suppression.stderr
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
error[E0412]: cannot find type `DoesNotExist` in this scope
|
||||||
|
--> $DIR/coherence-error-suppression.rs:19:14
|
||||||
|
|
|
||||||
|
19 | impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope
|
||||||
|
| ^^^^^^^^^^^^ not found in this scope
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
59
src/test/ui/coherence-impls-copy.stderr
Normal file
59
src/test/ui/coherence-impls-copy.stderr
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
|
--> $DIR/coherence-impls-copy.rs:29:15
|
||||||
|
|
|
||||||
|
29 | impl Copy for &'static mut MyType {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
|
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
|
--> $DIR/coherence-impls-copy.rs:34:15
|
||||||
|
|
|
||||||
|
34 | impl Copy for (MyType, MyType) {}
|
||||||
|
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
|
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
|
--> $DIR/coherence-impls-copy.rs:42:15
|
||||||
|
|
|
||||||
|
42 | impl Copy for &'static NotSync {}
|
||||||
|
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
|
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
|
--> $DIR/coherence-impls-copy.rs:46:15
|
||||||
|
|
|
||||||
|
46 | impl Copy for [MyType] {}
|
||||||
|
| ^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
|
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||||
|
--> $DIR/coherence-impls-copy.rs:54:15
|
||||||
|
|
|
||||||
|
54 | impl Copy for &'static [NotSync] {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||||
|
|
||||||
|
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||||
|
--> $DIR/coherence-impls-copy.rs:34:1
|
||||||
|
|
|
||||||
|
34 | impl Copy for (MyType, MyType) {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
||||||
|
= note: the impl does not reference any types defined in this crate
|
||||||
|
= note: define and implement a trait or new type instead
|
||||||
|
|
||||||
|
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||||
|
--> $DIR/coherence-impls-copy.rs:46:1
|
||||||
|
|
|
||||||
|
46 | impl Copy for [MyType] {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
||||||
|
= note: the impl does not reference any types defined in this crate
|
||||||
|
= note: define and implement a trait or new type instead
|
||||||
|
|
||||||
|
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||||
|
--> $DIR/coherence-impls-copy.rs:54:1
|
||||||
|
|
|
||||||
|
54 | impl Copy for &'static [NotSync] {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
||||||
|
= note: the impl does not reference any types defined in this crate
|
||||||
|
= note: define and implement a trait or new type instead
|
||||||
|
|
||||||
|
error: aborting due to 8 previous errors
|
||||||
|
|
22
src/test/ui/coherence-overlap-downstream-inherent.stderr
Normal file
22
src/test/ui/coherence-overlap-downstream-inherent.stderr
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
--> $DIR/coherence-overlap-downstream-inherent.rs:17:26
|
||||||
|
|
|
||||||
|
17 | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
|
...
|
||||||
|
20 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||||
|
| ------------------- other definition for `dummy`
|
||||||
|
|
||||||
|
error[E0592]: duplicate definitions with name `f`
|
||||||
|
--> $DIR/coherence-overlap-downstream-inherent.rs:25:38
|
||||||
|
|
|
||||||
|
25 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
||||||
|
| ^^^^^^^^^^^^^^ duplicate definitions for `f`
|
||||||
|
...
|
||||||
|
29 | impl<X> A<i32, X> { fn f(&self) {} }
|
||||||
|
| -------------- other definition for `f`
|
||||||
|
|
|
||||||
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
22
src/test/ui/coherence-overlap-downstream.stderr
Normal file
22
src/test/ui/coherence-overlap-downstream.stderr
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
error[E0119]: conflicting implementations of trait `Sweet`:
|
||||||
|
--> $DIR/coherence-overlap-downstream.rs:19:1
|
||||||
|
|
|
||||||
|
17 | impl<T:Sugar> Sweet for T { }
|
||||||
|
| ----------------------------- first implementation here
|
||||||
|
18 | //~^ NOTE first implementation here
|
||||||
|
19 | impl<T:Fruit> Sweet for T { }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||||
|
|
||||||
|
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
|
||||||
|
--> $DIR/coherence-overlap-downstream.rs:27:1
|
||||||
|
|
|
||||||
|
25 | impl<X, T> Foo<X> for T where T: Bar<X> {}
|
||||||
|
| ------------------------------------------ first implementation here
|
||||||
|
26 | //~^ NOTE first implementation here
|
||||||
|
27 | impl<X> Foo<X> for i32 {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
||||||
|
|
|
||||||
|
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
13
src/test/ui/coherence-overlap-issue-23516-inherent.stderr
Normal file
13
src/test/ui/coherence-overlap-issue-23516-inherent.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
--> $DIR/coherence-overlap-issue-23516-inherent.rs:19:25
|
||||||
|
|
|
||||||
|
19 | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
|
...
|
||||||
|
23 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||||
|
| ------------------- other definition for `dummy`
|
||||||
|
|
|
||||||
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
13
src/test/ui/coherence-overlap-issue-23516.stderr
Normal file
13
src/test/ui/coherence-overlap-issue-23516.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
|
||||||
|
--> $DIR/coherence-overlap-issue-23516.rs:19:1
|
||||||
|
|
|
||||||
|
17 | impl<T:Sugar> Sweet for T { }
|
||||||
|
| ----------------------------- first implementation here
|
||||||
|
18 | //~^ NOTE first implementation here
|
||||||
|
19 | impl<U:Sugar> Sweet for Box<U> { }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
||||||
|
|
|
||||||
|
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
13
src/test/ui/coherence-overlap-upstream-inherent.stderr
Normal file
13
src/test/ui/coherence-overlap-upstream-inherent.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0592]: duplicate definitions with name `dummy`
|
||||||
|
--> $DIR/coherence-overlap-upstream-inherent.rs:21:32
|
||||||
|
|
|
||||||
|
21 | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||||
|
...
|
||||||
|
25 | impl A<i16> { fn dummy(&self) { } }
|
||||||
|
| ------------------- other definition for `dummy`
|
||||||
|
|
|
||||||
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
13
src/test/ui/coherence-overlap-upstream.stderr
Normal file
13
src/test/ui/coherence-overlap-upstream.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
|
||||||
|
--> $DIR/coherence-overlap-upstream.rs:23:1
|
||||||
|
|
|
||||||
|
21 | impl<T> Foo for T where T: Remote {}
|
||||||
|
| ------------------------------------ first implementation here
|
||||||
|
22 | //~^ NOTE first implementation here
|
||||||
|
23 | impl Foo for i16 {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
|
||||||
|
|
|
||||||
|
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
8
src/test/ui/const-deref-ptr.stderr
Normal file
8
src/test/ui/const-deref-ptr.stderr
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
error[E0396]: raw pointers cannot be dereferenced in statics
|
||||||
|
--> $DIR/const-deref-ptr.rs:14:29
|
||||||
|
|
|
||||||
|
14 | static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer in constant
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
14
src/test/ui/const-eval-overflow-2.stderr
Normal file
14
src/test/ui/const-eval-overflow-2.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0080]: constant evaluation error
|
||||||
|
--> $DIR/const-eval-overflow-2.rs:21:25
|
||||||
|
|
|
||||||
|
21 | const NEG_NEG_128: i8 = -NEG_128;
|
||||||
|
| ^^^^^^^^ attempt to negate with overflow
|
||||||
|
|
|
||||||
|
note: for pattern here
|
||||||
|
--> $DIR/const-eval-overflow-2.rs:27:9
|
||||||
|
|
|
||||||
|
27 | NEG_NEG_128 => println!("A"), //~ NOTE for pattern here
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
8
src/test/ui/const-eval-overflow-4.stderr
Normal file
8
src/test/ui/const-eval-overflow-4.stderr
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
error[E0080]: constant evaluation error
|
||||||
|
--> $DIR/const-eval-overflow-4.rs:23:13
|
||||||
|
|
|
||||||
|
23 | : [u32; (i8::MAX as i8 + 1i8) as usize]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^ attempt to add with overflow
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
11
src/test/ui/const-eval-span.stderr
Normal file
11
src/test/ui/const-eval-span.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/const-eval-span.rs:19:9
|
||||||
|
|
|
||||||
|
19 | V = CONSTANT,
|
||||||
|
| ^^^^^^^^ expected isize, found struct `S`
|
||||||
|
|
|
||||||
|
= note: expected type `isize`
|
||||||
|
found type `S`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
14
src/test/ui/const-fn-error.stderr
Normal file
14
src/test/ui/const-fn-error.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0080]: constant evaluation error
|
||||||
|
--> $DIR/const-fn-error.rs:20:5
|
||||||
|
|
|
||||||
|
20 | sum //~ ERROR E0080
|
||||||
|
| ^^^ non-constant path in constant expression
|
||||||
|
|
|
||||||
|
note: for constant expression here
|
||||||
|
--> $DIR/const-fn-error.rs:26:13
|
||||||
|
|
|
||||||
|
26 | let a : [i32; f(X)]; //~ NOTE for constant expression here
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
8
src/test/ui/const-fn-mismatch.stderr
Normal file
8
src/test/ui/const-fn-mismatch.stderr
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
error[E0379]: trait fns cannot be declared const
|
||||||
|
--> $DIR/const-fn-mismatch.rs:23:5
|
||||||
|
|
|
||||||
|
23 | const fn f() -> u32 { 22 }
|
||||||
|
| ^^^^^ trait fns cannot be const
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
14
src/test/ui/const-fn-not-in-trait.stderr
Normal file
14
src/test/ui/const-fn-not-in-trait.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0379]: trait fns cannot be declared const
|
||||||
|
--> $DIR/const-fn-not-in-trait.rs:17:5
|
||||||
|
|
|
||||||
|
17 | const fn f() -> u32;
|
||||||
|
| ^^^^^ trait fns cannot be const
|
||||||
|
|
||||||
|
error[E0379]: trait fns cannot be declared const
|
||||||
|
--> $DIR/const-fn-not-in-trait.rs:20:5
|
||||||
|
|
|
||||||
|
20 | const fn g() -> u32 { 0 }
|
||||||
|
| ^^^^^ trait fns cannot be const
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
14
src/test/ui/const-len-underflow-separate-spans.stderr
Normal file
14
src/test/ui/const-len-underflow-separate-spans.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0080]: constant evaluation error
|
||||||
|
--> $DIR/const-len-underflow-separate-spans.rs:17:20
|
||||||
|
|
|
||||||
|
17 | const LEN: usize = ONE - TWO;
|
||||||
|
| ^^^^^^^^^ attempt to subtract with overflow
|
||||||
|
|
|
||||||
|
note: for constant expression here
|
||||||
|
--> $DIR/const-len-underflow-separate-spans.rs:22:12
|
||||||
|
|
|
||||||
|
22 | let a: [i8; LEN] = unimplemented!();
|
||||||
|
| ^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
14
src/test/ui/const-pattern-not-const-evaluable.stderr
Normal file
14
src/test/ui/const-pattern-not-const-evaluable.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0080]: constant evaluation error
|
||||||
|
--> $DIR/const-pattern-not-const-evaluable.rs:22:31
|
||||||
|
|
|
||||||
|
22 | const BOO: Pair<Cake, Cake> = Pair(Marmor, BlackForest);
|
||||||
|
| ^^^^ unimplemented constant expression: tuple struct constructors
|
||||||
|
|
|
||||||
|
note: for pattern here
|
||||||
|
--> $DIR/const-pattern-not-const-evaluable.rs:37:9
|
||||||
|
|
|
||||||
|
37 | FOO => println!("hi"), //~ NOTE: for pattern here
|
||||||
|
| ^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
38
src/test/ui/const-unsized.stderr
Normal file
38
src/test/ui/const-unsized.stderr
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
|
||||||
|
--> $DIR/const-unsized.rs:13:29
|
||||||
|
|
|
||||||
|
13 | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
|
||||||
|
|
|
||||||
|
= help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
|
||||||
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
|
||||||
|
--> $DIR/const-unsized.rs:18:24
|
||||||
|
|
|
||||||
|
18 | const CONST_FOO: str = *"foo";
|
||||||
|
| ^^^^^^ `str` does not have a constant size known at compile-time
|
||||||
|
|
|
||||||
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
|
||||||
|
--> $DIR/const-unsized.rs:23:31
|
||||||
|
|
|
||||||
|
23 | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
|
||||||
|
|
|
||||||
|
= help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
|
||||||
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
|
||||||
|
--> $DIR/const-unsized.rs:28:26
|
||||||
|
|
|
||||||
|
28 | static STATIC_BAR: str = *"bar";
|
||||||
|
| ^^^^^^ `str` does not have a constant size known at compile-time
|
||||||
|
|
|
||||||
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
|
= note: constant expressions must have a statically known size
|
||||||
|
|
||||||
|
error: aborting due to 4 previous errors
|
||||||
|
|
20
src/test/ui/cycle-trait-supertrait-indirect.stderr
Normal file
20
src/test/ui/cycle-trait-supertrait-indirect.stderr
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
error[E0391]: unsupported cyclic reference between types/traits detected
|
||||||
|
--> $DIR/cycle-trait-supertrait-indirect.rs:22:1
|
||||||
|
|
|
||||||
|
22 | trait C: B { }
|
||||||
|
| ^^^^^^^^^^ cyclic reference
|
||||||
|
|
|
||||||
|
note: the cycle begins when computing the supertraits of `B`...
|
||||||
|
--> $DIR/cycle-trait-supertrait-indirect.rs:14:1
|
||||||
|
|
|
||||||
|
14 | trait A: B {
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
note: ...which then requires computing the supertraits of `C`...
|
||||||
|
--> $DIR/cycle-trait-supertrait-indirect.rs:18:1
|
||||||
|
|
|
||||||
|
18 | trait B: C {
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
= note: ...which then again requires computing the supertraits of `B`, completing the cycle.
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
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