diff options
Diffstat (limited to 'tests/ui/issues')
75 files changed, 130 insertions, 864 deletions
diff --git a/tests/ui/issues/auxiliary/issue-111011.stderr b/tests/ui/issues/auxiliary/issue-111011.stderr index 082f0f035..c0b48c584 100644 --- a/tests/ui/issues/auxiliary/issue-111011.stderr +++ b/tests/ui/issues/auxiliary/issue-111011.stderr @@ -17,7 +17,7 @@ LL | bar(async move || {}); | arguments to this function are incorrect | = note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>` - found closure `[closure@$DIR/issue-111011.rs:11:9: 11:22]` + found closure `{closure@$DIR/issue-111011.rs:11:9: 11:22}` = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html note: function defined here --> $DIR/issue-111011.rs:7:4 diff --git a/tests/ui/issues/auxiliary/issue-29181.rs b/tests/ui/issues/auxiliary/issue-29181.rs deleted file mode 100644 index bd1a9be4e..000000000 --- a/tests/ui/issues/auxiliary/issue-29181.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_type="lib"] - -pub mod foo { - pub use super::*; -} diff --git a/tests/ui/issues/issue-10764.stderr b/tests/ui/issues/issue-10764.stderr index fcb45affe..4d8a85a13 100644 --- a/tests/ui/issues/issue-10764.stderr +++ b/tests/ui/issues/issue-10764.stderr @@ -8,7 +8,6 @@ LL | fn main() { f(bar) } | = note: expected fn pointer `fn()` found fn item `extern "C" fn() {bar}` - = note: when the arguments and return types match, functions can be coerced to function pointers note: function defined here --> $DIR/issue-10764.rs:1:4 | diff --git a/tests/ui/issues/issue-11873.rs b/tests/ui/issues/issue-11873.rs deleted file mode 100644 index d3bd05caf..000000000 --- a/tests/ui/issues/issue-11873.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - let mut v = vec![1]; - let mut f = || v.push(2); - let _w = v; //~ ERROR: cannot move out of `v` - - f(); -} diff --git a/tests/ui/issues/issue-11873.stderr b/tests/ui/issues/issue-11873.stderr deleted file mode 100644 index c814eedd2..000000000 --- a/tests/ui/issues/issue-11873.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0505]: cannot move out of `v` because it is borrowed - --> $DIR/issue-11873.rs:4:14 - | -LL | let mut f = || v.push(2); - | -- - borrow occurs due to use in closure - | | - | borrow of `v` occurs here -LL | let _w = 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`. diff --git a/tests/ui/issues/issue-12127.stderr b/tests/ui/issues/issue-12127.stderr index 2c451b07f..2e5858679 100644 --- a/tests/ui/issues/issue-12127.stderr +++ b/tests/ui/issues/issue-12127.stderr @@ -11,7 +11,7 @@ note: this value implements `FnOnce`, which causes it to be moved when called | LL | f(); | ^ - = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:30]`, which does not implement the `Copy` trait + = note: move occurs because `f` has type `{closure@$DIR/issue-12127.rs:8:24: 8:30}`, which does not implement the `Copy` trait error: aborting due to previous error diff --git a/tests/ui/issues/issue-13033.rs b/tests/ui/issues/issue-13033.rs deleted file mode 100644 index fdb356e70..000000000 --- a/tests/ui/issues/issue-13033.rs +++ /dev/null @@ -1,14 +0,0 @@ -trait Foo { - fn bar(&mut self, other: &mut dyn Foo); -} - -struct Baz; - -impl Foo for Baz { - fn bar(&mut self, other: &dyn Foo) {} - //~^ ERROR method `bar` has an incompatible type for trait - //~| expected signature `fn(&mut Baz, &mut dyn Foo)` - //~| found signature `fn(&mut Baz, &dyn Foo)` -} - -fn main() {} diff --git a/tests/ui/issues/issue-13033.stderr b/tests/ui/issues/issue-13033.stderr deleted file mode 100644 index db2c1189e..000000000 --- a/tests/ui/issues/issue-13033.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0053]: method `bar` has an incompatible type for trait - --> $DIR/issue-13033.rs:8:30 - | -LL | fn bar(&mut self, other: &dyn Foo) {} - | ^^^^^^^^ - | | - | types differ in mutability - | help: change the parameter type to match the trait: `&mut dyn Foo` - | -note: type in trait - --> $DIR/issue-13033.rs:2:30 - | -LL | fn bar(&mut self, other: &mut dyn Foo); - | ^^^^^^^^^^^^ - = note: expected signature `fn(&mut Baz, &mut dyn Foo)` - found signature `fn(&mut Baz, &dyn Foo)` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/tests/ui/issues/issue-17252.stderr b/tests/ui/issues/issue-17252.stderr index daaf82e80..32e20d774 100644 --- a/tests/ui/issues/issue-17252.stderr +++ b/tests/ui/issues/issue-17252.stderr @@ -1,10 +1,15 @@ -error[E0391]: cycle detected when const-evaluating + checking `FOO` +error[E0391]: cycle detected when simplifying constant for the type system `FOO` + --> $DIR/issue-17252.rs:1:1 + | +LL | const FOO: usize = FOO; + | ^^^^^^^^^^^^^^^^ + | +note: ...which requires const-evaluating + checking `FOO`... --> $DIR/issue-17252.rs:1:20 | LL | const FOO: usize = FOO; | ^^^ - | - = note: ...which immediately requires const-evaluating + checking `FOO` again + = note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle note: cycle used when const-evaluating + checking `main::{constant#0}` --> $DIR/issue-17252.rs:4:18 | diff --git a/tests/ui/issues/issue-17431-1.rs b/tests/ui/issues/issue-17431-1.rs deleted file mode 100644 index 3b692cc0e..000000000 --- a/tests/ui/issues/issue-17431-1.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct Foo { foo: Option<Option<Foo>> } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/tests/ui/issues/issue-17431-1.stderr b/tests/ui/issues/issue-17431-1.stderr deleted file mode 100644 index e3af8976c..000000000 --- a/tests/ui/issues/issue-17431-1.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-1.rs:1:1 - | -LL | struct Foo { foo: Option<Option<Foo>> } - | ^^^^^^^^^^ --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | struct Foo { foo: Option<Option<Box<Foo>>> } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-2.rs b/tests/ui/issues/issue-17431-2.rs deleted file mode 100644 index f7b9c6a55..000000000 --- a/tests/ui/issues/issue-17431-2.rs +++ /dev/null @@ -1,8 +0,0 @@ -struct Baz { q: Option<Foo> } -//~^ ERROR recursive types `Baz` and `Foo` have infinite size - -struct Foo { q: Option<Baz> } - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/tests/ui/issues/issue-17431-2.stderr b/tests/ui/issues/issue-17431-2.stderr deleted file mode 100644 index 39a99ec1e..000000000 --- a/tests/ui/issues/issue-17431-2.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0072]: recursive types `Baz` and `Foo` have infinite size - --> $DIR/issue-17431-2.rs:1:1 - | -LL | struct Baz { q: Option<Foo> } - | ^^^^^^^^^^ --- recursive without indirection -... -LL | struct Foo { q: Option<Baz> } - | ^^^^^^^^^^ --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL ~ struct Baz { q: Option<Box<Foo>> } -LL | -LL | -LL ~ struct Foo { q: Option<Box<Baz>> } - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-3.rs b/tests/ui/issues/issue-17431-3.rs deleted file mode 100644 index 83a63a88b..000000000 --- a/tests/ui/issues/issue-17431-3.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::sync::Mutex; - -struct Foo { foo: Mutex<Option<Foo>> } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() {} diff --git a/tests/ui/issues/issue-17431-3.stderr b/tests/ui/issues/issue-17431-3.stderr deleted file mode 100644 index 394134c78..000000000 --- a/tests/ui/issues/issue-17431-3.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-3.rs:3:1 - | -LL | struct Foo { foo: Mutex<Option<Foo>> } - | ^^^^^^^^^^ --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | struct Foo { foo: Mutex<Option<Box<Foo>>> } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-4.rs b/tests/ui/issues/issue-17431-4.rs deleted file mode 100644 index 48f0dba2a..000000000 --- a/tests/ui/issues/issue-17431-4.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::marker; - -struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> } -//~^ ERROR recursive type `Foo` has infinite size - -impl<T> Foo<T> { fn bar(&self) {} } - -fn main() {} diff --git a/tests/ui/issues/issue-17431-4.stderr b/tests/ui/issues/issue-17431-4.stderr deleted file mode 100644 index 3d141e44b..000000000 --- a/tests/ui/issues/issue-17431-4.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-4.rs:3:1 - | -LL | struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> } - | ^^^^^^^^^^^^^ ------ recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | struct Foo<T> { foo: Option<Option<Box<Foo<T>>>>, marker: marker::PhantomData<T> } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-5.rs b/tests/ui/issues/issue-17431-5.rs deleted file mode 100644 index 0fd6ee611..000000000 --- a/tests/ui/issues/issue-17431-5.rs +++ /dev/null @@ -1,11 +0,0 @@ -use std::marker; - -struct Foo { foo: Bar<Foo> } - -struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> } -//~^ ERROR recursive type `Bar` has infinite size - -impl Foo { fn foo(&self) {} } - -fn main() { -} diff --git a/tests/ui/issues/issue-17431-5.stderr b/tests/ui/issues/issue-17431-5.stderr deleted file mode 100644 index 44a90a6fe..000000000 --- a/tests/ui/issues/issue-17431-5.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Bar` has infinite size - --> $DIR/issue-17431-5.rs:5:1 - | -LL | struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> } - | ^^^^^^^^^^^^^ -------- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | struct Bar<T> { x: Box<Bar<Foo>> , marker: marker::PhantomData<T> } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-6.rs b/tests/ui/issues/issue-17431-6.rs deleted file mode 100644 index b7e49873d..000000000 --- a/tests/ui/issues/issue-17431-6.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::sync::Mutex; - -enum Foo { X(Mutex<Option<Foo>>) } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(self) {} } - -fn main() {} diff --git a/tests/ui/issues/issue-17431-6.stderr b/tests/ui/issues/issue-17431-6.stderr deleted file mode 100644 index e0a822550..000000000 --- a/tests/ui/issues/issue-17431-6.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-6.rs:3:1 - | -LL | enum Foo { X(Mutex<Option<Foo>>) } - | ^^^^^^^^ --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | enum Foo { X(Mutex<Option<Box<Foo>>>) } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-17431-7.rs b/tests/ui/issues/issue-17431-7.rs deleted file mode 100644 index 4fd786278..000000000 --- a/tests/ui/issues/issue-17431-7.rs +++ /dev/null @@ -1,6 +0,0 @@ -enum Foo { Voo(Option<Option<Foo>>) } -//~^ ERROR recursive type `Foo` has infinite size - -impl Foo { fn bar(&self) {} } - -fn main() { } diff --git a/tests/ui/issues/issue-17431-7.stderr b/tests/ui/issues/issue-17431-7.stderr deleted file mode 100644 index ecf072b8e..000000000 --- a/tests/ui/issues/issue-17431-7.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-7.rs:1:1 - | -LL | enum Foo { Voo(Option<Option<Foo>>) } - | ^^^^^^^^ --- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle - | -LL | enum Foo { Voo(Option<Option<Box<Foo>>>) } - | ++++ + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0072`. diff --git a/tests/ui/issues/issue-18389.rs b/tests/ui/issues/issue-18389.rs index 05a5decf4..26b607f40 100644 --- a/tests/ui/issues/issue-18389.rs +++ b/tests/ui/issues/issue-18389.rs @@ -1,9 +1,4 @@ -#![feature(type_privacy_lints)] -#![warn(private_bounds)] - -// In this test both old and new private-in-public diagnostic were emitted. -// Old diagnostic will be deleted soon. -// See https://rust-lang.github.io/rfcs/2145-type-privacy.html. +// check-pass use std::any::Any; use std::any::TypeId; @@ -12,8 +7,7 @@ trait Private<P, R> { fn call(&self, p: P, r: R); } pub trait Public: Private< -//~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface -//~| WARNING trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public` +//~^ WARNING trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public` <Self as Public>::P, <Self as Public>::R > { diff --git a/tests/ui/issues/issue-18389.stderr b/tests/ui/issues/issue-18389.stderr index 18ffc4177..4706d1ba1 100644 --- a/tests/ui/issues/issue-18389.stderr +++ b/tests/ui/issues/issue-18389.stderr @@ -1,39 +1,19 @@ -error[E0445]: private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface - --> $DIR/issue-18389.rs:14:1 - | -LL | trait Private<P, R> { - | ------------------- `Private<<Self as Public>::P, <Self as Public>::R>` declared as private -... -LL | / pub trait Public: Private< -LL | | -LL | | -LL | | <Self as Public>::P, -LL | | <Self as Public>::R -LL | | > { - | |_^ can't leak private trait - warning: trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public` - --> $DIR/issue-18389.rs:14:1 + --> $DIR/issue-18389.rs:9:1 | LL | / pub trait Public: Private< LL | | -LL | | LL | | <Self as Public>::P, LL | | <Self as Public>::R LL | | > { | |_^ trait `Public` is reachable at visibility `pub` | note: but trait `Private<<Self as Public>::P, <Self as Public>::R>` is only usable at visibility `pub(crate)` - --> $DIR/issue-18389.rs:11:1 + --> $DIR/issue-18389.rs:6:1 | LL | trait Private<P, R> { | ^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/issue-18389.rs:2:9 - | -LL | #![warn(private_bounds)] - | ^^^^^^^^^^^^^^ + = note: `#[warn(private_bounds)]` on by default -error: aborting due to previous error; 1 warning emitted +warning: 1 warning emitted -For more information about this error, try `rustc --explain E0445`. diff --git a/tests/ui/issues/issue-18611.stderr b/tests/ui/issues/issue-18611.stderr index bd18d4622..784b9b984 100644 --- a/tests/ui/issues/issue-18611.stderr +++ b/tests/ui/issues/issue-18611.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `isize: HasState` is not satisfied | LL | fn add_state(op: <isize as HasState>::State) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize` + | +help: this trait has no implementations, consider adding one + --> $DIR/issue-18611.rs:5:1 + | +LL | trait HasState { + | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/tests/ui/issues/issue-21763.stderr b/tests/ui/issues/issue-21763.stderr index df50118ac..a887635d3 100644 --- a/tests/ui/issues/issue-21763.stderr +++ b/tests/ui/issues/issue-21763.stderr @@ -9,9 +9,6 @@ LL | foo::<HashMap<Rc<()>, Rc<()>>>(); = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send` note: required because it appears within the type `HashMap<Rc<()>, Rc<()>, RandomState>` --> $HASHBROWN_SRC_LOCATION - | -LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator + Clone = Global> { - | ^^^^^^^ note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL note: required by a bound in `foo` diff --git a/tests/ui/issues/issue-22638.rs b/tests/ui/issues/issue-22638.rs index 198ceccc2..c2407227c 100644 --- a/tests/ui/issues/issue-22638.rs +++ b/tests/ui/issues/issue-22638.rs @@ -1,5 +1,5 @@ // build-fail -// normalize-stderr-test: "<\[closure@.+`" -> "$$CLOSURE`" +// normalize-stderr-test: "<\{closure@.+`" -> "$$CLOSURE`" // normalize-stderr-test: ".nll/" -> "/" #![allow(unused)] @@ -54,7 +54,7 @@ impl D { pub fn matches<F: Fn()>(&self, f: &F) { let &D(ref a) = self; a.matches(f) - //~^ ERROR reached the recursion limit while instantiating `A::matches::<[closure + //~^ ERROR reached the recursion limit while instantiating `A::matches::<{closure } } diff --git a/tests/ui/issues/issue-23302-1.stderr b/tests/ui/issues/issue-23302-1.stderr index d807e2440..d753bdeb9 100644 --- a/tests/ui/issues/issue-23302-1.stderr +++ b/tests/ui/issues/issue-23302-1.stderr @@ -1,10 +1,15 @@ -error[E0391]: cycle detected when const-evaluating + checking `X::A::{constant#0}` +error[E0391]: cycle detected when simplifying constant for the type system `X::A::{constant#0}` --> $DIR/issue-23302-1.rs:4:9 | LL | A = X::A as isize, | ^^^^^^^^^^^^^ | - = note: ...which immediately requires const-evaluating + checking `X::A::{constant#0}` again +note: ...which requires const-evaluating + checking `X::A::{constant#0}`... + --> $DIR/issue-23302-1.rs:4:9 + | +LL | A = X::A as isize, + | ^^^^^^^^^^^^^ + = note: ...which again requires simplifying constant for the type system `X::A::{constant#0}`, completing the cycle note: cycle used when simplifying constant for the type system `X::A::{constant#0}` --> $DIR/issue-23302-1.rs:4:9 | diff --git a/tests/ui/issues/issue-23302-2.stderr b/tests/ui/issues/issue-23302-2.stderr index 91b39dba1..b756ee1d5 100644 --- a/tests/ui/issues/issue-23302-2.stderr +++ b/tests/ui/issues/issue-23302-2.stderr @@ -1,10 +1,15 @@ -error[E0391]: cycle detected when const-evaluating + checking `Y::A::{constant#0}` +error[E0391]: cycle detected when simplifying constant for the type system `Y::A::{constant#0}` --> $DIR/issue-23302-2.rs:4:9 | LL | A = Y::B as isize, | ^^^^^^^^^^^^^ | - = note: ...which immediately requires const-evaluating + checking `Y::A::{constant#0}` again +note: ...which requires const-evaluating + checking `Y::A::{constant#0}`... + --> $DIR/issue-23302-2.rs:4:9 + | +LL | A = Y::B as isize, + | ^^^^^^^^^^^^^ + = note: ...which again requires simplifying constant for the type system `Y::A::{constant#0}`, completing the cycle note: cycle used when simplifying constant for the type system `Y::A::{constant#0}` --> $DIR/issue-23302-2.rs:4:9 | diff --git a/tests/ui/issues/issue-23302-3.stderr b/tests/ui/issues/issue-23302-3.stderr index 6b708d81f..6cdc94551 100644 --- a/tests/ui/issues/issue-23302-3.stderr +++ b/tests/ui/issues/issue-23302-3.stderr @@ -1,15 +1,25 @@ -error[E0391]: cycle detected when const-evaluating + checking `A` +error[E0391]: cycle detected when simplifying constant for the type system `A` + --> $DIR/issue-23302-3.rs:1:1 + | +LL | const A: i32 = B; + | ^^^^^^^^^^^^ + | +note: ...which requires const-evaluating + checking `A`... --> $DIR/issue-23302-3.rs:1:16 | LL | const A: i32 = B; | ^ +note: ...which requires simplifying constant for the type system `B`... + --> $DIR/issue-23302-3.rs:3:1 | +LL | const B: i32 = A; + | ^^^^^^^^^^^^ note: ...which requires const-evaluating + checking `B`... --> $DIR/issue-23302-3.rs:3:16 | LL | const B: i32 = A; | ^ - = note: ...which again requires const-evaluating + checking `A`, completing the cycle + = note: ...which again requires simplifying constant for the type system `A`, completing the cycle note: cycle used when simplifying constant for the type system `A` --> $DIR/issue-23302-3.rs:1:1 | diff --git a/tests/ui/issues/issue-24036.stderr b/tests/ui/issues/issue-24036.stderr index 0e73a51fa..a425816cd 100644 --- a/tests/ui/issues/issue-24036.stderr +++ b/tests/ui/issues/issue-24036.stderr @@ -6,8 +6,8 @@ LL | let mut x = |c| c + 1; LL | x = |c| c + 1; | ^^^^^^^^^ expected closure, found a different closure | - = note: expected closure `[closure@$DIR/issue-24036.rs:2:17: 2:20]` - found closure `[closure@$DIR/issue-24036.rs:3:9: 3:12]` + = note: expected closure `{closure@$DIR/issue-24036.rs:2:17: 2:20}` + found closure `{closure@$DIR/issue-24036.rs:3:9: 3:12}` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object diff --git a/tests/ui/issues/issue-25076.stderr b/tests/ui/issues/issue-25076.stderr index 159cc484c..065bf7def 100644 --- a/tests/ui/issues/issue-25076.stderr +++ b/tests/ui/issues/issue-25076.stderr @@ -6,6 +6,11 @@ LL | do_fold(bot(), ()); | | | required by a bound introduced by this call | +help: this trait has no implementations, consider adding one + --> $DIR/issue-25076.rs:3:1 + | +LL | trait InOut<T> { type Out; } + | ^^^^^^^^^^^^^^ note: required by a bound in `do_fold` --> $DIR/issue-25076.rs:5:18 | diff --git a/tests/ui/issues/issue-25439.rs b/tests/ui/issues/issue-25439.rs deleted file mode 100644 index 4f73ff3e3..000000000 --- a/tests/ui/issues/issue-25439.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct Helper<'a, F: 'a>(&'a F); - -fn fix<F>(f: F) -> i32 where F: Fn(Helper<F>, i32) -> i32 { - f(Helper(&f), 8) -} - -fn main() { - fix(|_, x| x); //~ ERROR closure/generator type that references itself [E0644] -} diff --git a/tests/ui/issues/issue-25439.stderr b/tests/ui/issues/issue-25439.stderr deleted file mode 100644 index dadae23fd..000000000 --- a/tests/ui/issues/issue-25439.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0644]: closure/generator type that references itself - --> $DIR/issue-25439.rs:8:9 - | -LL | fix(|_, x| x); - | ^^^^^^ cyclic type of infinite size - | - = note: closures cannot capture themselves or take themselves as argument; - this error may be the result of a recent compiler bug-fix, - see issue #46062 <https://github.com/rust-lang/rust/issues/46062> - for more information -note: required by a bound in `fix` - --> $DIR/issue-25439.rs:3:33 - | -LL | fn fix<F>(f: F) -> i32 where F: Fn(Helper<F>, i32) -> i32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `fix` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0644`. diff --git a/tests/ui/issues/issue-27042.stderr b/tests/ui/issues/issue-27042.stderr index 59ef28481..01532de99 100644 --- a/tests/ui/issues/issue-27042.stderr +++ b/tests/ui/issues/issue-27042.stderr @@ -11,11 +11,18 @@ LL | | while true { break }; // but here we cite the whole loop error[E0308]: mismatched types --> $DIR/issue-27042.rs:6:16 | +LL | let _: i32 = + | - expected because of this assignment +LL | 'a: // in this case, the citation is just the `break`: LL | loop { break }; - | ^^^^^ - | | - | expected `i32`, found `()` - | help: give it a value of the expected type: `break 42` + | ---- ^^^^^ expected `i32`, found `()` + | | + | this loop is expected to be of type `i32` + | +help: give it a value of the expected type + | +LL | loop { break 42 }; + | ++ error[E0308]: mismatched types --> $DIR/issue-27042.rs:8:9 diff --git a/tests/ui/issues/issue-29147.stderr b/tests/ui/issues/issue-29147.stderr index 138d477dc..d0d948531 100644 --- a/tests/ui/issues/issue-29147.stderr +++ b/tests/ui/issues/issue-29147.stderr @@ -1,8 +1,8 @@ error[E0283]: type annotations needed - --> $DIR/issue-29147.rs:22:13 + --> $DIR/issue-29147.rs:22:14 | LL | let _ = <S5<_>>::xxx; - | ^^^^^^^^^^^^ cannot infer type for struct `S5<_>` + | ^^^^^ cannot infer type for struct `S5<_>` | note: multiple `impl`s satisfying `S5<_>: Foo` found --> $DIR/issue-29147.rs:18:1 diff --git a/tests/ui/issues/issue-29181.rs b/tests/ui/issues/issue-29181.rs deleted file mode 100644 index 70e5bc019..000000000 --- a/tests/ui/issues/issue-29181.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:issue-29181.rs - -extern crate issue_29181 as foo; - -fn main() { - 0.homura(); //~ ERROR no method named `homura` found - // Issue #47759, detect existing method on the fundamental impl: - let _ = |x: f64| x * 2.0.exp(); //~ ERROR can't call method `exp` on ambiguous numeric type -} diff --git a/tests/ui/issues/issue-29181.stderr b/tests/ui/issues/issue-29181.stderr deleted file mode 100644 index 53addf2fe..000000000 --- a/tests/ui/issues/issue-29181.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0599]: no method named `homura` found for type `{integer}` in the current scope - --> $DIR/issue-29181.rs:6:7 - | -LL | 0.homura(); - | ^^^^^^ method not found in `{integer}` - -error[E0689]: can't call method `exp` on ambiguous numeric type `{float}` - --> $DIR/issue-29181.rs:8:30 - | -LL | let _ = |x: f64| x * 2.0.exp(); - | ^^^ - | -help: you must specify a concrete type for this numeric value, like `f32` - | -LL | let _ = |x: f64| x * 2.0_f32.exp(); - | ~~~~~~~ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0599, E0689. -For more information about an error, try `rustc --explain E0599`. diff --git a/tests/ui/issues/issue-3214.rs b/tests/ui/issues/issue-3214.rs index e3c07bb3f..b2c27f5be 100644 --- a/tests/ui/issues/issue-3214.rs +++ b/tests/ui/issues/issue-3214.rs @@ -1,6 +1,6 @@ fn foo<T>() { struct Foo { - x: T, //~ ERROR can't use generic parameters from outer function + x: T, //~ ERROR can't use generic parameters from outer item } impl<T> Drop for Foo<T> { diff --git a/tests/ui/issues/issue-3214.stderr b/tests/ui/issues/issue-3214.stderr index 7a2d772f0..5b57c1baf 100644 --- a/tests/ui/issues/issue-3214.stderr +++ b/tests/ui/issues/issue-3214.stderr @@ -1,12 +1,12 @@ -error[E0401]: can't use generic parameters from outer function +error[E0401]: can't use generic parameters from outer item --> $DIR/issue-3214.rs:3:12 | LL | fn foo<T>() { - | - type parameter from outer function + | - type parameter from outer item LL | struct Foo { - | - help: try using a local generic parameter instead: `<T>` + | - help: try introducing a local generic parameter here: `<T>` LL | x: T, - | ^ use of generic parameter from outer function + | ^ use of generic parameter from outer item error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-3214.rs:6:22 diff --git a/tests/ui/issues/issue-32323.rs b/tests/ui/issues/issue-32323.rs deleted file mode 100644 index 5078f5523..000000000 --- a/tests/ui/issues/issue-32323.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub trait Tr<'a> { - type Out; -} - -pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {} -//~^ ERROR mismatched types - -pub fn main() {} diff --git a/tests/ui/issues/issue-32323.stderr b/tests/ui/issues/issue-32323.stderr deleted file mode 100644 index 8212c607e..000000000 --- a/tests/ui/issues/issue-32323.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-32323.rs:5:30 - | -LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {} - | - ^^^^^^^^^^^^^^^^^^ expected associated type, found `()` - | | - | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected associated type `<T as Tr<'a>>::Out` - found unit type `()` -help: consider constraining the associated type `<T as Tr<'a>>::Out` to `()` - | -LL | pub fn f<'a, T: Tr<'a, Out = ()>>() -> <T as Tr<'a>>::Out {} - | ++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-32709.rs b/tests/ui/issues/issue-32709.rs deleted file mode 100644 index c05bfdc4c..000000000 --- a/tests/ui/issues/issue-32709.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Make sure that the span of try shorthand does not include the trailing -// semicolon; -fn a() -> Result<i32, ()> { - Err(5)?; //~ ERROR - Ok(1) -} - -fn main() {} diff --git a/tests/ui/issues/issue-32709.stderr b/tests/ui/issues/issue-32709.stderr deleted file mode 100644 index 94e8f9295..000000000 --- a/tests/ui/issues/issue-32709.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0277]: `?` couldn't convert the error to `()` - --> $DIR/issue-32709.rs:4:11 - | -LL | fn a() -> Result<i32, ()> { - | --------------- expected `()` because of this -LL | Err(5)?; - | ^ the trait `From<{integer}>` is not implemented for `()` - | - = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - = help: the following other types implement trait `From<T>`: - <(T,) as From<[T; 1]>> - <(T, T) as From<[T; 2]>> - <(T, T, T) as From<[T; 3]>> - <(T, T, T, T) as From<[T; 4]>> - <(T, T, T, T, T) as From<[T; 5]>> - <(T, T, T, T, T, T) as From<[T; 6]>> - <(T, T, T, T, T, T, T) as From<[T; 7]>> - <(T, T, T, T, T, T, T, T) as From<[T; 8]>> - and 4 others - = note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/issues/issue-34721.fixed b/tests/ui/issues/issue-34721.fixed deleted file mode 100644 index f135ad383..000000000 --- a/tests/ui/issues/issue-34721.fixed +++ /dev/null @@ -1,34 +0,0 @@ -// run-rustfix - -pub trait Foo { - fn zero(self) -> Self; -} - -impl Foo for u32 { - fn zero(self) -> u32 { 0u32 } -} - -pub mod bar { - pub use Foo; - pub fn bar<T: Foo>(x: T) -> T { - x.zero() - } -} - -mod baz { - use bar; - use Foo; - pub fn baz<T: Foo + Copy>(x: T) -> T { - if 0 == 1 { - bar::bar(x.zero()) - } else { - x.zero() - }; - x.zero() - //~^ ERROR use of moved value - } -} - -fn main() { - let _ = baz::baz(0u32); -} diff --git a/tests/ui/issues/issue-34721.rs b/tests/ui/issues/issue-34721.rs deleted file mode 100644 index 14dd01766..000000000 --- a/tests/ui/issues/issue-34721.rs +++ /dev/null @@ -1,34 +0,0 @@ -// run-rustfix - -pub trait Foo { - fn zero(self) -> Self; -} - -impl Foo for u32 { - fn zero(self) -> u32 { 0u32 } -} - -pub mod bar { - pub use Foo; - pub fn bar<T: Foo>(x: T) -> T { - x.zero() - } -} - -mod baz { - use bar; - use Foo; - pub fn baz<T: Foo>(x: T) -> T { - if 0 == 1 { - bar::bar(x.zero()) - } else { - x.zero() - }; - x.zero() - //~^ ERROR use of moved value - } -} - -fn main() { - let _ = baz::baz(0u32); -} diff --git a/tests/ui/issues/issue-34721.stderr b/tests/ui/issues/issue-34721.stderr deleted file mode 100644 index f2bf22227..000000000 --- a/tests/ui/issues/issue-34721.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/issue-34721.rs:27:9 - | -LL | pub fn baz<T: Foo>(x: T) -> T { - | - move occurs because `x` has type `T`, which does not implement the `Copy` trait -LL | if 0 == 1 { -LL | bar::bar(x.zero()) - | ------ `x` moved due to this method call -LL | } else { -LL | x.zero() - | ------ `x` moved due to this method call -LL | }; -LL | x.zero() - | ^ value used here after move - | -note: `Foo::zero` takes ownership of the receiver `self`, which moves `x` - --> $DIR/issue-34721.rs:4:13 - | -LL | fn zero(self) -> Self; - | ^^^^ -help: consider further restricting this bound - | -LL | pub fn baz<T: Foo + Copy>(x: T) -> T { - | ++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/tests/ui/issues/issue-35570.stderr b/tests/ui/issues/issue-35570.stderr index 2697d46bd..197e80ac0 100644 --- a/tests/ui/issues/issue-35570.stderr +++ b/tests/ui/issues/issue-35570.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied | LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()` + | +help: this trait has no implementations, consider adding one + --> $DIR/issue-35570.rs:4:1 + | +LL | trait Trait2<'a> { + | ^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/tests/ui/issues/issue-3707.rs b/tests/ui/issues/issue-3707.rs deleted file mode 100644 index 0817c51ee..000000000 --- a/tests/ui/issues/issue-3707.rs +++ /dev/null @@ -1,18 +0,0 @@ -struct Obj { - member: usize -} - -impl Obj { - pub fn boom() -> bool { - return 1+1 == 2 - } - pub fn chirp(&self) { - self.boom(); //~ ERROR no method named `boom` found - } -} - -fn main() { - let o = Obj { member: 0 }; - o.chirp(); - 1 + 1; -} diff --git a/tests/ui/issues/issue-3707.stderr b/tests/ui/issues/issue-3707.stderr deleted file mode 100644 index 07c8101cb..000000000 --- a/tests/ui/issues/issue-3707.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0599]: no method named `boom` found for reference `&Obj` in the current scope - --> $DIR/issue-3707.rs:10:14 - | -LL | self.boom(); - | -----^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Obj::boom()` - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: the candidate is defined in an impl for the type `Obj` - --> $DIR/issue-3707.rs:6:5 - | -LL | pub fn boom() -> bool { - | ^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/issues/issue-39467.rs b/tests/ui/issues/issue-39467.rs deleted file mode 100644 index 397751e4e..000000000 --- a/tests/ui/issues/issue-39467.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -#![allow(dead_code)] -macro_rules! expr { () => { () } } - -enum A {} - -impl A { - const A: () = expr!(); -} - -fn main() {} diff --git a/tests/ui/issues/issue-39970.stderr b/tests/ui/issues/issue-39970.stderr index 8344b88c3..713bc404f 100644 --- a/tests/ui/issues/issue-39970.stderr +++ b/tests/ui/issues/issue-39970.stderr @@ -1,8 +1,8 @@ error[E0271]: type mismatch resolving `<() as Array<'a>>::Element == ()` - --> $DIR/issue-39970.rs:19:5 + --> $DIR/issue-39970.rs:19:6 | LL | <() as Visit>::visit(); - | ^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<() as Array<'a>>::Element == ()` + | ^^ type mismatch resolving `<() as Array<'a>>::Element == ()` | note: expected this to be `()` --> $DIR/issue-39970.rs:10:20 diff --git a/tests/ui/issues/issue-41880.stderr b/tests/ui/issues/issue-41880.stderr index 00c375f8d..6414e2692 100644 --- a/tests/ui/issues/issue-41880.stderr +++ b/tests/ui/issues/issue-41880.stderr @@ -5,7 +5,7 @@ LL | pub struct Iterate<T, F> { | ------------------------ method `iter` not found for this struct ... LL | println!("{:?}", a.iter().take(10).collect::<Vec<usize>>()); - | ^^^^ method not found in `Iterate<{integer}, [closure@issue-41880.rs:26:24]>` + | ^^^^ method not found in `Iterate<{integer}, {closure@issue-41880.rs:26:24}>` error: aborting due to previous error diff --git a/tests/ui/issues/issue-43988.stderr b/tests/ui/issues/issue-43988.stderr index 02c5dd5bf..7bbb8ed2c 100644 --- a/tests/ui/issues/issue-43988.stderr +++ b/tests/ui/issues/issue-43988.stderr @@ -32,7 +32,7 @@ error[E0552]: unrecognized representation hint LL | #[repr(nothing)] | ^^^^^^^ | - = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` error[E0552]: unrecognized representation hint --> $DIR/issue-43988.rs:18:12 @@ -40,7 +40,7 @@ error[E0552]: unrecognized representation hint LL | #[repr(something_not_real)] | ^^^^^^^^^^^^^^^^^^ | - = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` error[E0518]: attribute should be applied to function or closure --> $DIR/issue-43988.rs:30:5 diff --git a/tests/ui/issues/issue-48838.stderr b/tests/ui/issues/issue-48838.stderr index 3502af702..159199a7f 100644 --- a/tests/ui/issues/issue-48838.stderr +++ b/tests/ui/issues/issue-48838.stderr @@ -5,7 +5,7 @@ LL | Square = |x| x, | ^^^^^ expected `isize`, found closure | = note: expected type `isize` - found closure `[closure@$DIR/issue-48838.rs:2:14: 2:17]` + found closure `{closure@$DIR/issue-48838.rs:2:14: 2:17}` error: aborting due to previous error diff --git a/tests/ui/issues/issue-50600.stderr b/tests/ui/issues/issue-50600.stderr index 7fea7e5c0..d285c3467 100644 --- a/tests/ui/issues/issue-50600.stderr +++ b/tests/ui/issues/issue-50600.stderr @@ -5,7 +5,7 @@ LL | fn([u8; |x: u8| {}]), | ^^^^^^^^^^ expected `usize`, found closure | = note: expected type `usize` - found closure `[closure@$DIR/issue-50600.rs:2:13: 2:20]` + found closure `{closure@$DIR/issue-50600.rs:2:13: 2:20}` error: aborting due to previous error diff --git a/tests/ui/issues/issue-50688.stderr b/tests/ui/issues/issue-50688.stderr index 6973ad271..df7603d79 100644 --- a/tests/ui/issues/issue-50688.stderr +++ b/tests/ui/issues/issue-50688.stderr @@ -5,7 +5,7 @@ LL | [1; || {}]; | ^^^^^ expected `usize`, found closure | = note: expected type `usize` - found closure `[closure@$DIR/issue-50688.rs:2:9: 2:11]` + found closure `{closure@$DIR/issue-50688.rs:2:9: 2:11}` error: aborting due to previous error diff --git a/tests/ui/issues/issue-50714-1.stderr b/tests/ui/issues/issue-50714-1.stderr index 28469bee0..bacd09b2a 100644 --- a/tests/ui/issues/issue-50714-1.stderr +++ b/tests/ui/issues/issue-50714-1.stderr @@ -1,8 +1,8 @@ -error[E0647]: start function is not allowed to have a `where` clause +error[E0647]: `#[start]` function is not allowed to have a `where` clause --> $DIR/issue-50714-1.rs:9:50 | LL | fn start(_: isize, _: *const *const u8) -> isize where fn(&()): Eq { - | ^^^^^^^^^^^^^^^^^ start function cannot have a `where` clause + | ^^^^^^^^^^^^^^^^^ `#[start]` function cannot have a `where` clause error: aborting due to previous error diff --git a/tests/ui/issues/issue-51154.stderr b/tests/ui/issues/issue-51154.stderr index d8a833a86..002d5ccdc 100644 --- a/tests/ui/issues/issue-51154.stderr +++ b/tests/ui/issues/issue-51154.stderr @@ -9,7 +9,7 @@ LL | let _: Box<F> = Box::new(|| ()); | arguments to this function are incorrect | = note: expected type parameter `F` - found closure `[closure@$DIR/issue-51154.rs:2:30: 2:32]` + found closure `{closure@$DIR/issue-51154.rs:2:30: 2:32}` = help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F` note: associated function defined here --> $SRC_DIR/alloc/src/boxed.rs:LL:COL diff --git a/tests/ui/issues/issue-5997-enum.rs b/tests/ui/issues/issue-5997-enum.rs index 3ff4e036c..0b1857ae3 100644 --- a/tests/ui/issues/issue-5997-enum.rs +++ b/tests/ui/issues/issue-5997-enum.rs @@ -1,6 +1,6 @@ fn f<Z>() -> bool { enum E { V(Z) } - //~^ ERROR can't use generic parameters from outer function + //~^ ERROR can't use generic parameters from outer item true } diff --git a/tests/ui/issues/issue-5997-enum.stderr b/tests/ui/issues/issue-5997-enum.stderr index 3a79215d3..d07258ea7 100644 --- a/tests/ui/issues/issue-5997-enum.stderr +++ b/tests/ui/issues/issue-5997-enum.stderr @@ -1,12 +1,12 @@ -error[E0401]: can't use generic parameters from outer function +error[E0401]: can't use generic parameters from outer item --> $DIR/issue-5997-enum.rs:2:16 | LL | fn f<Z>() -> bool { - | - type parameter from outer function + | - type parameter from outer item LL | enum E { V(Z) } - | - ^ use of generic parameter from outer function + | - ^ use of generic parameter from outer item | | - | help: try using a local generic parameter instead: `<Z>` + | help: try introducing a local generic parameter here: `<Z>` error: aborting due to previous error diff --git a/tests/ui/issues/issue-5997-struct.rs b/tests/ui/issues/issue-5997-struct.rs index 6cf510b0a..19d994b0d 100644 --- a/tests/ui/issues/issue-5997-struct.rs +++ b/tests/ui/issues/issue-5997-struct.rs @@ -1,5 +1,5 @@ fn f<T>() -> bool { - struct S(T); //~ ERROR can't use generic parameters from outer function + struct S(T); //~ ERROR can't use generic parameters from outer item true } diff --git a/tests/ui/issues/issue-5997-struct.stderr b/tests/ui/issues/issue-5997-struct.stderr index d2e97f767..83229e02c 100644 --- a/tests/ui/issues/issue-5997-struct.stderr +++ b/tests/ui/issues/issue-5997-struct.stderr @@ -1,12 +1,12 @@ -error[E0401]: can't use generic parameters from outer function +error[E0401]: can't use generic parameters from outer item --> $DIR/issue-5997-struct.rs:2:14 | LL | fn f<T>() -> bool { - | - type parameter from outer function + | - type parameter from outer item LL | struct S(T); - | -^ use of generic parameter from outer function + | -^ use of generic parameter from outer item | | - | help: try using a local generic parameter instead: `<T>` + | help: try introducing a local generic parameter here: `<T>` error: aborting due to previous error diff --git a/tests/ui/issues/issue-60218.stderr b/tests/ui/issues/issue-60218.stderr index 563690c9a..ae3c4d120 100644 --- a/tests/ui/issues/issue-60218.stderr +++ b/tests/ui/issues/issue-60218.stderr @@ -6,6 +6,11 @@ LL | trigger_error(vec![], |x: &u32| x) | | | required by a bound introduced by this call | +help: this trait has no implementations, consider adding one + --> $DIR/issue-60218.rs:7:1 + | +LL | pub trait Foo {} + | ^^^^^^^^^^^^^ note: required by a bound in `trigger_error` --> $DIR/issue-60218.rs:13:72 | diff --git a/tests/ui/issues/issue-66353.stderr b/tests/ui/issues/issue-66353.stderr index 335618097..7ab7547b4 100644 --- a/tests/ui/issues/issue-66353.stderr +++ b/tests/ui/issues/issue-66353.stderr @@ -1,8 +1,14 @@ error[E0277]: the trait bound `(): _A` is not satisfied - --> $DIR/issue-66353.rs:12:14 + --> $DIR/issue-66353.rs:12:15 | LL | _Func::< <() as _A>::AssocT >::func(()); - | ^^^^^^^^^^^^^^^^^^ the trait `_A` is not implemented for `()` + | ^^ the trait `_A` is not implemented for `()` + | +help: this trait has no implementations, consider adding one + --> $DIR/issue-66353.rs:7:1 + | +LL | trait _A { + | ^^^^^^^^ error[E0277]: the trait bound `(): _Func<_>` is not satisfied --> $DIR/issue-66353.rs:12:41 @@ -11,6 +17,12 @@ LL | _Func::< <() as _A>::AssocT >::func(()); | ----------------------------------- ^^ the trait `_Func<_>` is not implemented for `()` | | | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/issue-66353.rs:3:1 + | +LL | trait _Func<T> { + | ^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-6642.rs b/tests/ui/issues/issue-6642.rs deleted file mode 100644 index f80f6fffe..000000000 --- a/tests/ui/issues/issue-6642.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct A; -impl A { - fn m(&self) { - fn x() { - self.m() //~ ERROR can't capture dynamic environment in a fn item - } - } -} -fn main() {} diff --git a/tests/ui/issues/issue-6642.stderr b/tests/ui/issues/issue-6642.stderr deleted file mode 100644 index 6668108d0..000000000 --- a/tests/ui/issues/issue-6642.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/issue-6642.rs:5:13 - | -LL | self.m() - | ^^^^ - | - = help: use the `|| { ... }` closure form instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0434`. diff --git a/tests/ui/issues/issue-66768.rs b/tests/ui/issues/issue-66768.rs deleted file mode 100644 index ce42c8b01..000000000 --- a/tests/ui/issues/issue-66768.rs +++ /dev/null @@ -1,205 +0,0 @@ -// Regression test for #66768. -// check-pass -#![allow(dead_code)] -//-^ "dead code" is needed to reproduce the issue. - -use std::marker::PhantomData; -use std::ops::{Add, Mul}; - -fn problematic_function<Space>(material_surface_element: Edge2dElement) -where - DefaultAllocator: FiniteElementAllocator<DimU1, Space>, -{ - let _: Point2<f64> = material_surface_element.map_reference_coords().into(); -} - -impl<T> ArrayLength<T> for UTerm { - type ArrayType = (); -} -impl<T, N: ArrayLength<T>> ArrayLength<T> for UInt<N, B0> { - type ArrayType = GenericArrayImplEven<T, N>; -} -impl<T, N: ArrayLength<T>> ArrayLength<T> for UInt<N, B1> { - type ArrayType = GenericArrayImplOdd<T, N>; -} -impl<U> Add<U> for UTerm { - type Output = U; - fn add(self, _: U) -> Self::Output { - unimplemented!() - } -} -impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0> -where - Ul: Add<Ur>, -{ - type Output = UInt<Sum<Ul, Ur>, B1>; - fn add(self, _: UInt<Ur, B1>) -> Self::Output { - unimplemented!() - } -} -impl<U> Mul<U> for UTerm { - type Output = UTerm; - fn mul(self, _: U) -> Self { - unimplemented!() - } -} -impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B0> -where - Ul: Mul<UInt<Ur, B>>, -{ - type Output = UInt<Prod<Ul, UInt<Ur, B>>, B0>; - fn mul(self, _: UInt<Ur, B>) -> Self::Output { - unimplemented!() - } -} -impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B1> -where - Ul: Mul<UInt<Ur, B>>, - UInt<Prod<Ul, UInt<Ur, B>>, B0>: Add<UInt<Ur, B>>, -{ - type Output = Sum<UInt<Prod<Ul, UInt<Ur, B>>, B0>, UInt<Ur, B>>; - fn mul(self, _: UInt<Ur, B>) -> Self::Output { - unimplemented!() - } -} -impl<N, R, C> Allocator<N, R, C> for DefaultAllocator -where - R: DimName, - C: DimName, - R::Value: Mul<C::Value>, - Prod<R::Value, C::Value>: ArrayLength<N>, -{ - type Buffer = ArrayStorage<N, R, C>; - fn allocate_uninitialized(_: R, _: C) -> Self::Buffer { - unimplemented!() - } - fn allocate_from_iterator<I>(_: R, _: C, _: I) -> Self::Buffer { - unimplemented!() - } -} -impl<N, C> Allocator<N, Dynamic, C> for DefaultAllocator { - type Buffer = VecStorage<N, Dynamic, C>; - fn allocate_uninitialized(_: Dynamic, _: C) -> Self::Buffer { - unimplemented!() - } - fn allocate_from_iterator<I>(_: Dynamic, _: C, _: I) -> Self::Buffer { - unimplemented!() - } -} -impl DimName for DimU1 { - type Value = U1; - fn name() -> Self { - unimplemented!() - } -} -impl DimName for DimU2 { - type Value = U2; - fn name() -> Self { - unimplemented!() - } -} -impl<N, D> From<VectorN<N, D>> for Point<N, D> -where - DefaultAllocator: Allocator<N, D>, -{ - fn from(_: VectorN<N, D>) -> Self { - unimplemented!() - } -} -impl<GeometryDim, NodalDim> FiniteElementAllocator<GeometryDim, NodalDim> for DefaultAllocator where - DefaultAllocator: Allocator<f64, GeometryDim> + Allocator<f64, NodalDim> -{ -} -impl ReferenceFiniteElement for Edge2dElement { - type NodalDim = DimU1; -} -impl FiniteElement<DimU2> for Edge2dElement { - fn map_reference_coords(&self) -> Vector2<f64> { - unimplemented!() - } -} - -type Owned<N, R, C> = <DefaultAllocator as Allocator<N, R, C>>::Buffer; -type MatrixMN<N, R, C> = Matrix<N, R, C, Owned<N, R, C>>; -type VectorN<N, D> = MatrixMN<N, D, DimU1>; -type Vector2<N> = VectorN<N, DimU2>; -type Point2<N> = Point<N, DimU2>; -type U1 = UInt<UTerm, B1>; -type U2 = UInt<UInt<UTerm, B1>, B0>; -type Sum<A, B> = <A as Add<B>>::Output; -type Prod<A, B> = <A as Mul<B>>::Output; - -struct GenericArray<T, U: ArrayLength<T>> { - _data: U::ArrayType, -} -struct GenericArrayImplEven<T, U> { - _parent2: U, - _marker: T, -} -struct GenericArrayImplOdd<T, U> { - _parent2: U, - _data: T, -} -struct B0; -struct B1; -struct UTerm; -struct UInt<U, B> { - _marker: PhantomData<(U, B)>, -} -struct DefaultAllocator; -struct Dynamic; -struct DimU1; -struct DimU2; -struct Matrix<N, R, C, S> { - _data: S, - _phantoms: PhantomData<(N, R, C)>, -} -struct ArrayStorage<N, R, C> -where - R: DimName, - C: DimName, - R::Value: Mul<C::Value>, - Prod<R::Value, C::Value>: ArrayLength<N>, -{ - _data: GenericArray<N, Prod<R::Value, C::Value>>, -} -struct VecStorage<N, R, C> { - _data: N, - _nrows: R, - _ncols: C, -} -struct Point<N, D> -where - DefaultAllocator: Allocator<N, D>, -{ - _coords: VectorN<N, D>, -} -struct Edge2dElement; - -trait ArrayLength<T> { - type ArrayType; -} -trait Allocator<Scalar, R, C = DimU1> { - type Buffer; - fn allocate_uninitialized(nrows: R, ncols: C) -> Self::Buffer; - fn allocate_from_iterator<I>(nrows: R, ncols: C, iter: I) -> Self::Buffer; -} -trait DimName { - type Value; - fn name() -> Self; -} -trait FiniteElementAllocator<GeometryDim, NodalDim>: - Allocator<f64, GeometryDim> + Allocator<f64, NodalDim> -{ -} -trait ReferenceFiniteElement { - type NodalDim; -} -trait FiniteElement<GeometryDim>: ReferenceFiniteElement -where - DefaultAllocator: FiniteElementAllocator<GeometryDim, Self::NodalDim>, -{ - fn map_reference_coords(&self) -> VectorN<f64, GeometryDim>; -} - -fn main() {} diff --git a/tests/ui/issues/issue-66923-show-error-for-correct-call.stderr b/tests/ui/issues/issue-66923-show-error-for-correct-call.stderr index cec482a53..22b1da64c 100644 --- a/tests/ui/issues/issue-66923-show-error-for-correct-call.stderr +++ b/tests/ui/issues/issue-66923-show-error-for-correct-call.stderr @@ -17,10 +17,12 @@ note: required by a bound in `collect` --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64` - --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29 + --> $DIR/issue-66923-show-error-for-correct-call.rs:12:39 | LL | let x3 = x1.into_iter().collect::<Vec<f64>>(); - | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` + | ------- ^^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` + | | + | required by a bound introduced by this call | = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>` = help: the trait `FromIterator<T>` is implemented for `Vec<T>` diff --git a/tests/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs b/tests/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs deleted file mode 100644 index 6e030f1cc..000000000 --- a/tests/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs +++ /dev/null @@ -1,33 +0,0 @@ -// run-fail -// compile-flags: -C opt-level=3 -// error-pattern: index out of bounds: the len is 0 but the index is 16777216 -// ignore-wasm no panic or subprocess support -// ignore-emscripten no panic or subprocess support - -fn do_test(x: usize) { - let mut arr = vec![vec![0u8; 3]]; - - let mut z = vec![0]; - for arr_ref in arr.iter_mut() { - for y in 0..x { - for _ in 0..1 { - z.reserve_exact(x); - let iterator = std::iter::repeat(0).take(x); - let mut cnt = 0; - iterator.for_each(|_| { - z[0] = 0; - cnt += 1; - }); - let a = y * x; - let b = (y + 1) * x - 1; - let slice = &mut arr_ref[a..b]; - slice[1 << 24] += 1; - } - } - } -} - -fn main() { - do_test(1); - do_test(2); -} diff --git a/tests/ui/issues/issue-69225-layout-repeated-checked-add.rs b/tests/ui/issues/issue-69225-layout-repeated-checked-add.rs deleted file mode 100644 index 7f43e4d1a..000000000 --- a/tests/ui/issues/issue-69225-layout-repeated-checked-add.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Ensure we appropriately error instead of overflowing a calculation when creating a new Alloc -// Layout - -// run-fail -// compile-flags: -C opt-level=3 -// error-pattern: index out of bounds: the len is 0 but the index is 16777216 -// ignore-wasm no panic or subprocess support -// ignore-emscripten no panic or subprocess support - -fn do_test(x: usize) { - let arr = vec![vec![0u8; 3]]; - - let mut z = Vec::new(); - for arr_ref in arr { - for y in 0..x { - for _ in 0..1 { - z.extend(std::iter::repeat(0).take(x)); - let a = y * x; - let b = (y + 1) * x - 1; - let slice = &arr_ref[a..b]; - eprintln!("{} {} {} {}", a, b, arr_ref.len(), slice.len()); - eprintln!("{:?}", slice[1 << 24]); - } - } - } -} - -fn main() { - do_test(1); - do_test(2); -} diff --git a/tests/ui/issues/issue-69602-type-err-during-codegen-ice.stderr b/tests/ui/issues/issue-69602-type-err-during-codegen-ice.stderr index ba385d887..6f9302bc4 100644 --- a/tests/ui/issues/issue-69602-type-err-during-codegen-ice.stderr +++ b/tests/ui/issues/issue-69602-type-err-during-codegen-ice.stderr @@ -13,7 +13,7 @@ LL | type MyA: TraitA; LL | impl TraitB for B { | ^^^^^^^^^^^^^^^^^ missing `MyA` in implementation -note: erroneous constant used +note: erroneous constant encountered --> $DIR/issue-69602-type-err-during-codegen-ice.rs:21:17 | LL | let _ = [0; B::VALUE]; diff --git a/tests/ui/issues/issue-87199.stderr b/tests/ui/issues/issue-87199.stderr index 0ec5e73f3..67949b37d 100644 --- a/tests/ui/issues/issue-87199.stderr +++ b/tests/ui/issues/issue-87199.stderr @@ -17,12 +17,10 @@ LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `[i32]` cannot be known at compilation time - --> $DIR/issue-87199.rs:18:22 + --> $DIR/issue-87199.rs:18:15 | LL | ref_arg::<[i32]>(&[5]); - | ---------------- ^^^^ doesn't have a size known at compile-time - | | - | required by a bound introduced by this call + | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[i32]` note: required by a bound in `ref_arg` diff --git a/tests/ui/issues/issue-9575.stderr b/tests/ui/issues/issue-9575.stderr index 5b8ce84a0..e49eac3ba 100644 --- a/tests/ui/issues/issue-9575.stderr +++ b/tests/ui/issues/issue-9575.stderr @@ -4,8 +4,8 @@ error[E0308]: `#[start]` function has wrong type LL | fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected fn pointer `fn(isize, *const *const u8) -> _` - found fn pointer `fn(isize, *const *const u8, *const u8) -> _` + = note: expected signature `fn(isize, *const *const u8) -> _` + found signature `fn(isize, *const *const u8, *const u8) -> _` error: aborting due to previous error |