diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-11-20 13:13:27 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-11-24 11:32:35 +0100 |
| commit | 8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584 (patch) | |
| tree | 985b86728dbbcb631149b9f77ba18d435f60f798 /src/test/ui/span | |
| parent | 36066d8925940cdd423886a2eec2a096363f5bb8 (diff) | |
| download | rust-8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584.tar.gz rust-8937d6a6cfb011d9e1fe6b4a426913dbbf9fd584.zip | |
Merge cfail and ui tests into ui tests
Diffstat (limited to 'src/test/ui/span')
98 files changed, 314 insertions, 297 deletions
diff --git a/src/test/ui/span/E0072.rs b/src/test/ui/span/E0072.rs index 18ade4f1ab6..554dfc619d7 100644 --- a/src/test/ui/span/E0072.rs +++ b/src/test/ui/span/E0072.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct ListNode { +struct ListNode { //~ ERROR has infinite size head: u8, tail: Option<ListNode>, } diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr index 1f6dd6b1d16..82b8579d5a1 100644 --- a/src/test/ui/span/E0072.stderr +++ b/src/test/ui/span/E0072.stderr @@ -1,7 +1,7 @@ error[E0072]: recursive type `ListNode` has infinite size --> $DIR/E0072.rs:11:1 | -11 | struct ListNode { +11 | struct ListNode { //~ ERROR has infinite size | ^^^^^^^^^^^^^^^ recursive type has infinite size 12 | head: u8, 13 | tail: Option<ListNode>, diff --git a/src/test/ui/span/E0204.rs b/src/test/ui/span/E0204.rs index 9fb37607c7d..0ad6b67330d 100644 --- a/src/test/ui/span/E0204.rs +++ b/src/test/ui/span/E0204.rs @@ -12,9 +12,9 @@ struct Foo { foo: Vec<u32>, } -impl Copy for Foo { } +impl Copy for Foo { } //~ ERROR may not be implemented for this type -#[derive(Copy)] +#[derive(Copy)] //~ ERROR may not be implemented for this type struct Foo2<'a> { ty: &'a mut bool, } @@ -24,9 +24,9 @@ enum EFoo { Baz, } -impl Copy for EFoo { } +impl Copy for EFoo { } //~ ERROR may not be implemented for this type -#[derive(Copy)] +#[derive(Copy)] //~ ERROR may not be implemented for this type enum EFoo2<'a> { Bar(&'a mut bool), Baz, diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr index 4fe6afaca8e..0d9617c4c73 100644 --- a/src/test/ui/span/E0204.stderr +++ b/src/test/ui/span/E0204.stderr @@ -4,13 +4,13 @@ error[E0204]: the trait `Copy` may not be implemented for this type 12 | foo: Vec<u32>, | ------------- this field does not implement `Copy` ... -15 | impl Copy for Foo { } +15 | impl Copy for Foo { } //~ ERROR may not be implemented for this type | ^^^^ error[E0204]: the trait `Copy` may not be implemented for this type --> $DIR/E0204.rs:17:10 | -17 | #[derive(Copy)] +17 | #[derive(Copy)] //~ ERROR may not be implemented for this type | ^^^^ 18 | struct Foo2<'a> { 19 | ty: &'a mut bool, @@ -22,13 +22,13 @@ error[E0204]: the trait `Copy` may not be implemented for this type 23 | Bar { x: Vec<u32> }, | ----------- this field does not implement `Copy` ... -27 | impl Copy for EFoo { } +27 | impl Copy for EFoo { } //~ ERROR may not be implemented for this type | ^^^^ error[E0204]: the trait `Copy` may not be implemented for this type --> $DIR/E0204.rs:29:10 | -29 | #[derive(Copy)] +29 | #[derive(Copy)] //~ ERROR may not be implemented for this type | ^^^^ 30 | enum EFoo2<'a> { 31 | Bar(&'a mut bool), diff --git a/src/test/ui/span/E0493.rs b/src/test/ui/span/E0493.rs index 7915564cafb..de81068e268 100644 --- a/src/test/ui/span/E0493.rs +++ b/src/test/ui/span/E0493.rs @@ -25,6 +25,7 @@ impl Drop for Bar { } const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1; +//~^ destructors cannot be evaluated at compile-time fn main() { } diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs index 29fea052b06..1c45771ff8a 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs @@ -24,6 +24,7 @@ fn call<F>(mut f: F) where F: FnMut(Fn) { //~| NOTE first mutable borrow occurs here //~| NOTE second mutable borrow occurs here f((Box::new(|| {}))) + //~^ NOTE borrow occurs due to use of `f` in closure })); //~^ NOTE first borrow ends here } @@ -66,7 +67,7 @@ fn test6() { fn test7() { fn foo<F>(_: F) where F: FnMut(Box<FnMut(isize)>, isize) {} let mut f = |g: Box<FnMut(isize)>, b: isize| {}; - //~^ NOTE moved + //~^ NOTE captured outer variable f(Box::new(|a| { //~^ NOTE borrow of `f` occurs here foo(f); diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr index 6e7d0c17f1d..0a1429d5509 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -8,43 +8,44 @@ error[E0499]: cannot borrow `f` as mutable more than once at a time ... 26 | f((Box::new(|| {}))) | - borrow occurs due to use of `f` in closure -27 | })); +27 | //~^ NOTE borrow occurs due to use of `f` in closure +28 | })); | - first borrow ends here error[E0596]: cannot borrow immutable borrowed content `*f` as mutable - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:39:5 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:40:5 | -37 | fn test2<F>(f: &F) where F: FnMut() { +38 | fn test2<F>(f: &F) where F: FnMut() { | -- use `&mut F` here to make mutable -38 | //~^ NOTE use `&mut F` here to make mutable -39 | (*f)(); +39 | //~^ NOTE use `&mut F` here to make mutable +40 | (*f)(); | ^^^^ cannot borrow as mutable error[E0596]: cannot borrow immutable `Box` content `*f.f` as mutable - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:50:5 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:51:5 | -48 | fn test4(f: &Test) { +49 | fn test4(f: &Test) { | ----- use `&mut Test` here to make mutable -49 | //~^ NOTE use `&mut Test` here to make mutable -50 | f.f.call_mut(()) +50 | //~^ NOTE use `&mut Test` here to make mutable +51 | f.f.call_mut(()) | ^^^ cannot borrow as mutable error[E0504]: cannot move `f` into closure because it is borrowed - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:73:13 | -70 | f(Box::new(|a| { +71 | f(Box::new(|a| { | - borrow of `f` occurs here -71 | //~^ NOTE borrow of `f` occurs here -72 | foo(f); +72 | //~^ NOTE borrow of `f` occurs here +73 | foo(f); | ^ move into closure occurs here error[E0507]: cannot move out of captured outer variable in an `FnMut` closure - --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13 + --> $DIR/borrowck-call-is-borrow-issue-12224.rs:73:13 | -68 | let mut f = |g: Box<FnMut(isize)>, b: isize| {}; +69 | let mut f = |g: Box<FnMut(isize)>, b: isize| {}; | ----- captured outer variable ... -72 | foo(f); +73 | foo(f); | ^ cannot move out of captured outer variable in an `FnMut` closure error: aborting due to 5 previous errors diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs index 9e316b989a4..b31ba324b0c 100644 --- a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs +++ b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs @@ -26,7 +26,7 @@ fn f() { v3.push(&id('x')); // statement 6 //~^ ERROR borrowed value does not live long enough //~| NOTE temporary value created here - //~| NOTE temporary value only lives until here + //~| NOTE temporary value dropped here while still borrowed //~| NOTE consider using a `let` binding to increase its lifetime { @@ -36,7 +36,7 @@ fn f() { v4.push(&id('y')); //~^ ERROR borrowed value does not live long enough //~| NOTE temporary value created here - //~| NOTE temporary value only lives until here + //~| NOTE temporary value dropped here while still borrowed //~| NOTE consider using a `let` binding to increase its lifetime } // (statement 7) @@ -47,7 +47,7 @@ fn f() { v5.push(&id('z')); //~^ ERROR borrowed value does not live long enough //~| NOTE temporary value created here - //~| NOTE temporary value only lives until here + //~| NOTE temporary value dropped here while still borrowed //~| NOTE consider using a `let` binding to increase its lifetime v1.push(&old[0]); diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.rs b/src/test/ui/span/borrowck-ref-into-rvalue.rs index 726d4bcdf1d..a059232daca 100644 --- a/src/test/ui/span/borrowck-ref-into-rvalue.rs +++ b/src/test/ui/span/borrowck-ref-into-rvalue.rs @@ -11,10 +11,10 @@ fn main() { let msg; match Some("Hello".to_string()) { - Some(ref m) => { //~ ERROR borrowed value does not live long enough + Some(ref m) => { msg = m; }, None => { panic!() } - } + } //~ ERROR borrowed value does not live long enough println!("{}", *msg); } diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.stderr b/src/test/ui/span/borrowck-ref-into-rvalue.stderr index ced1f762af4..91f9cddd589 100644 --- a/src/test/ui/span/borrowck-ref-into-rvalue.stderr +++ b/src/test/ui/span/borrowck-ref-into-rvalue.stderr @@ -1,10 +1,10 @@ error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-ref-into-rvalue.rs:18:5 | -14 | Some(ref m) => { //~ ERROR borrowed value does not live long enough +14 | Some(ref m) => { | ----- borrow occurs here ... -18 | } +18 | } //~ ERROR borrowed value does not live long enough | ^ borrowed value dropped here while still borrowed 19 | println!("{}", *msg); 20 | } diff --git a/src/test/ui/span/coerce-suggestions.rs b/src/test/ui/span/coerce-suggestions.rs index 32d80069f00..a1a250b0e9a 100644 --- a/src/test/ui/span/coerce-suggestions.rs +++ b/src/test/ui/span/coerce-suggestions.rs @@ -18,37 +18,26 @@ fn main() { //~^ ERROR E0308 //~| NOTE expected usize, found struct `std::string::String` //~| NOTE expected type `usize` - //~| NOTE found type `std::string::String` //~| HELP here are some functions which might fulfill your needs: let x: &str = String::new(); //~^ ERROR E0308 //~| NOTE expected &str, found struct `std::string::String` //~| NOTE expected type `&str` - //~| NOTE found type `std::string::String` //~| HELP try with `&String::new()` let y = String::new(); test(&y); //~^ ERROR E0308 //~| NOTE types differ in mutability //~| NOTE expected type `&mut std::string::String` - //~| NOTE found type `&std::string::String` test2(&y); //~^ ERROR E0308 //~| NOTE types differ in mutability //~| NOTE expected type `&mut i32` - //~| NOTE found type `&std::string::String` let f; f = box f; //~^ ERROR E0308 //~| NOTE cyclic type of infinite size - //~| NOTE expected type `_` - //~| NOTE found type `Box<_>` let s = &mut String::new(); s = format!("foo"); - //~^ ERROR E0308 - //~| NOTE expected mutable reference, found struct `std::string::String` - //~| NOTE expected type `&mut std::string::String` - //~| HELP try with `&mut format!("foo")` - //~| NOTE this error originates in a macro outside of the current crate } diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 5bd6ef806b5..73169e86a1c 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -11,9 +11,9 @@ error[E0308]: mismatched types - .len() error[E0308]: mismatched types - --> $DIR/coerce-suggestions.rs:23:19 + --> $DIR/coerce-suggestions.rs:22:19 | -23 | let x: &str = String::new(); +22 | let x: &str = String::new(); | ^^^^^^^^^^^^^ expected &str, found struct `std::string::String` | = note: expected type `&str` @@ -21,33 +21,33 @@ error[E0308]: mismatched types = help: try with `&String::new()` error[E0308]: mismatched types - --> $DIR/coerce-suggestions.rs:30:10 + --> $DIR/coerce-suggestions.rs:28:10 | -30 | test(&y); +28 | test(&y); | ^^ types differ in mutability | = note: expected type `&mut std::string::String` found type `&std::string::String` error[E0308]: mismatched types - --> $DIR/coerce-suggestions.rs:35:11 + --> $DIR/coerce-suggestions.rs:32:11 | -35 | test2(&y); +32 | test2(&y); | ^^ types differ in mutability | = note: expected type `&mut i32` found type `&std::string::String` error[E0308]: mismatched types - --> $DIR/coerce-suggestions.rs:41:9 + --> $DIR/coerce-suggestions.rs:37:9 | -41 | f = box f; +37 | f = box f; | ^^^^^ cyclic type of infinite size error[E0308]: mismatched types - --> $DIR/coerce-suggestions.rs:48:9 + --> $DIR/coerce-suggestions.rs:42:9 | -48 | s = format!("foo"); +42 | s = format!("foo"); | ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String` | = note: expected type `&mut std::string::String` diff --git a/src/test/ui/span/destructor-restrictions.rs b/src/test/ui/span/destructor-restrictions.rs index 22f615cafd7..7c80867856d 100644 --- a/src/test/ui/span/destructor-restrictions.rs +++ b/src/test/ui/span/destructor-restrictions.rs @@ -15,7 +15,7 @@ use std::cell::RefCell; fn main() { let b = { let a = Box::new(RefCell::new(4)); - *a.borrow() + 1 //~ ERROR `*a` does not live long enough - }; + *a.borrow() + 1 + }; //~ ERROR `*a` does not live long enough println!("{}", b); } diff --git a/src/test/ui/span/destructor-restrictions.stderr b/src/test/ui/span/destructor-restrictions.stderr index ee885454169..e6d24d7c135 100644 --- a/src/test/ui/span/destructor-restrictions.stderr +++ b/src/test/ui/span/destructor-restrictions.stderr @@ -1,9 +1,9 @@ error[E0597]: `*a` does not live long enough --> $DIR/destructor-restrictions.rs:19:5 | -18 | *a.borrow() + 1 //~ ERROR `*a` does not live long enough +18 | *a.borrow() + 1 | - borrow occurs here -19 | }; +19 | }; //~ ERROR `*a` does not live long enough | ^- borrowed value needs to live until here | | | `*a` dropped here while still borrowed diff --git a/src/test/ui/span/gated-features-attr-spans.rs b/src/test/ui/span/gated-features-attr-spans.rs index d5ccd2ea7ad..ace185d0169 100644 --- a/src/test/ui/span/gated-features-attr-spans.rs +++ b/src/test/ui/span/gated-features-attr-spans.rs @@ -10,14 +10,14 @@ #![feature(attr_literals)] -#[repr(align(16))] +#[repr(align(16))] //~ ERROR is experimental struct Gem { mohs_hardness: u8, poofed: bool, weapon: Weapon, } -#[repr(simd)] +#[repr(simd)] //~ ERROR are experimental struct Weapon { name: String, damage: u32 @@ -25,9 +25,10 @@ struct Weapon { impl Gem { #[must_use] fn summon_weapon(&self) -> Weapon { self.weapon } + //~^ WARN is experimental } -#[must_use] +#[must_use] //~ WARN is experimental fn bubble(gem: Gem) -> Result<Gem, ()> { if gem.poofed { Ok(gem) diff --git a/src/test/ui/span/gated-features-attr-spans.stderr b/src/test/ui/span/gated-features-attr-spans.stderr index 66b2567f728..d067470942e 100644 --- a/src/test/ui/span/gated-features-attr-spans.stderr +++ b/src/test/ui/span/gated-features-attr-spans.stderr @@ -1,7 +1,7 @@ error: the struct `#[repr(align(u16))]` attribute is experimental (see issue #33626) --> $DIR/gated-features-attr-spans.rs:13:1 | -13 | #[repr(align(16))] +13 | #[repr(align(16))] //~ ERROR is experimental | ^^^^^^^^^^^^^^^^^^ | = help: add #![feature(repr_align)] to the crate attributes to enable @@ -9,7 +9,7 @@ error: the struct `#[repr(align(u16))]` attribute is experimental (see issue #33 error: SIMD types are experimental and possibly buggy (see issue #27731) --> $DIR/gated-features-attr-spans.rs:20:1 | -20 | #[repr(simd)] +20 | #[repr(simd)] //~ ERROR are experimental | ^^^^^^^^^^^^^ | = help: add #![feature(repr_simd)] to the crate attributes to enable @@ -23,9 +23,9 @@ warning: `#[must_use]` on methods is experimental (see issue #43302) = help: add #![feature(fn_must_use)] to the crate attributes to enable warning: `#[must_use]` on functions is experimental (see issue #43302) - --> $DIR/gated-features-attr-spans.rs:30:1 + --> $DIR/gated-features-attr-spans.rs:31:1 | -30 | #[must_use] +31 | #[must_use] //~ WARN is experimental | ^^^^^^^^^^^ | = help: add #![feature(fn_must_use)] to the crate attributes to enable diff --git a/src/test/ui/span/impl-wrong-item-for-trait.rs b/src/test/ui/span/impl-wrong-item-for-trait.rs index 091df1d5dc8..d4aafabed37 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.rs +++ b/src/test/ui/span/impl-wrong-item-for-trait.rs @@ -13,7 +13,13 @@ use std::fmt::Debug; trait Foo { fn bar(&self); + //~^ NOTE item in trait + //~| NOTE `bar` from trait + //~| NOTE item in trait + //~| NOTE `bar` from trait const MY_CONST: u32; + //~^ NOTE item in trait + //~| NOTE `MY_CONST` from trait } pub struct FooConstForMethod; @@ -46,10 +52,15 @@ impl Foo for FooTypeForMethod { type bar = u64; //~^ ERROR E0325 //~| NOTE does not match trait + //~| NOTE not a member + //~| ERROR E0437 const MY_CONST: u32 = 1; } impl Debug for FooTypeForMethod { } +//~^^ ERROR E0046 +//~| NOTE missing `fmt` in implementation +//~| NOTE `fmt` from trait: fn main () {} diff --git a/src/test/ui/span/impl-wrong-item-for-trait.stderr b/src/test/ui/span/impl-wrong-item-for-trait.stderr index 5812cab0d05..dfca435f2a0 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.stderr +++ b/src/test/ui/span/impl-wrong-item-for-trait.stderr @@ -1,86 +1,86 @@ error[E0437]: type `bar` is not a member of trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:46:5 + --> $DIR/impl-wrong-item-for-trait.rs:52:5 | -46 | type bar = u64; +52 | type bar = u64; | ^^^^^^^^^^^^^^^ not a member of trait `Foo` error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:24:5 + --> $DIR/impl-wrong-item-for-trait.rs:30:5 | 15 | fn bar(&self); | -------------- item in trait ... -24 | const bar: u64 = 1; +30 | const bar: u64 = 1; | ^^^^^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `bar` - --> $DIR/impl-wrong-item-for-trait.rs:21:1 + --> $DIR/impl-wrong-item-for-trait.rs:27:1 | 15 | fn bar(&self); | -------------- `bar` from trait ... -21 | / impl Foo for FooConstForMethod { -22 | | //~^ ERROR E0046 -23 | | //~| NOTE missing `bar` in implementation -24 | | const bar: u64 = 1; +27 | / impl Foo for FooConstForMethod { +28 | | //~^ ERROR E0046 +29 | | //~| NOTE missing `bar` in implementation +30 | | const bar: u64 = 1; ... | -27 | | const MY_CONST: u32 = 1; -28 | | } +33 | | const MY_CONST: u32 = 1; +34 | | } | |_^ missing `bar` in implementation error[E0324]: item `MY_CONST` is an associated method, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:36:5 + --> $DIR/impl-wrong-item-for-trait.rs:42:5 | -16 | const MY_CONST: u32; +20 | const MY_CONST: u32; | -------------------- item in trait ... -36 | fn MY_CONST() {} +42 | fn MY_CONST() {} | ^^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `MY_CONST` - --> $DIR/impl-wrong-item-for-trait.rs:32:1 + --> $DIR/impl-wrong-item-for-trait.rs:38:1 | -16 | const MY_CONST: u32; +20 | const MY_CONST: u32; | -------------------- `MY_CONST` from trait ... -32 | / impl Foo for FooMethodForConst { -33 | | //~^ ERROR E0046 -34 | | //~| NOTE missing `MY_CONST` in implementation -35 | | fn bar(&self) {} +38 | / impl Foo for FooMethodForConst { +39 | | //~^ ERROR E0046 +40 | | //~| NOTE missing `MY_CONST` in implementation +41 | | fn bar(&self) {} ... | -38 | | //~| NOTE does not match trait -39 | | } +44 | | //~| NOTE does not match trait +45 | | } | |_^ missing `MY_CONST` in implementation error[E0325]: item `bar` is an associated type, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:46:5 + --> $DIR/impl-wrong-item-for-trait.rs:52:5 | 15 | fn bar(&self); | -------------- item in trait ... -46 | type bar = u64; +52 | type bar = u64; | ^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `bar` - --> $DIR/impl-wrong-item-for-trait.rs:43:1 + --> $DIR/impl-wrong-item-for-trait.rs:49:1 | 15 | fn bar(&self); | -------------- `bar` from trait ... -43 | / impl Foo for FooTypeForMethod { -44 | | //~^ ERROR E0046 -45 | | //~| NOTE missing `bar` in implementation -46 | | type bar = u64; +49 | / impl Foo for FooTypeForMethod { +50 | | //~^ ERROR E0046 +51 | | //~| NOTE missing `bar` in implementation +52 | | type bar = u64; ... | -49 | | const MY_CONST: u32 = 1; -50 | | } +57 | | const MY_CONST: u32 = 1; +58 | | } | |_^ missing `bar` in implementation error[E0046]: not all trait items implemented, missing: `fmt` - --> $DIR/impl-wrong-item-for-trait.rs:52:1 + --> $DIR/impl-wrong-item-for-trait.rs:60:1 | -52 | / impl Debug for FooTypeForMethod { -53 | | } +60 | / impl Debug for FooTypeForMethod { +61 | | } | |_^ missing `fmt` in implementation | = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` diff --git a/src/test/ui/span/issue-11925.rs b/src/test/ui/span/issue-11925.rs index 7bea8642cce..fd5625f6892 100644 --- a/src/test/ui/span/issue-11925.rs +++ b/src/test/ui/span/issue-11925.rs @@ -15,7 +15,7 @@ fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f } fn main() { let r = { let x: Box<_> = box 42; - let f = to_fn_once(move|| &x); + let f = to_fn_once(move|| &x); //~ ERROR does not live long enough f() }; diff --git a/src/test/ui/span/issue-11925.stderr b/src/test/ui/span/issue-11925.stderr index 6b2942bc7a8..057ccc8d677 100644 --- a/src/test/ui/span/issue-11925.stderr +++ b/src/test/ui/span/issue-11925.stderr @@ -1,7 +1,7 @@ error[E0597]: `x` does not live long enough --> $DIR/issue-11925.rs:18:36 | -18 | let f = to_fn_once(move|| &x); +18 | let f = to_fn_once(move|| &x); //~ ERROR does not live long enough | ^ | | | borrow occurs here diff --git a/src/test/ui/span/issue-15480.rs b/src/test/ui/span/issue-15480.rs index 871e0af50bf..90f3e1fd00a 100644 --- a/src/test/ui/span/issue-15480.rs +++ b/src/test/ui/span/issue-15480.rs @@ -13,7 +13,7 @@ fn id<T>(x: T) -> T { x } fn main() { let v = vec![ &id(3) - ]; + ]; //~ ERROR borrowed value does not live long enough for &&x in &v { println!("{}", x + 3); diff --git a/src/test/ui/span/issue-15480.stderr b/src/test/ui/span/issue-15480.stderr index 7f4ca19241c..4d2e6f8374c 100644 --- a/src/test/ui/span/issue-15480.stderr +++ b/src/test/ui/span/issue-15480.stderr @@ -3,7 +3,7 @@ error[E0597]: borrowed value does not live long enough | 15 | &id(3) | ----- temporary value created here -16 | ]; +16 | ]; //~ ERROR borrowed value does not live long enough | ^ temporary value dropped here while still borrowed ... 21 | } diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs index a04edd99b8b..583c5690621 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs @@ -24,8 +24,8 @@ fn foo(x: RefCell<String>) -> String { fn foo2(x: RefCell<String>) -> String { let ret = { let y = x; - y.borrow().clone() //~ ERROR `y` does not live long enough - }; + y.borrow().clone() + }; //~ ERROR `y` does not live long enough ret } diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr index 02c03315372..090cf1d924b 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr @@ -11,9 +11,9 @@ error[E0597]: `y` does not live long enough error[E0597]: `y` does not live long enough --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:28:5 | -27 | y.borrow().clone() //~ ERROR `y` does not live long enough +27 | y.borrow().clone() | - borrow occurs here -28 | }; +28 | }; //~ ERROR `y` does not live long enough | ^- borrowed value needs to live until here | | | `y` dropped here while still borrowed diff --git a/src/test/ui/span/issue-24690.rs b/src/test/ui/span/issue-24690.rs index f59d2845108..041ca6c426c 100644 --- a/src/test/ui/span/issue-24690.rs +++ b/src/test/ui/span/issue-24690.rs @@ -18,8 +18,9 @@ #![warn(unused)] #[rustc_error] -fn main() { - let theTwo = 2; - let theOtherTwo = 2; +fn main() { //~ ERROR compilation successful + let theTwo = 2; //~ WARN should have a snake case name + let theOtherTwo = 2; //~ WARN should have a snake case name + //~^ WARN unused variable println!("{}", theTwo); } diff --git a/src/test/ui/span/issue-24690.stderr b/src/test/ui/span/issue-24690.stderr index 718720ebf83..7e19c7492ce 100644 --- a/src/test/ui/span/issue-24690.stderr +++ b/src/test/ui/span/issue-24690.stderr @@ -1,7 +1,7 @@ warning: unused variable: `theOtherTwo` --> $DIR/issue-24690.rs:23:9 | -23 | let theOtherTwo = 2; +23 | let theOtherTwo = 2; //~ WARN should have a snake case name | ^^^^^^^^^^^ | note: lint level defined here @@ -15,7 +15,7 @@ note: lint level defined here warning: variable `theTwo` should have a snake case name such as `the_two` --> $DIR/issue-24690.rs:22:9 | -22 | let theTwo = 2; +22 | let theTwo = 2; //~ WARN should have a snake case name | ^^^^^^ | = note: #[warn(non_snake_case)] on by default @@ -23,16 +23,17 @@ warning: variable `theTwo` should have a snake case name such as `the_two` warning: variable `theOtherTwo` should have a snake case name such as `the_other_two` --> $DIR/issue-24690.rs:23:9 | -23 | let theOtherTwo = 2; +23 | let theOtherTwo = 2; //~ WARN should have a snake case name | ^^^^^^^^^^^ error: compilation successful --> $DIR/issue-24690.rs:21:1 | -21 | / fn main() { -22 | | let theTwo = 2; -23 | | let theOtherTwo = 2; -24 | | println!("{}", theTwo); -25 | | } +21 | / fn main() { //~ ERROR compilation successful +22 | | let theTwo = 2; //~ WARN should have a snake case name +23 | | let theOtherTwo = 2; //~ WARN should have a snake case name +24 | | //~^ WARN unused variable +25 | | println!("{}", theTwo); +26 | | } | |_^ diff --git a/src/test/ui/span/issue-27522.rs b/src/test/ui/span/issue-27522.rs index 81fcb007eb4..1e3eba4bf36 100644 --- a/src/test/ui/span/issue-27522.rs +++ b/src/test/ui/span/issue-27522.rs @@ -13,7 +13,7 @@ struct SomeType {} trait Foo { - fn handler(self: &SomeType); + fn handler(self: &SomeType); //~ ERROR invalid `self` type } fn main() {} diff --git a/src/test/ui/span/issue-27522.stderr b/src/test/ui/span/issue-27522.stderr index e12fb57f15d..dc02ad73ee2 100644 --- a/src/test/ui/span/issue-27522.stderr +++ b/src/test/ui/span/issue-27522.stderr @@ -1,7 +1,7 @@ error[E0307]: invalid `self` type: &SomeType --> $DIR/issue-27522.rs:16:22 | -16 | fn handler(self: &SomeType); +16 | fn handler(self: &SomeType); //~ ERROR invalid `self` type | ^^^^^^^^^ | = note: type must be `Self` or a type that dereferences to it` diff --git a/src/test/ui/span/issue-34264.rs b/src/test/ui/span/issue-34264.rs index 00482f50618..8baa381fb2d 100644 --- a/src/test/ui/span/issue-34264.rs +++ b/src/test/ui/span/issue-34264.rs @@ -8,13 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(Option<i32>, String) {} -fn bar(x, y: usize) {} +fn foo(Option<i32>, String) {} //~ ERROR expected one of +//~^ ERROR expected one of +fn bar(x, y: usize) {} //~ ERROR expected one of fn main() { foo(Some(42), 2); - foo(Some(42), 2, ""); - bar("", ""); + foo(Some(42), 2, ""); //~ ERROR this function takes + bar("", ""); //~ ERROR mismatched types bar(1, 2); - bar(1, 2, 3); + bar(1, 2, 3); //~ ERROR this function takes } diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index e25caacac8f..6ab92cab83d 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -1,34 +1,34 @@ error: expected one of `:` or `@`, found `<` --> $DIR/issue-34264.rs:11:14 | -11 | fn foo(Option<i32>, String) {} +11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of | ^ expected one of `:` or `@` here error: expected one of `:` or `@`, found `)` --> $DIR/issue-34264.rs:11:27 | -11 | fn foo(Option<i32>, String) {} +11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of | ^ expected one of `:` or `@` here error: expected one of `:` or `@`, found `,` - --> $DIR/issue-34264.rs:12:9 + --> $DIR/issue-34264.rs:13:9 | -12 | fn bar(x, y: usize) {} +13 | fn bar(x, y: usize) {} //~ ERROR expected one of | ^ expected one of `:` or `@` here error[E0061]: this function takes 2 parameters but 3 parameters were supplied - --> $DIR/issue-34264.rs:16:9 + --> $DIR/issue-34264.rs:17:9 | -11 | fn foo(Option<i32>, String) {} +11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of | ------------------------------ defined here ... -16 | foo(Some(42), 2, ""); +17 | foo(Some(42), 2, ""); //~ ERROR this function takes | ^^^^^^^^^^^^^^^ expected 2 parameters error[E0308]: mismatched types - --> $DIR/issue-34264.rs:17:13 + --> $DIR/issue-34264.rs:18:13 | -17 | bar("", ""); +18 | bar("", ""); //~ ERROR mismatched types | ^^ expected usize, found reference | = note: expected type `usize` @@ -37,12 +37,12 @@ error[E0308]: mismatched types - .len() error[E0061]: this function takes 2 parameters but 3 parameters were supplied - --> $DIR/issue-34264.rs:19:9 + --> $DIR/issue-34264.rs:20:9 | -12 | fn bar(x, y: usize) {} +13 | fn bar(x, y: usize) {} //~ ERROR expected one of | ---------------------- defined here ... -19 | bar(1, 2, 3); +20 | bar(1, 2, 3); //~ ERROR this function takes | ^^^^^^^ expected 2 parameters error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-35987.rs b/src/test/ui/span/issue-35987.rs index 8ff5f3b8398..fa0410686c2 100644 --- a/src/test/ui/span/issue-35987.rs +++ b/src/test/ui/span/issue-35987.rs @@ -13,6 +13,7 @@ struct Foo<T: Clone>(T); use std::ops::Add; impl<T: Clone, Add> Add for Foo<T> { +//~^ ERROR expected trait, found type parameter type Output = usize; fn add(self, rhs: Self) -> Self::Output { diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs index 893c2168c2e..c6cdb8b6db7 100644 --- a/src/test/ui/span/issue-36530.rs +++ b/src/test/ui/span/issue-36530.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[foo] +#[foo] //~ ERROR is currently unknown to the compiler mod foo { - #![foo] + #![foo] //~ ERROR is currently unknown to the compiler } diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr index dc6190c2e76..50908b2ca39 100644 --- a/src/test/ui/span/issue-36530.stderr +++ b/src/test/ui/span/issue-36530.stderr @@ -1,7 +1,7 @@ error: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) --> $DIR/issue-36530.rs:11:1 | -11 | #[foo] +11 | #[foo] //~ ERROR is currently unknown to the compiler | ^^^^^^ | = help: add #![feature(custom_attribute)] to the crate attributes to enable @@ -9,7 +9,7 @@ error: The attribute `foo` is currently unknown to the compiler and may have mea error: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) --> $DIR/issue-36530.rs:13:5 | -13 | #![foo] +13 | #![foo] //~ ERROR is currently unknown to the compiler | ^^^^^^^ | = help: add #![feature(custom_attribute)] to the crate attributes to enable diff --git a/src/test/ui/span/issue-37767.rs b/src/test/ui/span/issue-37767.rs index 49ad40259d9..2b0250d332d 100644 --- a/src/test/ui/span/issue-37767.rs +++ b/src/test/ui/span/issue-37767.rs @@ -17,7 +17,7 @@ trait B : A { } fn bar<T: B>(a: &T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } trait C { @@ -29,7 +29,7 @@ trait D : C { } fn quz<T: D>(a: &T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } trait E : Sized { @@ -41,7 +41,7 @@ trait F : E { } fn foo<T: F>(a: T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } fn pass<T: C>(a: &T) { diff --git a/src/test/ui/span/issue-37767.stderr b/src/test/ui/span/issue-37767.stderr index 7cf74eaab8d..8babcc74ed5 100644 --- a/src/test/ui/span/issue-37767.stderr +++ b/src/test/ui/span/issue-37767.stderr @@ -1,7 +1,7 @@ error[E0034]: multiple applicable items in scope --> $DIR/issue-37767.rs:20:7 | -20 | a.foo() +20 | a.foo() //~ ERROR multiple applicable items | ^^^ multiple `foo` found | note: candidate #1 is defined in the trait `A` @@ -20,7 +20,7 @@ note: candidate #2 is defined in the trait `B` error[E0034]: multiple applicable items in scope --> $DIR/issue-37767.rs:32:7 | -32 | a.foo() +32 | a.foo() //~ ERROR multiple applicable items | ^^^ multiple `foo` found | note: candidate #1 is defined in the trait `C` @@ -39,7 +39,7 @@ note: candidate #2 is defined in the trait `D` error[E0034]: multiple applicable items in scope --> $DIR/issue-37767.rs:44:7 | -44 | a.foo() +44 | a.foo() //~ ERROR multiple applicable items | ^^^ multiple `foo` found | note: candidate #1 is defined in the trait `E` diff --git a/src/test/ui/span/issue-39018.rs b/src/test/ui/span/issue-39018.rs index 1cbc5ff1d2a..4c9d10ba46b 100644 --- a/src/test/ui/span/issue-39018.rs +++ b/src/test/ui/span/issue-39018.rs @@ -10,11 +10,13 @@ pub fn main() { let x = "Hello " + "World!"; + //~^ ERROR cannot be applied to type // Make sure that the span outputs a warning // for not having an implementation for std::ops::Add // that won't output for the above string concatenation let y = World::Hello + World::Goodbye; + //~^ ERROR cannot be applied to type } enum World { diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index e865b5192a4..db662a1df59 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -9,9 +9,9 @@ help: `to_owned()` can be used to create an owned `String` from a string referen | ^^^^^^^^^^^^^^^^^^^ error[E0369]: binary operation `+` cannot be applied to type `World` - --> $DIR/issue-39018.rs:17:13 + --> $DIR/issue-39018.rs:18:13 | -17 | let y = World::Hello + World::Goodbye; +18 | let y = World::Hello + World::Goodbye; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: an implementation of `std::ops::Add` might be missing for `World` diff --git a/src/test/ui/span/issue-39698.rs b/src/test/ui/span/issue-39698.rs index 17b3f1c5a88..33071c468b8 100644 --- a/src/test/ui/span/issue-39698.rs +++ b/src/test/ui/span/issue-39698.rs @@ -18,5 +18,9 @@ enum T { fn main() { match T::T1(123, 456) { T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); } + //~^ ERROR is not bound in all patterns + //~| ERROR is not bound in all patterns + //~| ERROR is not bound in all patterns + //~| ERROR is not bound in all patterns } } diff --git a/src/test/ui/span/issue-40157.rs b/src/test/ui/span/issue-40157.rs index 8f3a7ae3417..9e33ecde91c 100644 --- a/src/test/ui/span/issue-40157.rs +++ b/src/test/ui/span/issue-40157.rs @@ -10,4 +10,5 @@ fn main () { {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });} + //~^ ERROR does not live long enough } diff --git a/src/test/ui/span/issue-43927-non-ADT-derive.rs b/src/test/ui/span/issue-43927-non-ADT-derive.rs index cf2a4b8d037..782cce26a95 100644 --- a/src/test/ui/span/issue-43927-non-ADT-derive.rs +++ b/src/test/ui/span/issue-43927-non-ADT-derive.rs @@ -11,6 +11,7 @@ #![allow(dead_code)] #![derive(Debug, PartialEq, Eq)] // should be an outer attribute! +//~^ ERROR `derive` may only be applied to structs, enums and unions struct DerivedOn; fn main() {} diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs index b74036c4f5c..f7059e01261 100644 --- a/src/test/ui/span/issue-7575.rs +++ b/src/test/ui/span/issue-7575.rs @@ -45,7 +45,7 @@ impl OtherTrait for usize { } } -struct Myisize(isize); +struct Myisize(isize); //~ NOTE not found for this impl Myisize { fn fff(i: isize) -> isize { //~ NOTE candidate @@ -74,18 +74,18 @@ fn no_param_bound(u: usize, m: Myisize) -> usize { u.f8(42) + u.f9(342) + m.fff(42) //~^ ERROR no method named `f9` found for type `usize` in the current scope //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter - //~| NOTE to use it here write `CtxtFn::f9(u, 342)` instead + //~| NOTE the following traits define an item //~| ERROR no method named `fff` found for type `Myisize` in the current scope //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter - //~| NOTE to use it here write `OtherTrait::f9(u, 342)` instead - //~| NOTE to use it here write `UnusedTrait::f9(u, 342)` instead + + } fn param_bound<T: ManyImplTrait>(t: T) -> bool { t.is_str() //~^ ERROR no method named `is_str` found for type `T` in the current scope //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter - //~| NOTE to use it here write `ManyImplTrait::is_str(t)` instead + //~| NOTE the following trait defines } fn main() { diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index 9b248f49e08..a1ed5db69c0 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -33,7 +33,7 @@ note: candidate #3 is defined in the trait `UnusedTrait` error[E0599]: no method named `fff` found for type `Myisize` in the current scope --> $DIR/issue-7575.rs:74:30 | -48 | struct Myisize(isize); +48 | struct Myisize(isize); //~ NOTE not found for this | ---------------------- method `fff` not found for this ... 74 | u.f8(42) + u.f9(342) + m.fff(42) diff --git a/src/test/ui/span/macro-span-replacement.rs b/src/test/ui/span/macro-span-replacement.rs index b7aae39c469..71f37f6555e 100644 --- a/src/test/ui/span/macro-span-replacement.rs +++ b/src/test/ui/span/macro-span-replacement.rs @@ -12,7 +12,7 @@ macro_rules! m { ($a:tt $b:tt) => { - $b $a; + $b $a; //~ WARN struct is never used } } diff --git a/src/test/ui/span/macro-span-replacement.stderr b/src/test/ui/span/macro-span-replacement.stderr index af03aa6a369..ed961896306 100644 --- a/src/test/ui/span/macro-span-replacement.stderr +++ b/src/test/ui/span/macro-span-replacement.stderr @@ -1,7 +1,7 @@ warning: struct is never used: `S` --> $DIR/macro-span-replacement.rs:15:9 | -15 | $b $a; +15 | $b $a; //~ WARN struct is never used | ^^^^^^ ... 20 | m!(S struct); diff --git a/src/test/ui/span/macro-ty-params.rs b/src/test/ui/span/macro-ty-params.rs index c2443b024ce..5d93b1266a4 100644 --- a/src/test/ui/span/macro-ty-params.rs +++ b/src/test/ui/span/macro-ty-params.rs @@ -15,7 +15,8 @@ macro_rules! m { } fn main() { - foo::<T>!(); - foo::<>!(); - m!(MyTrait<>); + foo::<T>!(); //~ ERROR generic arguments in macro path + foo::<>!(); //~ ERROR generic arguments in macro path + m!(MyTrait<>); //~ ERROR generic arguments in macro path + //~^ ERROR unexpected generic arguments in path } diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr index 017a449d96f..e3e9334d9fb 100644 --- a/src/test/ui/span/macro-ty-params.stderr +++ b/src/test/ui/span/macro-ty-params.stderr @@ -1,25 +1,25 @@ error: unexpected generic arguments in path --> $DIR/macro-ty-params.rs:20:8 | -20 | m!(MyTrait<>); +20 | m!(MyTrait<>); //~ ERROR generic arguments in macro path | ^^^^^^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:18:8 | -18 | foo::<T>!(); +18 | foo::<T>!(); //~ ERROR generic arguments in macro path | ^^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:19:8 | -19 | foo::<>!(); +19 | foo::<>!(); //~ ERROR generic arguments in macro path | ^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:20:15 | -20 | m!(MyTrait<>); +20 | m!(MyTrait<>); //~ ERROR generic arguments in macro path | ^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/span/missing-unit-argument.rs b/src/test/ui/span/missing-unit-argument.rs index ba1a999121c..a586d33eaa7 100644 --- a/src/test/ui/span/missing-unit-argument.rs +++ b/src/test/ui/span/missing-unit-argument.rs @@ -18,10 +18,10 @@ impl S { } fn main() { - let _: Result<(), String> = Ok(); - foo(); - foo(()); - bar(); - S.baz(); - S.generic::<()>(); + let _: Result<(), String> = Ok(); //~ ERROR this function takes + foo(); //~ ERROR this function takes + foo(()); //~ ERROR this function takes + bar(); //~ ERROR this function takes + S.baz(); //~ ERROR this function takes + S.generic::<()>(); //~ ERROR this function takes } diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr index 672b0718a02..27f9972557b 100644 --- a/src/test/ui/span/missing-unit-argument.stderr +++ b/src/test/ui/span/missing-unit-argument.stderr @@ -1,11 +1,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied --> $DIR/missing-unit-argument.rs:21:33 | -21 | let _: Result<(), String> = Ok(); +21 | let _: Result<(), String> = Ok(); //~ ERROR this function takes | ^^^^ help: expected the unit value `()`; create it with empty parentheses | -21 | let _: Result<(), String> = Ok(()); +21 | let _: Result<(), String> = Ok(()); //~ ERROR this function takes | ^^ error[E0061]: this function takes 2 parameters but 0 parameters were supplied @@ -14,7 +14,7 @@ error[E0061]: this function takes 2 parameters but 0 parameters were supplied 11 | fn foo(():(), ():()) {} | ----------------------- defined here ... -22 | foo(); +22 | foo(); //~ ERROR this function takes | ^^^^^ expected 2 parameters error[E0061]: this function takes 2 parameters but 1 parameter was supplied @@ -23,7 +23,7 @@ error[E0061]: this function takes 2 parameters but 1 parameter was supplied 11 | fn foo(():(), ():()) {} | ----------------------- defined here ... -23 | foo(()); +23 | foo(()); //~ ERROR this function takes | ^^ expected 2 parameters error[E0061]: this function takes 1 parameter but 0 parameters were supplied @@ -32,11 +32,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied 12 | fn bar(():()) {} | ---------------- defined here ... -24 | bar(); +24 | bar(); //~ ERROR this function takes | ^^^^^ help: expected the unit value `()`; create it with empty parentheses | -24 | bar(()); +24 | bar(()); //~ ERROR this function takes | ^^ error[E0061]: this function takes 1 parameter but 0 parameters were supplied @@ -45,11 +45,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied 16 | fn baz(self, (): ()) { } | ------------------------ defined here ... -25 | S.baz(); +25 | S.baz(); //~ ERROR this function takes | ^^^ help: expected the unit value `()`; create it with empty parentheses | -25 | S.baz(()); +25 | S.baz(()); //~ ERROR this function takes | ^^ error[E0061]: this function takes 1 parameter but 0 parameters were supplied @@ -58,11 +58,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied 17 | fn generic<T>(self, _: T) { } | ----------------------------- defined here ... -26 | S.generic::<()>(); +26 | S.generic::<()>(); //~ ERROR this function takes | ^^^^^^^ help: expected the unit value `()`; create it with empty parentheses | -26 | S.generic::<()>(()); +26 | S.generic::<()>(()); //~ ERROR this function takes | ^^ error: aborting due to 6 previous errors diff --git a/src/test/ui/span/move-closure.rs b/src/test/ui/span/move-closure.rs index e11ef0dddaa..87ce1529297 100644 --- a/src/test/ui/span/move-closure.rs +++ b/src/test/ui/span/move-closure.rs @@ -12,5 +12,5 @@ // Make sure that the span of a closure marked `move` begins at the `move` keyword. fn main() { - let x: () = move || (); + let x: () = move || (); //~ ERROR mismatched types } diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr index 2294e6476d6..9135a26bbaf 100644 --- a/src/test/ui/span/move-closure.stderr +++ b/src/test/ui/span/move-closure.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types --> $DIR/move-closure.rs:15:17 | -15 | let x: () = move || (); +15 | let x: () = move || (); //~ ERROR mismatched types | ^^^^^^^^^^ expected (), found closure | = note: expected type `()` diff --git a/src/test/ui/span/multiline-span-E0072.rs b/src/test/ui/span/multiline-span-E0072.rs index 323e7fb5a42..2344d72f45c 100644 --- a/src/test/ui/span/multiline-span-E0072.rs +++ b/src/test/ui/span/multiline-span-E0072.rs @@ -9,7 +9,7 @@ // except according to those terms. // It should just use the entire body instead of pointing at the next two lines -struct +struct //~ ERROR has infinite size ListNode { head: u8, diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr index a06cbd04deb..124a53219a9 100644 --- a/src/test/ui/span/multiline-span-E0072.stderr +++ b/src/test/ui/span/multiline-span-E0072.stderr @@ -1,7 +1,7 @@ error[E0072]: recursive type `ListNode` has infinite size --> $DIR/multiline-span-E0072.rs:12:1 | -12 | / struct +12 | / struct //~ ERROR has infinite size 13 | | ListNode 14 | | { 15 | | head: u8, diff --git a/src/test/ui/span/multiline-span-simple.rs b/src/test/ui/span/multiline-span-simple.rs index 451492ba693..f8e4cbcbf19 100644 --- a/src/test/ui/span/multiline-span-simple.rs +++ b/src/test/ui/span/multiline-span-simple.rs @@ -20,7 +20,7 @@ fn main() { let x = 1; let y = 2; let z = 3; - foo(1 as u32 + + foo(1 as u32 + //~ ERROR not satisfied bar(x, diff --git a/src/test/ui/span/multiline-span-simple.stderr b/src/test/ui/span/multiline-span-simple.stderr index 3915f1b655c..b068798630e 100644 --- a/src/test/ui/span/multiline-span-simple.stderr +++ b/src/test/ui/span/multiline-span-simple.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `u32: std::ops::Add<()>` is not satisfied --> $DIR/multiline-span-simple.rs:23:18 | -23 | foo(1 as u32 + +23 | foo(1 as u32 + //~ ERROR not satisfied | ^ no implementation for `u32 + ()` | = help: the trait `std::ops::Add<()>` is not implemented for `u32` diff --git a/src/test/ui/span/multispan-import-lint.rs b/src/test/ui/span/multispan-import-lint.rs index 66536b29c02..c3582b0a0c5 100644 --- a/src/test/ui/span/multispan-import-lint.rs +++ b/src/test/ui/span/multispan-import-lint.rs @@ -11,6 +11,7 @@ #![warn(unused)] use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd}; +//~^ WARN unused imports fn main() { let _ = min(1, 2); diff --git a/src/test/ui/span/mut-arg-hint.rs b/src/test/ui/span/mut-arg-hint.rs index 296ee6ca10e..b22cadf3ef2 100644 --- a/src/test/ui/span/mut-arg-hint.rs +++ b/src/test/ui/span/mut-arg-hint.rs @@ -10,19 +10,19 @@ trait B { fn foo(mut a: &String) { - a.push_str("bar"); + a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content } } pub fn foo<'a>(mut a: &'a String) { - a.push_str("foo"); + a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content } struct A {} impl A { pub fn foo(mut a: &String) { - a.push_str("foo"); + a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content } } diff --git a/src/test/ui/span/mut-arg-hint.stderr b/src/test/ui/span/mut-arg-hint.stderr index f8584c67390..02c607ddc37 100644 --- a/src/test/ui/span/mut-arg-hint.stderr +++ b/src/test/ui/span/mut-arg-hint.stderr @@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable | 12 | fn foo(mut a: &String) { | ------- use `&mut String` here to make mutable -13 | a.push_str("bar"); +13 | a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content | ^ cannot borrow as mutable error[E0596]: cannot borrow immutable borrowed content `*a` as mutable @@ -11,7 +11,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable | 17 | pub fn foo<'a>(mut a: &'a String) { | ---------- use `&'a mut String` here to make mutable -18 | a.push_str("foo"); +18 | a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content | ^ cannot borrow as mutable error[E0596]: cannot borrow immutable borrowed content `*a` as mutable @@ -19,7 +19,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable | 24 | pub fn foo(mut a: &String) { | ------- use `&mut String` here to make mutable -25 | a.push_str("foo"); +25 | a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content | ^ cannot borrow as mutable error: aborting due to 3 previous errors diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs index 8e968d90a2f..135b577d7f7 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs @@ -15,6 +15,6 @@ fn main() { let p; { let b = m.borrow(); - p = &*b; //~ ERROR `b` does not live long enough - } + p = &*b; + } //~ ERROR `b` does not live long enough } diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr index 007a9fad830..d9f5736061a 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr @@ -1,9 +1,9 @@ error[E0597]: `b` does not live long enough --> $DIR/mut-ptr-cant-outlive-ref.rs:19:5 | -18 | p = &*b; //~ ERROR `b` does not live long enough +18 | p = &*b; | - borrow occurs here -19 | } +19 | } //~ ERROR `b` does not live long enough | ^ `b` dropped here while still borrowed 20 | } | - borrowed value needs to live until here diff --git a/src/test/ui/span/non-existing-module-import.rs b/src/test/ui/span/non-existing-module-import.rs index 3d45a94d531..ad6409f014a 100644 --- a/src/test/ui/span/non-existing-module-import.rs +++ b/src/test/ui/span/non-existing-module-import.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::bar::{foo1, foo2}; +use std::bar::{foo1, foo2}; //~ ERROR unresolved import fn main() {} diff --git a/src/test/ui/span/non-existing-module-import.stderr b/src/test/ui/span/non-existing-module-import.stderr index 93339576f49..74f5dac4937 100644 --- a/src/test/ui/span/non-existing-module-import.stderr +++ b/src/test/ui/span/non-existing-module-import.stderr @@ -1,7 +1,7 @@ error[E0432]: unresolved import `std::bar` --> $DIR/non-existing-module-import.rs:11:10 | -11 | use std::bar::{foo1, foo2}; +11 | use std::bar::{foo1, foo2}; //~ ERROR unresolved import | ^^^ Could not find `bar` in `std` error: aborting due to previous error diff --git a/src/test/ui/span/pub-struct-field.rs b/src/test/ui/span/pub-struct-field.rs index 54cb0b59c75..11af361e8a8 100644 --- a/src/test/ui/span/pub-struct-field.rs +++ b/src/test/ui/span/pub-struct-field.rs @@ -13,8 +13,8 @@ struct Foo { bar: u8, - pub bar: u8, - pub(crate) bar: u8, + pub bar: u8, //~ ERROR is already declared + pub(crate) bar: u8, //~ ERROR is already declared } fn main() {} diff --git a/src/test/ui/span/pub-struct-field.stderr b/src/test/ui/span/pub-struct-field.stderr index c66361c8546..5b303758d2b 100644 --- a/src/test/ui/span/pub-struct-field.stderr +++ b/src/test/ui/span/pub-struct-field.stderr @@ -3,7 +3,7 @@ error[E0124]: field `bar` is already declared | 15 | bar: u8, | ------- `bar` first declared here -16 | pub bar: u8, +16 | pub bar: u8, //~ ERROR is already declared | ^^^^^^^^^^^ field already declared error[E0124]: field `bar` is already declared @@ -11,8 +11,8 @@ error[E0124]: field `bar` is already declared | 15 | bar: u8, | ------- `bar` first declared here -16 | pub bar: u8, -17 | pub(crate) bar: u8, +16 | pub bar: u8, //~ ERROR is already declared +17 | pub(crate) bar: u8, //~ ERROR is already declared | ^^^^^^^^^^^^^^^^^^ field already declared error: aborting due to 2 previous errors diff --git a/src/test/ui/span/range-2.rs b/src/test/ui/span/range-2.rs index 94967693ecf..589f7182129 100644 --- a/src/test/ui/span/range-2.rs +++ b/src/test/ui/span/range-2.rs @@ -15,7 +15,7 @@ pub fn main() { let a = 42; let b = 42; &a..&b - //~^ ERROR `a` does not live long enough - //~^^ ERROR `b` does not live long enough }; + //~^ ERROR `a` does not live long enough + //~^^ ERROR `b` does not live long enough } diff --git a/src/test/ui/span/range-2.stderr b/src/test/ui/span/range-2.stderr index 285ab4aee4b..80d364cd8be 100644 --- a/src/test/ui/span/range-2.stderr +++ b/src/test/ui/span/range-2.stderr @@ -1,22 +1,22 @@ error[E0597]: `a` does not live long enough - --> $DIR/range-2.rs:20:5 + --> $DIR/range-2.rs:18:5 | 17 | &a..&b | - borrow occurs here -... -20 | }; +18 | }; | ^ `a` dropped here while still borrowed +... 21 | } | - borrowed value needs to live until here error[E0597]: `b` does not live long enough - --> $DIR/range-2.rs:20:5 + --> $DIR/range-2.rs:18:5 | 17 | &a..&b | - borrow occurs here -... -20 | }; +18 | }; | ^ `b` dropped here while still borrowed +... 21 | } | - borrowed value needs to live until here diff --git a/src/test/ui/span/recursive-type-field.rs b/src/test/ui/span/recursive-type-field.rs index 6fef4d30f7a..764b5392578 100644 --- a/src/test/ui/span/recursive-type-field.rs +++ b/src/test/ui/span/recursive-type-field.rs @@ -10,12 +10,12 @@ use std::rc::Rc; -struct Foo<'a> { +struct Foo<'a> { //~ ERROR recursive type bar: Bar<'a>, b: Rc<Bar<'a>>, } -struct Bar<'a> { +struct Bar<'a> { //~ ERROR recursive type y: (Foo<'a>, Foo<'a>), z: Option<Bar<'a>>, a: &'a Foo<'a>, diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr index b4d0b5a6a25..bd9f5f032ef 100644 --- a/src/test/ui/span/recursive-type-field.stderr +++ b/src/test/ui/span/recursive-type-field.stderr @@ -1,7 +1,7 @@ error[E0072]: recursive type `Foo` has infinite size --> $DIR/recursive-type-field.rs:13:1 | -13 | struct Foo<'a> { +13 | struct Foo<'a> { //~ ERROR recursive type | ^^^^^^^^^^^^^^ recursive type has infinite size 14 | bar: Bar<'a>, | ------------ recursive without indirection @@ -11,7 +11,7 @@ error[E0072]: recursive type `Foo` has infinite size error[E0072]: recursive type `Bar` has infinite size --> $DIR/recursive-type-field.rs:18:1 | -18 | struct Bar<'a> { +18 | struct Bar<'a> { //~ ERROR recursive type | ^^^^^^^^^^^^^^ recursive type has infinite size 19 | y: (Foo<'a>, Foo<'a>), | --------------------- recursive without indirection diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs index 8ec6036762f..74a6a2960c9 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs @@ -14,7 +14,7 @@ fn main() { let mut f; { let c = 1; - let c_ref = &c; //~ ERROR `c` does not live long enough + let c_ref = &c; f = move |a: isize, b: isize| { a + b + *c_ref }; - } + } //~ ERROR `c` does not live long enough } diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr index 29848412e4e..acd995c6bb8 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr @@ -1,10 +1,10 @@ error[E0597]: `c` does not live long enough --> $DIR/regionck-unboxed-closure-lifetimes.rs:19:5 | -17 | let c_ref = &c; //~ ERROR `c` does not live long enough +17 | let c_ref = &c; | - borrow occurs here 18 | f = move |a: isize, b: isize| { a + b + *c_ref }; -19 | } +19 | } //~ ERROR `c` does not live long enough | ^ `c` dropped here while still borrowed 20 | } | - borrowed value needs to live until here diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs index 99b0d6ed296..5449bbfdce3 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs @@ -21,5 +21,5 @@ fn main() { { let ss: &isize = &id(1); blah = box ss as Box<Foo>; - } + } //~ ERROR does not live long enough } diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr index 6a3625441b4..69bdde88916 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr @@ -4,7 +4,7 @@ error[E0597]: borrowed value does not live long enough 22 | let ss: &isize = &id(1); | ----- temporary value created here 23 | blah = box ss as Box<Foo>; -24 | } +24 | } //~ ERROR does not live long enough | ^ temporary value dropped here while still borrowed 25 | } | - temporary value needs to live until here diff --git a/src/test/ui/span/regions-close-over-type-parameter-2.rs b/src/test/ui/span/regions-close-over-type-parameter-2.rs index 053af49e068..cd838db92e1 100644 --- a/src/test/ui/span/regions-close-over-type-parameter-2.rs +++ b/src/test/ui/span/regions-close-over-type-parameter-2.rs @@ -30,7 +30,7 @@ fn main() { let _ = { let tmp0 = 3; - let tmp1 = &tmp0; //~ ERROR `tmp0` does not live long enough + let tmp1 = &tmp0; repeater3(tmp1) - }; + }; //~ ERROR `tmp0` does not live long enough } diff --git a/src/test/ui/span/regions-close-over-type-parameter-2.stderr b/src/test/ui/span/regions-close-over-type-parameter-2.stderr index a89127b1436..a7f79f8b265 100644 --- a/src/test/ui/span/regions-close-over-type-parameter-2.stderr +++ b/src/test/ui/span/regions-close-over-type-parameter-2.stderr @@ -1,10 +1,10 @@ error[E0597]: `tmp0` does not live long enough --> $DIR/regions-close-over-type-parameter-2.rs:35:5 | -33 | let tmp1 = &tmp0; //~ ERROR `tmp0` does not live long enough +33 | let tmp1 = &tmp0; | ---- borrow occurs here 34 | repeater3(tmp1) -35 | }; +35 | }; //~ ERROR `tmp0` does not live long enough | ^- borrowed value needs to live until here | | | `tmp0` dropped here while still borrowed diff --git a/src/test/ui/span/regions-escape-loop-via-variable.rs b/src/test/ui/span/regions-escape-loop-via-variable.rs index f588655d1af..1dc1ae60715 100644 --- a/src/test/ui/span/regions-escape-loop-via-variable.rs +++ b/src/test/ui/span/regions-escape-loop-via-variable.rs @@ -18,6 +18,6 @@ fn main() { loop { let x = 1 + *p; - p = &x; //~ ERROR `x` does not live long enough - } + p = &x; + } //~ ERROR `x` does not live long enough } diff --git a/src/test/ui/span/regions-escape-loop-via-variable.stderr b/src/test/ui/span/regions-escape-loop-via-variable.stderr index cfdd1c8b153..554ffe91e6d 100644 --- a/src/test/ui/span/regions-escape-loop-via-variable.stderr +++ b/src/test/ui/span/regions-escape-loop-via-variable.stderr @@ -1,9 +1,9 @@ error[E0597]: `x` does not live long enough --> $DIR/regions-escape-loop-via-variable.rs:22:5 | -21 | p = &x; //~ ERROR `x` does not live long enough +21 | p = &x; | - borrow occurs here -22 | } +22 | } //~ ERROR `x` does not live long enough | ^ `x` dropped here while still borrowed 23 | } | - borrowed value needs to live until here diff --git a/src/test/ui/span/regions-escape-loop-via-vec.rs b/src/test/ui/span/regions-escape-loop-via-vec.rs index 8982b5cd98d..7c4834751d8 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.rs +++ b/src/test/ui/span/regions-escape-loop-via-vec.rs @@ -19,12 +19,11 @@ fn broken() { //~^ NOTE use of borrowed `x` let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed //~^ NOTE use of borrowed `x` - _y.push(&mut z); //~ ERROR `z` does not live long enough - //~^ NOTE does not live long enough + _y.push(&mut z); //~ NOTE borrow occurs here x += 1; //~ ERROR cannot assign //~^ NOTE assignment to borrowed `x` occurs here - } - //~^ NOTE borrowed value only lives until here + } //~ NOTE `z` dropped here while still borrowed + //~^ ERROR `z` does not live long enough } //~^ NOTE borrowed value needs to live until here diff --git a/src/test/ui/span/regions-escape-loop-via-vec.stderr b/src/test/ui/span/regions-escape-loop-via-vec.stderr index b61df82e8a1..a7224fcd4cc 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.stderr +++ b/src/test/ui/span/regions-escape-loop-via-vec.stderr @@ -1,13 +1,13 @@ error[E0597]: `z` does not live long enough - --> $DIR/regions-escape-loop-via-vec.rs:26:5 + --> $DIR/regions-escape-loop-via-vec.rs:25:5 | -22 | _y.push(&mut z); //~ ERROR `z` does not live long enough +22 | _y.push(&mut z); //~ NOTE borrow occurs here | - borrow occurs here ... -26 | } +25 | } //~ NOTE `z` dropped here while still borrowed | ^ `z` dropped here while still borrowed -27 | //~^ NOTE borrowed value only lives until here -28 | } +26 | //~^ ERROR `z` does not live long enough +27 | } | - borrowed value needs to live until here error[E0503]: cannot use `x` because it was mutably borrowed @@ -29,12 +29,12 @@ error[E0503]: cannot use `x` because it was mutably borrowed | ^^^^^ use of borrowed `x` error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/regions-escape-loop-via-vec.rs:24:9 + --> $DIR/regions-escape-loop-via-vec.rs:23:9 | 14 | let mut _y = vec![&mut x]; | - borrow of `x` occurs here ... -24 | x += 1; //~ ERROR cannot assign +23 | x += 1; //~ ERROR cannot assign | ^^^^^^ assignment to borrowed `x` occurs here error: aborting due to 4 previous errors diff --git a/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs b/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs index a05658e9e58..3bb069813a2 100644 --- a/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs +++ b/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs @@ -21,11 +21,11 @@ fn foo<C, M>(mut cond: C, mut make_box: M) where // Here we complain because the resulting region // of this borrow is the fn body as a whole. - y = borrow(&*x); //~ ERROR `*x` does not live long enough + y = borrow(&*x); assert_eq!(*x, *y); if cond() { break; } - } + } //~ ERROR `*x` does not live long enough assert!(*y != 0); } diff --git a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr index 0960f5e1b25..4a44a3a6813 100644 --- a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr +++ b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr @@ -1,10 +1,10 @@ error[E0597]: `*x` does not live long enough --> $DIR/regions-infer-borrow-scope-within-loop.rs:28:5 | -24 | y = borrow(&*x); //~ ERROR `*x` does not live long enough +24 | y = borrow(&*x); | -- borrow occurs here ... -28 | } +28 | } //~ ERROR `*x` does not live long enough | ^ `*x` dropped here while still borrowed 29 | assert!(*y != 0); 30 | } diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.rs b/src/test/ui/span/send-is-not-static-ensures-scoping.rs index 1b7718d2283..d294840bdfb 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.rs +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.rs @@ -23,13 +23,13 @@ impl<'a> Guard<'a> { fn main() { let bad = { let x = 1; - let y = &x; //~ ERROR `x` does not live long enough + let y = &x; scoped(|| { let _z = y; //~^ ERROR `y` does not live long enough }) - }; + }; //~ ERROR `x` does not live long enough bad.join(); } diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr index 02fc9820495..cc12b2c1ee2 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr @@ -1,10 +1,10 @@ error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-ensures-scoping.rs:32:5 | -26 | let y = &x; //~ ERROR `x` does not live long enough +26 | let y = &x; | - borrow occurs here ... -32 | }; +32 | }; //~ ERROR `x` does not live long enough | ^ `x` dropped here while still borrowed ... 35 | } @@ -18,7 +18,7 @@ error[E0597]: `y` does not live long enough 29 | let _z = y; | ^ does not live long enough ... -32 | }; +32 | }; //~ ERROR `x` does not live long enough | - borrowed value only lives until here ... 35 | } diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.rs b/src/test/ui/span/send-is-not-static-std-sync-2.rs index d9d3706586b..762eeffaa6a 100644 --- a/src/test/ui/span/send-is-not-static-std-sync-2.rs +++ b/src/test/ui/span/send-is-not-static-std-sync-2.rs @@ -18,8 +18,8 @@ use std::sync::{Mutex, RwLock, mpsc}; fn mutex() { let lock = { let x = 1; - Mutex::new(&x) //~ ERROR does not live long enough - }; + Mutex::new(&x) + }; //~ ERROR does not live long enough let _dangling = *lock.lock().unwrap(); } @@ -27,8 +27,8 @@ fn mutex() { fn rwlock() { let lock = { let x = 1; - RwLock::new(&x) //~ ERROR does not live long enough - }; + RwLock::new(&x) + }; //~ ERROR does not live long enough let _dangling = *lock.read().unwrap(); } @@ -36,9 +36,9 @@ fn channel() { let (_tx, rx) = { let x = 1; let (tx, rx) = mpsc::channel(); - let _ = tx.send(&x); //~ ERROR does not live long enough + let _ = tx.send(&x); (tx, rx) - }; + }; //~ ERROR does not live long enough let _dangling = rx.recv(); } diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.stderr b/src/test/ui/span/send-is-not-static-std-sync-2.stderr index 318dab599f5..beee85c8b1d 100644 --- a/src/test/ui/span/send-is-not-static-std-sync-2.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync-2.stderr @@ -1,9 +1,9 @@ error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:22:5 | -21 | Mutex::new(&x) //~ ERROR does not live long enough +21 | Mutex::new(&x) | - borrow occurs here -22 | }; +22 | }; //~ ERROR does not live long enough | ^ `x` dropped here while still borrowed ... 25 | } @@ -12,9 +12,9 @@ error[E0597]: `x` does not live long enough error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:31:5 | -30 | RwLock::new(&x) //~ ERROR does not live long enough +30 | RwLock::new(&x) | - borrow occurs here -31 | }; +31 | }; //~ ERROR does not live long enough | ^ `x` dropped here while still borrowed 32 | let _dangling = *lock.read().unwrap(); 33 | } @@ -23,10 +23,10 @@ error[E0597]: `x` does not live long enough error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:41:5 | -39 | let _ = tx.send(&x); //~ ERROR does not live long enough +39 | let _ = tx.send(&x); | - borrow occurs here 40 | (tx, rx) -41 | }; +41 | }; //~ ERROR does not live long enough | ^ `x` dropped here while still borrowed ... 44 | } diff --git a/src/test/ui/span/send-is-not-static-std-sync.rs b/src/test/ui/span/send-is-not-static-std-sync.rs index 8ec2fe8a1ec..05cb9627558 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.rs +++ b/src/test/ui/span/send-is-not-static-std-sync.rs @@ -23,8 +23,8 @@ fn mutex() { drop(y); //~ ERROR cannot move out { let z = 2; - *lock.lock().unwrap() = &z; //~ ERROR does not live long enough - } + *lock.lock().unwrap() = &z; + } //~ ERROR does not live long enough } fn rwlock() { @@ -35,8 +35,8 @@ fn rwlock() { drop(y); //~ ERROR cannot move out { let z = 2; - *lock.write().unwrap() = &z; //~ ERROR does not live long enough - } + *lock.write().unwrap() = &z; + } //~ ERROR does not live long enough } fn channel() { @@ -49,8 +49,8 @@ fn channel() { drop(y); //~ ERROR cannot move out { let z = 2; - tx.send(&z).unwrap(); //~ ERROR does not live long enough - } + tx.send(&z).unwrap(); + } //~ ERROR does not live long enough } fn main() {} diff --git a/src/test/ui/span/send-is-not-static-std-sync.stderr b/src/test/ui/span/send-is-not-static-std-sync.stderr index 988ff228105..e078e4e14a5 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync.stderr @@ -1,9 +1,9 @@ error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:27:5 | -26 | *lock.lock().unwrap() = &z; //~ ERROR does not live long enough +26 | *lock.lock().unwrap() = &z; | - borrow occurs here -27 | } +27 | } //~ ERROR does not live long enough | ^ `z` dropped here while still borrowed 28 | } | - borrowed value needs to live until here @@ -19,9 +19,9 @@ error[E0505]: cannot move out of `y` because it is borrowed error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:39:5 | -38 | *lock.write().unwrap() = &z; //~ ERROR does not live long enough +38 | *lock.write().unwrap() = &z; | - borrow occurs here -39 | } +39 | } //~ ERROR does not live long enough | ^ `z` dropped here while still borrowed 40 | } | - borrowed value needs to live until here @@ -37,9 +37,9 @@ error[E0505]: cannot move out of `y` because it is borrowed error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:53:5 | -52 | tx.send(&z).unwrap(); //~ ERROR does not live long enough +52 | tx.send(&z).unwrap(); | - borrow occurs here -53 | } +53 | } //~ ERROR does not live long enough | ^ `z` dropped here while still borrowed 54 | } | - borrowed value needs to live until here diff --git a/src/test/ui/span/slice-borrow.rs b/src/test/ui/span/slice-borrow.rs index 1b022f23246..6bb98c34b7e 100644 --- a/src/test/ui/span/slice-borrow.rs +++ b/src/test/ui/span/slice-borrow.rs @@ -15,5 +15,5 @@ fn main() { { let x: &[isize] = &vec![1, 2, 3, 4, 5]; y = &x[1..]; - } + } //~ ERROR does not live long enough } diff --git a/src/test/ui/span/slice-borrow.stderr b/src/test/ui/span/slice-borrow.stderr index f9dbddd226f..d1e5cf62a02 100644 --- a/src/test/ui/span/slice-borrow.stderr +++ b/src/test/ui/span/slice-borrow.stderr @@ -4,7 +4,7 @@ error[E0597]: borrowed value does not live long enough 16 | let x: &[isize] = &vec![1, 2, 3, 4, 5]; | ------------------- temporary value created here 17 | y = &x[1..]; -18 | } +18 | } //~ ERROR does not live long enough | ^ temporary value dropped here while still borrowed 19 | } | - temporary value needs to live until here diff --git a/src/test/ui/span/suggestion-non-ascii.rs b/src/test/ui/span/suggestion-non-ascii.rs index 67dbe1dc7b5..2d82bba33c5 100644 --- a/src/test/ui/span/suggestion-non-ascii.rs +++ b/src/test/ui/span/suggestion-non-ascii.rs @@ -11,6 +11,6 @@ fn main() { let tup = (1,); - println!("☃{}", tup[0]); + println!("☃{}", tup[0]); //~ ERROR cannot index into a value of type } diff --git a/src/test/ui/span/suggestion-non-ascii.stderr b/src/test/ui/span/suggestion-non-ascii.stderr index c67a8fe32b9..9ee8ccb01d0 100644 --- a/src/test/ui/span/suggestion-non-ascii.stderr +++ b/src/test/ui/span/suggestion-non-ascii.stderr @@ -1,7 +1,7 @@ error[E0608]: cannot index into a value of type `({integer},)` --> $DIR/suggestion-non-ascii.rs:14:21 | -14 | println!("☃{}", tup[0]); +14 | println!("☃{}", tup[0]); //~ ERROR cannot index into a value of type | ^^^^^^ help: to access tuple elements, use: `tup.0` error: aborting due to previous error diff --git a/src/test/ui/span/type-binding.rs b/src/test/ui/span/type-binding.rs index 05285c732f4..d8a2e332a03 100644 --- a/src/test/ui/span/type-binding.rs +++ b/src/test/ui/span/type-binding.rs @@ -14,5 +14,6 @@ use std::ops::Deref; fn homura<T: Deref<Trget = i32>>(_: T) {} +//~^ ERROR not found fn main() {} diff --git a/src/test/ui/span/typo-suggestion.rs b/src/test/ui/span/typo-suggestion.rs index 536bf16142b..7aeaa44bec2 100644 --- a/src/test/ui/span/typo-suggestion.rs +++ b/src/test/ui/span/typo-suggestion.rs @@ -12,8 +12,8 @@ fn main() { let foo = 1; // `foo` shouldn't be suggested, it is too dissimilar from `bar`. - println!("Hello {}", bar); + println!("Hello {}", bar); //~ ERROR cannot find value // But this is close enough. - println!("Hello {}", fob); + println!("Hello {}", fob); //~ ERROR cannot find value } diff --git a/src/test/ui/span/typo-suggestion.stderr b/src/test/ui/span/typo-suggestion.stderr index dca0a93f897..2a084b1ae67 100644 --- a/src/test/ui/span/typo-suggestion.stderr +++ b/src/test/ui/span/typo-suggestion.stderr @@ -1,13 +1,13 @@ error[E0425]: cannot find value `bar` in this scope --> $DIR/typo-suggestion.rs:15:26 | -15 | println!("Hello {}", bar); +15 | println!("Hello {}", bar); //~ ERROR cannot find value | ^^^ not found in this scope error[E0425]: cannot find value `fob` in this scope --> $DIR/typo-suggestion.rs:18:26 | -18 | println!("Hello {}", fob); +18 | println!("Hello {}", fob); //~ ERROR cannot find value | ^^^ did you mean `foo`? error: aborting due to 2 previous errors diff --git a/src/test/ui/span/unused-warning-point-at-signature.rs b/src/test/ui/span/unused-warning-point-at-signature.rs index eb659d08da0..6a7071d49ae 100644 --- a/src/test/ui/span/unused-warning-point-at-signature.rs +++ b/src/test/ui/span/unused-warning-point-at-signature.rs @@ -12,25 +12,25 @@ #![warn(unused)] -enum Enum { +enum Enum { //~ WARN enum is never used A, B, C, D, } -struct Struct { +struct Struct { //~ WARN struct is never used a: usize, b: usize, c: usize, d: usize, } -fn func() -> usize { +fn func() -> usize { //~ WARN function is never used 3 } -fn +fn //~ WARN function is never used func_complete_span() -> usize { diff --git a/src/test/ui/span/unused-warning-point-at-signature.stderr b/src/test/ui/span/unused-warning-point-at-signature.stderr index 8e658670e9c..ed36bd17801 100644 --- a/src/test/ui/span/unused-warning-point-at-signature.stderr +++ b/src/test/ui/span/unused-warning-point-at-signature.stderr @@ -1,7 +1,7 @@ warning: enum is never used: `Enum` --> $DIR/unused-warning-point-at-signature.rs:15:1 | -15 | enum Enum { +15 | enum Enum { //~ WARN enum is never used | ^^^^^^^^^ | note: lint level defined here @@ -14,19 +14,19 @@ note: lint level defined here warning: struct is never used: `Struct` --> $DIR/unused-warning-point-at-signature.rs:22:1 | -22 | struct Struct { +22 | struct Struct { //~ WARN struct is never used | ^^^^^^^^^^^^^ warning: function is never used: `func` --> $DIR/unused-warning-point-at-signature.rs:29:1 | -29 | fn func() -> usize { +29 | fn func() -> usize { //~ WARN function is never used | ^^^^^^^^^^^^^^^^^^ warning: function is never used: `func_complete_span` --> $DIR/unused-warning-point-at-signature.rs:33:1 | -33 | / fn +33 | / fn //~ WARN function is never used 34 | | func_complete_span() 35 | | -> usize 36 | | { diff --git a/src/test/ui/span/visibility-ty-params.rs b/src/test/ui/span/visibility-ty-params.rs index 2a4a5edd04c..5df28971e99 100644 --- a/src/test/ui/span/visibility-ty-params.rs +++ b/src/test/ui/span/visibility-ty-params.rs @@ -14,7 +14,6 @@ macro_rules! m { struct S<T>(T); m!{ S<u8> } //~ ERROR unexpected generic arguments in path -//~^ ERROR expected module, found struct `S` mod m { m!{ m<> } //~ ERROR unexpected generic arguments in path diff --git a/src/test/ui/span/visibility-ty-params.stderr b/src/test/ui/span/visibility-ty-params.stderr index 673b9a38e03..8460f81af83 100644 --- a/src/test/ui/span/visibility-ty-params.stderr +++ b/src/test/ui/span/visibility-ty-params.stderr @@ -5,9 +5,9 @@ error: unexpected generic arguments in path | ^^^^^ error: unexpected generic arguments in path - --> $DIR/visibility-ty-params.rs:20:9 + --> $DIR/visibility-ty-params.rs:19:9 | -20 | m!{ m<> } //~ ERROR unexpected generic arguments in path +19 | m!{ m<> } //~ ERROR unexpected generic arguments in path | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs index b9d292fd156..ce5ec63fbd1 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.rs +++ b/src/test/ui/span/wf-method-late-bound-regions.rs @@ -27,7 +27,7 @@ fn main() { let f2 = f; let dangling = { let pointer = Box::new(42); - f2.xmute(&pointer) //~ ERROR `pointer` does not live long enough - }; + f2.xmute(&pointer) + }; //~ ERROR `pointer` does not live long enough println!("{}", dangling); } diff --git a/src/test/ui/span/wf-method-late-bound-regions.stderr b/src/test/ui/span/wf-method-late-bound-regions.stderr index a37b5d17aac..a3fdc53b8e5 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.stderr +++ b/src/test/ui/span/wf-method-late-bound-regions.stderr @@ -1,9 +1,9 @@ error[E0597]: `pointer` does not live long enough --> $DIR/wf-method-late-bound-regions.rs:31:5 | -30 | f2.xmute(&pointer) //~ ERROR `pointer` does not live long enough +30 | f2.xmute(&pointer) | ------- borrow occurs here -31 | }; +31 | }; //~ ERROR `pointer` does not live long enough | ^ `pointer` dropped here while still borrowed 32 | println!("{}", dangling); 33 | } |
