Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
Move some `compile-fail` tests to `ui` Re: #44844.
This commit is contained in:
commit
9d6f4e5eea
@ -8,9 +8,10 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern: cycle detected when computing layout of
|
||||
// note-pattern: ...which requires computing layout of
|
||||
// note-pattern: ...which again requires computing layout of
|
||||
//~^^^^^^^^^^ ERROR cycle detected when computing layout of
|
||||
//~| NOTE ...which requires computing layout of
|
||||
//~| NOTE ...which again requires computing layout of
|
||||
//~| NOTE cycle used when compile_codegen_unit
|
||||
|
||||
trait Mirror { type It: ?Sized; }
|
||||
impl<T: ?Sized> Mirror for T { type It = Self; }
|
||||
|
14
src/test/ui/issue-10176.stderr
Normal file
14
src/test/ui/issue-10176.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-10176.rs:12:5
|
||||
|
|
||||
LL | fn f() -> isize {
|
||||
| ----- expected `isize` because of return type
|
||||
LL | (return 1, return 2)
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple
|
||||
|
|
||||
= note: expected type `isize`
|
||||
found type `(!, !)`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
9
src/test/ui/issue-10200.stderr
Normal file
9
src/test/ui/issue-10200.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0532]: expected tuple struct/variant, found function `foo`
|
||||
--> $DIR/issue-10200.rs:16:9
|
||||
|
|
||||
LL | foo(x) //~ ERROR expected tuple struct/variant, found function `foo`
|
||||
| ^^^ did you mean `Foo`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0532`.
|
14
src/test/ui/issue-10291.nll.stderr
Normal file
14
src/test/ui/issue-10291.nll.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
warning: not reporting region error due to nll
|
||||
--> $DIR/issue-10291.rs:13:9
|
||||
|
|
||||
LL | x //~ ERROR E0312
|
||||
| ^
|
||||
|
||||
error: unsatisfied lifetime constraints
|
||||
--> $DIR/issue-10291.rs:12:5
|
||||
|
|
||||
LL | drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ free region requires that `'x` must outlive `'static`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
23
src/test/ui/issue-10291.stderr
Normal file
23
src/test/ui/issue-10291.stderr
Normal file
@ -0,0 +1,23 @@
|
||||
error[E0312]: lifetime of reference outlives lifetime of borrowed content...
|
||||
--> $DIR/issue-10291.rs:13:9
|
||||
|
|
||||
LL | x //~ ERROR E0312
|
||||
| ^
|
||||
|
|
||||
note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 12:65...
|
||||
--> $DIR/issue-10291.rs:12:65
|
||||
|
|
||||
LL | drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
|
||||
| _________________________________________________________________^
|
||||
LL | | x //~ ERROR E0312
|
||||
LL | | }));
|
||||
| |_____^
|
||||
note: ...but the borrowed content is only valid for the lifetime 'x as defined on the function body at 11:9
|
||||
--> $DIR/issue-10291.rs:11:9
|
||||
|
|
||||
LL | fn test<'x>(x: &'x isize) {
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0312`.
|
13
src/test/ui/issue-10398.nll.stderr
Normal file
13
src/test/ui/issue-10398.nll.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0382]: use of moved value: `x`
|
||||
--> $DIR/issue-10398.rs:17:14
|
||||
|
|
||||
LL | let _a = x;
|
||||
| - value moved here
|
||||
LL | drop(x);
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
13
src/test/ui/issue-10398.stderr
Normal file
13
src/test/ui/issue-10398.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0382]: use of moved value: `x`
|
||||
--> $DIR/issue-10398.rs:17:14
|
||||
|
|
||||
LL | let _a = x;
|
||||
| -- value moved here
|
||||
LL | drop(x);
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
16
src/test/ui/issue-10401.stderr
Normal file
16
src/test/ui/issue-10401.stderr
Normal file
@ -0,0 +1,16 @@
|
||||
error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
|
||||
--> $DIR/issue-10401.rs:13:5
|
||||
|
|
||||
LL | a += { "b" };
|
||||
| -^^^^^^^^^^^
|
||||
| |
|
||||
| cannot use `+=` on type `&str`
|
||||
| `+` can't be used to concatenate two `&str` strings
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
|
|
||||
LL | a.to_owned() += { "b" };
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0368`.
|
51
src/test/ui/issue-10412.stderr
Normal file
51
src/test/ui/issue-10412.stderr
Normal file
@ -0,0 +1,51 @@
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:11:20
|
||||
|
|
||||
LL | trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:12:25
|
||||
|
|
||||
LL | fn serialize(val : &'self T) -> Vec<u8>; //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:13:38
|
||||
|
|
||||
LL | fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:16:6
|
||||
|
|
||||
LL | impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:16:36
|
||||
|
|
||||
LL | impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:19:25
|
||||
|
|
||||
LL | fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error: lifetimes cannot use keyword names
|
||||
--> $DIR/issue-10412.rs:22:37
|
||||
|
|
||||
LL | fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/issue-10412.rs:16:13
|
||||
|
|
||||
LL | impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
|
||||
| ^^^^^^^^^^^^^^^^^ expected lifetime parameter
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
13
src/test/ui/issue-10465.stderr
Normal file
13
src/test/ui/issue-10465.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0599]: no method named `foo` found for type `&b::B` in the current scope
|
||||
--> $DIR/issue-10465.rs:27:15
|
||||
|
|
||||
LL | b.foo(); //~ ERROR: no method named `foo` found
|
||||
| ^^^
|
||||
|
|
||||
= help: items from traits can only be used if the trait is in scope
|
||||
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
||||
`use a::A;`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0599`.
|
@ -24,8 +24,10 @@ pub fn main() {
|
||||
foo!();
|
||||
|
||||
assert!({one! two()});
|
||||
//~^ ERROR macros that expand to items must either be surrounded with braces or followed by a
|
||||
|
||||
// regardless of whether nested macro_rules works, the following should at
|
||||
// least throw a conventional error.
|
||||
assert!({one! two});
|
||||
//~^ ERROR expected
|
||||
}
|
14
src/test/ui/issue-10536.stderr
Normal file
14
src/test/ui/issue-10536.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: macros that expand to items must either be surrounded with braces or followed by a semicolon
|
||||
--> $DIR/issue-10536.rs:26:22
|
||||
|
|
||||
LL | assert!({one! two()});
|
||||
| ^^
|
||||
|
||||
error: expected `(` or `{`, found `}`
|
||||
--> $DIR/issue-10536.rs:31:22
|
||||
|
|
||||
LL | assert!({one! two});
|
||||
| ^ expected `(` or `{`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
9
src/test/ui/issue-10545.stderr
Normal file
9
src/test/ui/issue-10545.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0603]: struct `S` is private
|
||||
--> $DIR/issue-10545.rs:17:11
|
||||
|
|
||||
LL | fn foo(_: a::S) { //~ ERROR: struct `S` is private
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0603`.
|
@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern: missing documentation for crate
|
||||
|
||||
#![deny(missing_docs)]
|
||||
#![crate_type="lib"]
|
||||
//~^^ ERROR missing documentation for crate
|
15
src/test/ui/issue-10656.stderr
Normal file
15
src/test/ui/issue-10656.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error: missing documentation for crate
|
||||
--> $DIR/issue-10656.rs:11:1
|
||||
|
|
||||
LL | / #![deny(missing_docs)]
|
||||
LL | | #![crate_type="lib"]
|
||||
| |____________________^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-10656.rs:11:9
|
||||
|
|
||||
LL | #![deny(missing_docs)]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
12
src/test/ui/issue-10764.stderr
Normal file
12
src/test/ui/issue-10764.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-10764.rs:14:15
|
||||
|
|
||||
LL | fn main() { f(bar) }
|
||||
| ^^^ expected "Rust" fn, found "C" fn
|
||||
|
|
||||
= note: expected type `fn()`
|
||||
found type `extern "C" fn() {bar}`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
27
src/test/ui/issue-10877.stderr
Normal file
27
src/test/ui/issue-10877.stderr
Normal file
@ -0,0 +1,27 @@
|
||||
error[E0130]: patterns aren't allowed in foreign function declarations
|
||||
--> $DIR/issue-10877.rs:13:12
|
||||
|
|
||||
LL | fn foo(1: ());
|
||||
| ^ pattern not allowed in foreign function
|
||||
|
||||
error[E0130]: patterns aren't allowed in foreign function declarations
|
||||
--> $DIR/issue-10877.rs:15:12
|
||||
|
|
||||
LL | fn bar((): isize);
|
||||
| ^^ pattern not allowed in foreign function
|
||||
|
||||
error[E0130]: patterns aren't allowed in foreign function declarations
|
||||
--> $DIR/issue-10877.rs:17:12
|
||||
|
|
||||
LL | fn baz(Foo { x }: isize);
|
||||
| ^^^^^^^^^ pattern not allowed in foreign function
|
||||
|
||||
error[E0130]: patterns aren't allowed in foreign function declarations
|
||||
--> $DIR/issue-10877.rs:19:12
|
||||
|
|
||||
LL | fn qux((x,y): ());
|
||||
| ^^^^^ pattern not allowed in foreign function
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0130`.
|
11
src/test/ui/issue-10991.stderr
Normal file
11
src/test/ui/issue-10991.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0605]: non-primitive cast: `()` as `usize`
|
||||
--> $DIR/issue-10991.rs:13:14
|
||||
|
|
||||
LL | let _t = nil as usize; //~ ERROR: non-primitive cast: `()` as `usize`
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0605`.
|
6
src/test/ui/issue-11154.stderr
Normal file
6
src/test/ui/issue-11154.stderr
Normal file
@ -0,0 +1,6 @@
|
||||
error: cannot prefer dynamic linking when performing LTO
|
||||
|
||||
note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO
|
||||
|
||||
error: aborting due to previous error
|
||||
|
18
src/test/ui/issue-11192.nll.stderr
Normal file
18
src/test/ui/issue-11192.nll.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as mutable
|
||||
--> $DIR/issue-11192.rs:30:10
|
||||
|
|
||||
LL | let mut test = |foo: &Foo| {
|
||||
| ----------- mutable borrow occurs here
|
||||
LL | println!("access {}", foo.x);
|
||||
LL | ptr = box Foo { x: ptr.x + 1 };
|
||||
| --- previous borrow occurs due to use of `ptr` in closure
|
||||
...
|
||||
LL | test(&*ptr);
|
||||
| -----^^^^^-
|
||||
| | |
|
||||
| | immutable borrow occurs here
|
||||
| borrow later used here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0502`.
|
18
src/test/ui/issue-11192.stderr
Normal file
18
src/test/ui/issue-11192.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0502]: cannot borrow `*ptr` as immutable because `ptr` is also borrowed as mutable
|
||||
--> $DIR/issue-11192.rs:30:11
|
||||
|
|
||||
LL | let mut test = |foo: &Foo| {
|
||||
| ----------- mutable borrow occurs here
|
||||
LL | println!("access {}", foo.x);
|
||||
LL | ptr = box Foo { x: ptr.x + 1 };
|
||||
| --- previous borrow occurs due to use of `ptr` in closure
|
||||
...
|
||||
LL | test(&*ptr);
|
||||
| ^^^^ immutable borrow occurs here
|
||||
LL | //~^ ERROR: cannot borrow `*ptr` as immutable
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0502`.
|
15
src/test/ui/issue-11374.stderr
Normal file
15
src/test/ui/issue-11374.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-11374.rs:36:15
|
||||
|
|
||||
LL | c.read_to(v); //~ ERROR E0308
|
||||
| ^
|
||||
| |
|
||||
| expected &mut [u8], found struct `std::vec::Vec`
|
||||
| help: consider mutably borrowing here: `&mut v`
|
||||
|
|
||||
= note: expected type `&mut [u8]`
|
||||
found type `std::vec::Vec<_>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
16
src/test/ui/issue-11493.ast.stderr
Normal file
16
src/test/ui/issue-11493.ast.stderr
Normal file
@ -0,0 +1,16 @@
|
||||
error[E0597]: borrowed value does not live long enough (Ast)
|
||||
--> $DIR/issue-11493.rs:20:35
|
||||
|
|
||||
LL | let y = x.as_ref().unwrap_or(&id(5));
|
||||
| ^^^^^ - temporary value dropped here while still borrowed
|
||||
| |
|
||||
| temporary value does not live long enough
|
||||
...
|
||||
LL | }
|
||||
| - temporary value needs to live until here
|
||||
|
|
||||
= note: consider using a `let` binding to increase its lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
16
src/test/ui/issue-11493.mir.stderr
Normal file
16
src/test/ui/issue-11493.mir.stderr
Normal file
@ -0,0 +1,16 @@
|
||||
error[E0597]: borrowed value does not live long enough (Ast)
|
||||
--> $DIR/issue-11493.rs:20:35
|
||||
|
|
||||
LL | let y = x.as_ref().unwrap_or(&id(5));
|
||||
| ^^^^^ - temporary value dropped here while still borrowed
|
||||
| |
|
||||
| temporary value does not live long enough
|
||||
...
|
||||
LL | }
|
||||
| - temporary value needs to live until here
|
||||
|
|
||||
= note: consider using a `let` binding to increase its lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
@ -9,10 +9,16 @@
|
||||
// except according to those terms.
|
||||
|
||||
// This file must never have a trailing newline
|
||||
//
|
||||
// revisions: ast mir
|
||||
// compile-flags: -Z borrowck=compare
|
||||
|
||||
fn id<T>(x: T) -> T { x }
|
||||
|
||||
fn main() {
|
||||
let x = Some(3);
|
||||
let y = x.as_ref().unwrap_or(&id(5)); //~ ERROR: borrowed value does not live long enough
|
||||
let y = x.as_ref().unwrap_or(&id(5));
|
||||
//[ast]~^ ERROR borrowed value does not live long enough (Ast)
|
||||
//[mir]~^^ ERROR borrowed value does not live long enough (Ast)
|
||||
// This actually passes in mir
|
||||
}
|
12
src/test/ui/issue-11515.stderr
Normal file
12
src/test/ui/issue-11515.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-11515.rs:19:33
|
||||
|
|
||||
LL | let test = box Test { func: closure }; //~ ERROR mismatched types
|
||||
| ^^^^^^^ expected trait `std::ops::FnMut`, found trait `std::ops::Fn`
|
||||
|
|
||||
= note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>`
|
||||
found type `std::boxed::Box<(dyn std::ops::Fn() + 'static)>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
18
src/test/ui/issue-11681.stderr
Normal file
18
src/test/ui/issue-11681.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0597]: borrowed value does not live long enough
|
||||
--> $DIR/issue-11681.rs:22:20
|
||||
|
|
||||
LL | let testValue = &Test; //~ ERROR borrowed value does not live long enough
|
||||
| ^^^^ temporary value does not live long enough
|
||||
LL | return testValue;
|
||||
LL | }
|
||||
| - temporary value only lives until here
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:15...
|
||||
--> $DIR/issue-11681.rs:21:15
|
||||
|
|
||||
LL | fn createTest<'a>() -> &'a Test {
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
8
src/test/ui/issue-11692-1.stderr
Normal file
8
src/test/ui/issue-11692-1.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: format argument must be a string literal.
|
||||
--> $DIR/issue-11692-1.rs:12:12
|
||||
|
|
||||
LL | print!(test!());
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
8
src/test/ui/issue-11692-2.stderr
Normal file
8
src/test/ui/issue-11692-2.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: cannot find macro `test!` in this scope
|
||||
--> $DIR/issue-11692-2.rs:12:13
|
||||
|
|
||||
LL | concat!(test!());
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
11
src/test/ui/issue-11740.stderr
Normal file
11
src/test/ui/issue-11740.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error: compilation successful
|
||||
--> $DIR/issue-11740.rs:35:1
|
||||
|
|
||||
LL | / fn main() { //~ ERROR compilation successful
|
||||
LL | | let element = Element { attrs: Vec::new() };
|
||||
LL | | let _ = unsafe { element.get_attr("foo") };
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
19
src/test/ui/issue-11771.stderr
Normal file
19
src/test/ui/issue-11771.stderr
Normal file
@ -0,0 +1,19 @@
|
||||
error[E0277]: cannot add `()` to `{integer}`
|
||||
--> $DIR/issue-11771.rs:13:7
|
||||
|
|
||||
LL | 1 +
|
||||
| ^ no implementation for `{integer} + ()`
|
||||
|
|
||||
= help: the trait `std::ops::Add<()>` is not implemented for `{integer}`
|
||||
|
||||
error[E0277]: cannot add `()` to `{integer}`
|
||||
--> $DIR/issue-11771.rs:18:7
|
||||
|
|
||||
LL | 1 +
|
||||
| ^ no implementation for `{integer} + ()`
|
||||
|
|
||||
= help: the trait `std::ops::Add<()>` is not implemented for `{integer}`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
12
src/test/ui/issue-11844.stderr
Normal file
12
src/test/ui/issue-11844.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-11844.rs:16:9
|
||||
|
|
||||
LL | Ok(a) => //~ ERROR: mismatched types
|
||||
| ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
|
||||
|
|
||||
= note: expected type `std::option::Option<std::boxed::Box<{integer}>>`
|
||||
found type `std::result::Result<_, _>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
14
src/test/ui/issue-11873.nll.stderr
Normal file
14
src/test/ui/issue-11873.nll.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error[E0505]: cannot move out of `v` because it is borrowed
|
||||
--> $DIR/issue-11873.rs:14:14
|
||||
|
|
||||
LL | let mut f = || v.push(2);
|
||||
| ------------ borrow of `v` occurs here
|
||||
LL | let _w = v; //~ ERROR: cannot move out of `v`
|
||||
| ^ move out of `v` occurs here
|
||||
LL |
|
||||
LL | f();
|
||||
| - borrow later used here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0505`.
|
11
src/test/ui/issue-11873.stderr
Normal file
11
src/test/ui/issue-11873.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0505]: cannot move out of `v` because it is borrowed
|
||||
--> $DIR/issue-11873.rs:14:9
|
||||
|
|
||||
LL | let mut f = || v.push(2);
|
||||
| -- borrow of `v` occurs here
|
||||
LL | let _w = v; //~ ERROR: cannot move out of `v`
|
||||
| ^^ move out of `v` occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0505`.
|
9
src/test/ui/issue-12028.stderr
Normal file
9
src/test/ui/issue-12028.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0284]: type annotations required: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::S`
|
||||
--> $DIR/issue-12028.rs:39:14
|
||||
|
|
||||
LL | self.input_stream(&mut stream); //~ ERROR type annotations required
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0284`.
|
11
src/test/ui/issue-12041.nll.stderr
Normal file
11
src/test/ui/issue-12041.nll.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0382]: use of moved value: `tx`
|
||||
--> $DIR/issue-12041.rs:18:22
|
||||
|
|
||||
LL | let tx = tx;
|
||||
| ^^ value moved here in previous iteration of loop
|
||||
|
|
||||
= note: move occurs because `tx` has type `std::sync::mpsc::Sender<i32>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
11
src/test/ui/issue-12041.stderr
Normal file
11
src/test/ui/issue-12041.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0382]: use of moved value: `tx`
|
||||
--> $DIR/issue-12041.rs:18:17
|
||||
|
|
||||
LL | let tx = tx;
|
||||
| ^^ value moved here in previous iteration of loop
|
||||
|
|
||||
= note: move occurs because `tx` has type `std::sync::mpsc::Sender<i32>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
14
src/test/ui/issue-12116.stderr
Normal file
14
src/test/ui/issue-12116.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: unreachable pattern
|
||||
--> $DIR/issue-12116.rs:25:9
|
||||
|
|
||||
LL | &IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, box IntList::Nil),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-12116.rs:15:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
13
src/test/ui/issue-12127.stderr
Normal file
13
src/test/ui/issue-12127.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0382]: use of moved value: `f`
|
||||
--> $DIR/issue-12127.rs:21:9
|
||||
|
|
||||
LL | f();
|
||||
| - value moved here
|
||||
LL | f();
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:18:24: 18:41 x:std::boxed::Box<isize>]`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
14
src/test/ui/issue-12369.stderr
Normal file
14
src/test/ui/issue-12369.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: unreachable pattern
|
||||
--> $DIR/issue-12369.rs:20:9
|
||||
|
|
||||
LL | &[10,a, ref rest..] => 10 //~ ERROR: unreachable pattern
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-12369.rs:12:9
|
||||
|
|
||||
LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
18
src/test/ui/issue-12470.nll.stderr
Normal file
18
src/test/ui/issue-12470.nll.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0597]: `*b` does not live long enough
|
||||
--> $DIR/issue-12470.rs:38:18
|
||||
|
|
||||
LL | let bb: &B = &*b; //~ ERROR does not live long enough
|
||||
| ^^^ borrowed value does not live long enough
|
||||
LL | make_a(bb)
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 36:16...
|
||||
--> $DIR/issue-12470.rs:36:16
|
||||
|
|
||||
LL | fn make_make_a<'a>() -> A<'a> {
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
18
src/test/ui/issue-12470.stderr
Normal file
18
src/test/ui/issue-12470.stderr
Normal file
@ -0,0 +1,18 @@
|
||||
error[E0597]: `*b` does not live long enough
|
||||
--> $DIR/issue-12470.rs:38:19
|
||||
|
|
||||
LL | let bb: &B = &*b; //~ ERROR does not live long enough
|
||||
| ^^ borrowed value does not live long enough
|
||||
LL | make_a(bb)
|
||||
LL | }
|
||||
| - borrowed value only lives until here
|
||||
|
|
||||
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 36:16...
|
||||
--> $DIR/issue-12470.rs:36:16
|
||||
|
|
||||
LL | fn make_make_a<'a>() -> A<'a> {
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0597`.
|
21
src/test/ui/issue-12552.stderr
Normal file
21
src/test/ui/issue-12552.stderr
Normal file
@ -0,0 +1,21 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-12552.rs:16:5
|
||||
|
|
||||
LL | Some(k) => match k { //~ ERROR mismatched types
|
||||
| ^^^^^^^ expected enum `std::result::Result`, found enum `std::option::Option`
|
||||
|
|
||||
= note: expected type `std::result::Result<_, {integer}>`
|
||||
found type `std::option::Option<_>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-12552.rs:19:5
|
||||
|
|
||||
LL | None => () //~ ERROR mismatched types
|
||||
| ^^^^ expected enum `std::result::Result`, found enum `std::option::Option`
|
||||
|
|
||||
= note: expected type `std::result::Result<_, {integer}>`
|
||||
found type `std::option::Option<_>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
31
src/test/ui/issue-12567.nll.stderr
Normal file
31
src/test/ui/issue-12567.nll.stderr
Normal file
@ -0,0 +1,31 @@
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:14:11
|
||||
|
|
||||
LL | match (l1, l2) {
|
||||
| ^^^^^^^^ cannot move out of here
|
||||
help: to prevent move, use ref or ref mut
|
||||
|
|
||||
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
|
||||
| ^^^^^^
|
||||
help: to prevent move, use ref or ref mut
|
||||
|
|
||||
LL | (&[hd1, ..], &[ref hd2, ..])
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:14:11
|
||||
|
|
||||
LL | match (l1, l2) {
|
||||
| ^^^^^^^^ cannot move out of here
|
||||
help: to prevent move, use ref or ref mut
|
||||
|
|
||||
LL | (&[], &[ref hd, ..]) | (&[hd, ..], &[])
|
||||
| ^^^^^^
|
||||
help: to prevent move, use ref or ref mut
|
||||
|
|
||||
LL | (&[ref hd1, ..], &[hd2, ..])
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0508`.
|
39
src/test/ui/issue-12567.stderr
Normal file
39
src/test/ui/issue-12567.stderr
Normal file
@ -0,0 +1,39 @@
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:16:16
|
||||
|
|
||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
||||
| ^--^^^^^
|
||||
| ||
|
||||
| |hint: to prevent move, use `ref hd` or `ref mut hd`
|
||||
| cannot move out of here
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:16:30
|
||||
|
|
||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
||||
| ^--^^^^^
|
||||
| ||
|
||||
| |hint: to prevent move, use `ref hd` or `ref mut hd`
|
||||
| cannot move out of here
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:20:11
|
||||
|
|
||||
LL | (&[hd1, ..], &[hd2, ..])
|
||||
| ^---^^^^^
|
||||
| ||
|
||||
| |hint: to prevent move, use `ref hd1` or `ref mut hd1`
|
||||
| cannot move out of here
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:20:23
|
||||
|
|
||||
LL | (&[hd1, ..], &[hd2, ..])
|
||||
| ^---^^^^^
|
||||
| ||
|
||||
| |hint: to prevent move, use `ref hd2` or `ref mut hd2`
|
||||
| cannot move out of here
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0508`.
|
11
src/test/ui/issue-12796.stderr
Normal file
11
src/test/ui/issue-12796.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0401]: can't use type parameters from outer function
|
||||
--> $DIR/issue-12796.rs:13:22
|
||||
|
|
||||
LL | fn inner(_: &Self) {
|
||||
| ----- ^^^^ use of type variable from outer function
|
||||
| |
|
||||
| help: try using a local type parameter instead: `inner<Self>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0401`.
|
9
src/test/ui/issue-12863.stderr
Normal file
9
src/test/ui/issue-12863.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0532]: expected unit struct/variant or constant, found function `foo::bar`
|
||||
--> $DIR/issue-12863.rs:15:9
|
||||
|
|
||||
LL | foo::bar => {} //~ ERROR expected unit struct/variant or constant, found function `foo::bar`
|
||||
| ^^^^^^^^ not a unit struct/variant or constant
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0532`.
|
14
src/test/ui/issue-12997-1.stderr
Normal file
14
src/test/ui/issue-12997-1.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: functions used as benches must have signature `fn(&mut Bencher) -> impl Termination`
|
||||
--> $DIR/issue-12997-1.rs:16:1
|
||||
|
|
||||
LL | fn foo() { } //~ ERROR functions used as benches
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: functions used as benches must have signature `fn(&mut Bencher) -> impl Termination`
|
||||
--> $DIR/issue-12997-1.rs:19:1
|
||||
|
|
||||
LL | fn bar(x: isize, y: isize) { } //~ ERROR functions used as benches
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
12
src/test/ui/issue-12997-2.stderr
Normal file
12
src/test/ui/issue-12997-2.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-12997-2.rs:16:1
|
||||
|
|
||||
LL | fn bar(x: isize) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference
|
||||
|
|
||||
= note: expected type `isize`
|
||||
found type `&mut __test::test::Bencher`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
15
src/test/ui/issue-13033.stderr
Normal file
15
src/test/ui/issue-13033.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error[E0053]: method `bar` has an incompatible type for trait
|
||||
--> $DIR/issue-13033.rs:18:30
|
||||
|
|
||||
LL | fn bar(&mut self, other: &mut Foo);
|
||||
| -------- type in trait
|
||||
...
|
||||
LL | fn bar(&mut self, other: &Foo) {}
|
||||
| ^^^^ types differ in mutability
|
||||
|
|
||||
= note: expected type `fn(&mut Baz, &mut dyn Foo)`
|
||||
found type `fn(&mut Baz, &dyn Foo)`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0053`.
|
11
src/test/ui/issue-13352.stderr
Normal file
11
src/test/ui/issue-13352.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0277]: cannot add `()` to `usize`
|
||||
--> $DIR/issue-13352.rs:19:13
|
||||
|
|
||||
LL | 2_usize + (loop {});
|
||||
| ^ no implementation for `usize + ()`
|
||||
|
|
||||
= help: the trait `std::ops::Add<()>` is not implemented for `usize`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
15
src/test/ui/issue-13359.stderr
Normal file
15
src/test/ui/issue-13359.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13359.rs:16:9
|
||||
|
|
||||
LL | foo(1*(1 as isize));
|
||||
| ^^^^^^^^^^^^^^ expected i16, found isize
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13359.rs:20:9
|
||||
|
|
||||
LL | bar(1*(1 as usize));
|
||||
| ^^^^^^^^^^^^^^ expected u32, found usize
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
9
src/test/ui/issue-13404.stderr
Normal file
9
src/test/ui/issue-13404.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0432]: unresolved import `b::f`
|
||||
--> $DIR/issue-13404.rs:12:5
|
||||
|
|
||||
LL | use b::f; //~ ERROR: unresolved import `b::f` [E0432]
|
||||
| ^^^^ no `f` in `b`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
25
src/test/ui/issue-13407.stderr
Normal file
25
src/test/ui/issue-13407.stderr
Normal file
@ -0,0 +1,25 @@
|
||||
error[E0603]: unit struct `C` is private
|
||||
--> $DIR/issue-13407.rs:16:5
|
||||
|
|
||||
LL | A::C = 1;
|
||||
| ^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13407.rs:16:12
|
||||
|
|
||||
LL | A::C = 1;
|
||||
| ^ expected struct `A::C`, found integral variable
|
||||
|
|
||||
= note: expected type `A::C`
|
||||
found type `{integer}`
|
||||
|
||||
error[E0070]: invalid left-hand side expression
|
||||
--> $DIR/issue-13407.rs:16:5
|
||||
|
|
||||
LL | A::C = 1;
|
||||
| ^^^^^^^^ left-hand of expression not valid
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors occurred: E0070, E0308, E0603.
|
||||
For more information about an error, try `rustc --explain E0070`.
|
13
src/test/ui/issue-13446.stderr
Normal file
13
src/test/ui/issue-13446.stderr
Normal file
@ -0,0 +1,13 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13446.rs:16:26
|
||||
|
|
||||
LL | static VEC: [u32; 256] = vec![];
|
||||
| ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec`
|
||||
|
|
||||
= note: expected type `[u32; 256]`
|
||||
found type `std::vec::Vec<_>`
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
21
src/test/ui/issue-13466.stderr
Normal file
21
src/test/ui/issue-13466.stderr
Normal file
@ -0,0 +1,21 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13466.rs:18:9
|
||||
|
|
||||
LL | Ok(u) => u,
|
||||
| ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
|
||||
|
|
||||
= note: expected type `std::option::Option<{integer}>`
|
||||
found type `std::result::Result<_, _>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13466.rs:24:9
|
||||
|
|
||||
LL | Err(e) => panic!(e)
|
||||
| ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result`
|
||||
|
|
||||
= note: expected type `std::option::Option<{integer}>`
|
||||
found type `std::result::Result<_, _>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
9
src/test/ui/issue-13482-2.stderr
Normal file
9
src/test/ui/issue-13482-2.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0527]: pattern requires 0 elements but array has 2
|
||||
--> $DIR/issue-13482-2.rs:16:9
|
||||
|
|
||||
LL | [] => None, //~ ERROR pattern requires 0 elements but array has 2
|
||||
| ^^ expected 2 elements
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0527`.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user