diff options
Diffstat (limited to 'src/test/ui/issues')
120 files changed, 439 insertions, 439 deletions
diff --git a/src/test/ui/issues/auxiliary/issue-2380.rs b/src/test/ui/issues/auxiliary/issue-2380.rs index 9a51a73c9..79fd62d16 100644 --- a/src/test/ui/issues/auxiliary/issue-2380.rs +++ b/src/test/ui/issues/auxiliary/issue-2380.rs @@ -1,8 +1,6 @@ #![crate_name="a"] #![crate_type = "lib"] -#![feature(box_syntax)] - pub trait i<T> { fn dummy(&self, t: T) -> T { panic!() } @@ -11,5 +9,5 @@ pub trait i<T> pub fn f<T>() -> Box<i<T>+'static> { impl<T> i<T> for () { } - box () as Box<i<T>+'static> + Box::new(()) as Box<i<T>+'static> } diff --git a/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs b/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs deleted file mode 100644 index 2ed50d709..000000000 --- a/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs +++ /dev/null @@ -1,39 +0,0 @@ -// check-pass - -// compile-flags: --emit=mir,link -O - -// There is an ICE somewhere in type normalization, and we are hitting it during -// the MIR inlining pass on this code. -// -// Long term, we should fix that ICE and change the compile-flags for this test -// to explicitly enable MIR inlining. -// -// Short term, we are diabling MIR inlining for Rust 1.64-beta, so that we avoid -// this ICE in this instance. - -pub trait Trait { - type Associated; -} -impl<T> Trait for T { - type Associated = T; -} - -pub struct Struct<T>(<T as Trait>::Associated); - -pub fn foo<T>() -> Struct<T> -where - T: Trait, -{ - bar() -} - -#[inline] -fn bar<T>() -> Struct<T> { - Struct(baz()) -} - -fn baz<T>() -> T { - unimplemented!() -} - -fn main() { } diff --git a/src/test/ui/issues/issue-100605.rs b/src/test/ui/issues/issue-100605.rs new file mode 100644 index 000000000..917a45c15 --- /dev/null +++ b/src/test/ui/issues/issue-100605.rs @@ -0,0 +1,9 @@ +fn takes_option(_arg: Option<&String>) {} + +fn main() { + takes_option(&None); //~ ERROR 4:18: 4:23: mismatched types [E0308] + + let x = String::from("x"); + let res = Some(x); + takes_option(&res); //~ ERROR 8:18: 8:22: mismatched types [E0308] +} diff --git a/src/test/ui/issues/issue-100605.stderr b/src/test/ui/issues/issue-100605.stderr new file mode 100644 index 000000000..886e3cd6b --- /dev/null +++ b/src/test/ui/issues/issue-100605.stderr @@ -0,0 +1,46 @@ +error[E0308]: mismatched types + --> $DIR/issue-100605.rs:4:18 + | +LL | takes_option(&None); + | ------------ ^^^^^ expected enum `Option`, found `&Option<_>` + | | + | arguments to this function are incorrect + | + = note: expected enum `Option<&String>` + found reference `&Option<_>` +note: function defined here + --> $DIR/issue-100605.rs:1:4 + | +LL | fn takes_option(_arg: Option<&String>) {} + | ^^^^^^^^^^^^ --------------------- +help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()` + | +LL | takes_option(None.as_ref()); + | ~~~~~~~~~~~~~ +help: consider removing the borrow + | +LL - takes_option(&None); +LL + takes_option(None); + | + +error[E0308]: mismatched types + --> $DIR/issue-100605.rs:8:18 + | +LL | takes_option(&res); + | ------------ ^^^^ + | | | + | | expected enum `Option`, found `&Option<String>` + | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()` + | arguments to this function are incorrect + | + = note: expected enum `Option<&String>` + found reference `&Option<String>` +note: function defined here + --> $DIR/issue-100605.rs:1:4 + | +LL | fn takes_option(_arg: Option<&String>) {} + | ^^^^^^^^^^^^ --------------------- + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-10682.rs b/src/test/ui/issues/issue-10682.rs index afaa90f05..72e4559d3 100644 --- a/src/test/ui/issues/issue-10682.rs +++ b/src/test/ui/issues/issue-10682.rs @@ -4,12 +4,10 @@ // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - fn work(_: Box<isize>) {} fn foo<F:FnOnce()>(_: F) {} pub fn main() { - let a = box 1; + let a = Box::new(1); foo(move|| { foo(move|| { work(a) }) }) } diff --git a/src/test/ui/issues/issue-10767.rs b/src/test/ui/issues/issue-10767.rs index f40815fdb..5670cd458 100644 --- a/src/test/ui/issues/issue-10767.rs +++ b/src/test/ui/issues/issue-10767.rs @@ -1,10 +1,8 @@ // run-pass // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - pub fn main() { fn f() { } - let _: Box<fn()> = box (f as fn()); + let _: Box<fn()> = Box::new(f as fn()); } diff --git a/src/test/ui/issues/issue-10802.rs b/src/test/ui/issues/issue-10802.rs index f1d6b37a6..99e1a92df 100644 --- a/src/test/ui/issues/issue-10802.rs +++ b/src/test/ui/issues/issue-10802.rs @@ -1,6 +1,5 @@ // run-pass #![allow(dead_code)] -#![feature(box_syntax)] struct DroppableStruct; enum DroppableEnum { @@ -33,14 +32,14 @@ impl Whatever { fn main() { { - let f: Box<_> = box DroppableStruct; - let _a = Whatever::new(box f as Box<dyn MyTrait>); + let f: Box<_> = Box::new(DroppableStruct); + let _a = Whatever::new(Box::new(f) as Box<dyn MyTrait>); } assert!(unsafe { DROPPED }); unsafe { DROPPED = false; } { - let f: Box<_> = box DroppableEnum::DroppableVariant1; - let _a = Whatever::new(box f as Box<dyn MyTrait>); + let f: Box<_> = Box::new(DroppableEnum::DroppableVariant1); + let _a = Whatever::new(Box::new(f) as Box<dyn MyTrait>); } assert!(unsafe { DROPPED }); } diff --git a/src/test/ui/issues/issue-11192.rs b/src/test/ui/issues/issue-11192.rs index 3bf91675e..1a3d8c9fe 100644 --- a/src/test/ui/issues/issue-11192.rs +++ b/src/test/ui/issues/issue-11192.rs @@ -1,20 +1,20 @@ -#![feature(box_syntax)] - struct Foo { x: isize } + impl Drop for Foo { fn drop(&mut self) { println!("drop {}", self.x); } } + fn main() { - let mut ptr: Box<_> = box Foo { x: 0 }; + let mut ptr: Box<_> = Box::new(Foo { x: 0 }); let mut test = |foo: &Foo| { println!("access {}", foo.x); - ptr = box Foo { x: ptr.x + 1 }; + ptr = Box::new(Foo { x: ptr.x + 1 }); println!("access {}", foo.x); }; test(&*ptr); diff --git a/src/test/ui/issues/issue-11192.stderr b/src/test/ui/issues/issue-11192.stderr index 2a9d91317..fc1548013 100644 --- a/src/test/ui/issues/issue-11192.stderr +++ b/src/test/ui/issues/issue-11192.stderr @@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as m LL | let mut test = |foo: &Foo| { | ----------- mutable borrow occurs here LL | println!("access {}", foo.x); -LL | ptr = box Foo { x: ptr.x + 1 }; +LL | ptr = Box::new(Foo { x: ptr.x + 1 }); | --- first borrow occurs due to use of `ptr` in closure ... LL | test(&*ptr); diff --git a/src/test/ui/issues/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr index 3a1d43310..15b2bbeb7 100644 --- a/src/test/ui/issues/issue-11374.stderr +++ b/src/test/ui/issues/issue-11374.stderr @@ -14,7 +14,7 @@ note: associated function defined here --> $DIR/issue-11374.rs:13:12 | LL | pub fn read_to(&mut self, vec: &mut [u8]) { - | ^^^^^^^ --------- -------------- + | ^^^^^^^ -------------- error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11515.rs b/src/test/ui/issues/issue-11515.rs index 2072f9c47..b5c942f96 100644 --- a/src/test/ui/issues/issue-11515.rs +++ b/src/test/ui/issues/issue-11515.rs @@ -1,10 +1,10 @@ -#![feature(box_syntax)] - struct Test { func: Box<dyn FnMut() + 'static>, } + + fn main() { let closure: Box<dyn Fn() + 'static> = Box::new(|| ()); - let test = box Test { func: closure }; //~ ERROR trait upcasting coercion is experimental [E0658] + let test = Box::new(Test { func: closure }); //~ ERROR trait upcasting coercion is experimental [E0658] } diff --git a/src/test/ui/issues/issue-11515.stderr b/src/test/ui/issues/issue-11515.stderr index 17bfae2a4..accd47f0f 100644 --- a/src/test/ui/issues/issue-11515.stderr +++ b/src/test/ui/issues/issue-11515.stderr @@ -1,8 +1,8 @@ error[E0658]: cannot cast `dyn Fn()` to `dyn FnMut()`, trait upcasting coercion is experimental - --> $DIR/issue-11515.rs:9:33 + --> $DIR/issue-11515.rs:9:38 | -LL | let test = box Test { func: closure }; - | ^^^^^^^ +LL | let test = Box::new(Test { func: closure }); + | ^^^^^^^ | = note: see issue #65991 <https://github.com/rust-lang/rust/issues/65991> for more information = help: add `#![feature(trait_upcasting)]` to the crate attributes to enable diff --git a/src/test/ui/issues/issue-11552.rs b/src/test/ui/issues/issue-11552.rs index bae12375d..9fb9f3d2e 100644 --- a/src/test/ui/issues/issue-11552.rs +++ b/src/test/ui/issues/issue-11552.rs @@ -1,6 +1,5 @@ // run-pass #![feature(box_patterns)] -#![feature(box_syntax)] #[derive(Clone)] enum Noun @@ -18,5 +17,8 @@ fn fas(n: &Noun) -> Noun } pub fn main() { - fas(&Noun::Cell(box Noun::Atom(2), box Noun::Cell(box Noun::Atom(2), box Noun::Atom(3)))); + fas( + &Noun::Cell(Box::new(Noun::Atom(2)), + Box::new(Noun::Cell(Box::new(Noun::Atom(2)), Box::new(Noun::Atom(3))))) + ); } diff --git a/src/test/ui/issues/issue-11844.rs b/src/test/ui/issues/issue-11844.rs index bb06f00d5..f974a4702 100644 --- a/src/test/ui/issues/issue-11844.rs +++ b/src/test/ui/issues/issue-11844.rs @@ -1,7 +1,5 @@ -#![feature(box_syntax)] - fn main() { - let a = Some(box 1); + let a = Some(Box::new(1)); match a { Ok(a) => //~ ERROR: mismatched types println!("{}",a), diff --git a/src/test/ui/issues/issue-11844.stderr b/src/test/ui/issues/issue-11844.stderr index 9d7470e7a..81cf918a1 100644 --- a/src/test/ui/issues/issue-11844.stderr +++ b/src/test/ui/issues/issue-11844.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-11844.rs:6:9 + --> $DIR/issue-11844.rs:4:9 | LL | match a { | - this expression has type `Option<Box<{integer}>>` diff --git a/src/test/ui/issues/issue-12127.rs b/src/test/ui/issues/issue-12127.rs index bb2c27345..8b30ddc2d 100644 --- a/src/test/ui/issues/issue-12127.rs +++ b/src/test/ui/issues/issue-12127.rs @@ -1,10 +1,10 @@ -#![feature(box_syntax, unboxed_closures)] +#![feature(unboxed_closures)] fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f } fn do_it(x: &isize) { } fn main() { - let x: Box<_> = box 22; + let x: Box<_> = Box::new(22); let f = to_fn_once(move|| do_it(&*x)); to_fn_once(move|| { f(); diff --git a/src/test/ui/issues/issue-13323.rs b/src/test/ui/issues/issue-13323.rs index 26847ee7a..71e14d4da 100644 --- a/src/test/ui/issues/issue-13323.rs +++ b/src/test/ui/issues/issue-13323.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] struct StrWrap { s: String @@ -48,7 +47,7 @@ impl<T: Eq> Matcher<T> for EqualTo<T> { } fn equal_to<T: Eq>(expected: T) -> Box<EqualTo<T>> { - box EqualTo { expected: expected } + Box::new(EqualTo { expected: expected }) } pub fn main() { diff --git a/src/test/ui/issues/issue-14399.rs b/src/test/ui/issues/issue-14399.rs index 6bf8a5899..7b32bf8e4 100644 --- a/src/test/ui/issues/issue-14399.rs +++ b/src/test/ui/issues/issue-14399.rs @@ -6,8 +6,6 @@ // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - #[derive(Clone)] struct B1; @@ -15,6 +13,6 @@ trait A { fn foo(&self) {} } impl A for B1 {} fn main() { - let v: Box<_> = box B1; + let v: Box<_> = Box::new(B1); let _c: Box<dyn A> = v.clone(); } diff --git a/src/test/ui/issues/issue-14915.rs b/src/test/ui/issues/issue-14915.rs index 909540355..127b909dd 100644 --- a/src/test/ui/issues/issue-14915.rs +++ b/src/test/ui/issues/issue-14915.rs @@ -1,7 +1,5 @@ -#![feature(box_syntax)] - fn main() { - let x: Box<isize> = box 0; + let x: Box<isize> = Box::new(0); println!("{}", x + 1); //~^ ERROR cannot add `{integer}` to `Box<isize>` diff --git a/src/test/ui/issues/issue-14915.stderr b/src/test/ui/issues/issue-14915.stderr index bd0b1d39a..6e6326929 100644 --- a/src/test/ui/issues/issue-14915.stderr +++ b/src/test/ui/issues/issue-14915.stderr @@ -1,5 +1,5 @@ error[E0369]: cannot add `{integer}` to `Box<isize>` - --> $DIR/issue-14915.rs:6:22 + --> $DIR/issue-14915.rs:4:22 | LL | println!("{}", x + 1); | - ^ - {integer} diff --git a/src/test/ui/issues/issue-15524.rs b/src/test/ui/issues/issue-15524.rs deleted file mode 100644 index 565db2d0f..000000000 --- a/src/test/ui/issues/issue-15524.rs +++ /dev/null @@ -1,16 +0,0 @@ -const N: isize = 1; - -enum Foo { - //~^ ERROR discriminant value `1` assigned more than once - //~| ERROR discriminant value `1` assigned more than once - //~| ERROR discriminant value `1` assigned more than once - A = 1, - B = 1, - C = 0, - D, - - E = N, - -} - -fn main() {} diff --git a/src/test/ui/issues/issue-15524.stderr b/src/test/ui/issues/issue-15524.stderr deleted file mode 100644 index 1195e0a34..000000000 --- a/src/test/ui/issues/issue-15524.stderr +++ /dev/null @@ -1,40 +0,0 @@ -error[E0081]: discriminant value `1` assigned more than once - --> $DIR/issue-15524.rs:3:1 - | -LL | enum Foo { - | ^^^^^^^^ -... -LL | A = 1, - | - first assignment of `1` -LL | B = 1, - | - second assignment of `1` - -error[E0081]: discriminant value `1` assigned more than once - --> $DIR/issue-15524.rs:3:1 - | -LL | enum Foo { - | ^^^^^^^^ -... -LL | A = 1, - | - first assignment of `1` -LL | B = 1, -LL | C = 0, - | ----- assigned discriminant for `D` was incremented from this discriminant -LL | D, - | - second assignment of `1` - -error[E0081]: discriminant value `1` assigned more than once - --> $DIR/issue-15524.rs:3:1 - | -LL | enum Foo { - | ^^^^^^^^ -... -LL | A = 1, - | - first assignment of `1` -... -LL | E = N, - | - second assignment of `1` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0081`. diff --git a/src/test/ui/issues/issue-15571.rs b/src/test/ui/issues/issue-15571.rs index 5381d6523..5f228b286 100644 --- a/src/test/ui/issues/issue-15571.rs +++ b/src/test/ui/issues/issue-15571.rs @@ -1,8 +1,7 @@ // run-pass -#![feature(box_syntax)] fn match_on_local() { - let mut foo: Option<Box<_>> = Some(box 5); + let mut foo: Option<Box<_>> = Some(Box::new(5)); match foo { None => {}, Some(x) => { @@ -37,7 +36,7 @@ fn match_on_binding() { } fn match_on_upvar() { - let mut foo: Option<Box<_>> = Some(box 8); + let mut foo: Option<Box<_>> = Some(Box::new(8)); let f = move|| { match foo { None => {}, @@ -52,7 +51,7 @@ fn match_on_upvar() { fn main() { match_on_local(); - match_on_arg(Some(box 6)); + match_on_arg(Some(Box::new(6))); match_on_binding(); match_on_upvar(); } diff --git a/src/test/ui/issues/issue-15763.rs b/src/test/ui/issues/issue-15763.rs index 9ceffff2e..ae0863615 100644 --- a/src/test/ui/issues/issue-15763.rs +++ b/src/test/ui/issues/issue-15763.rs @@ -1,6 +1,5 @@ // run-pass #![allow(unreachable_code)] -#![feature(box_syntax)] #[derive(PartialEq, Debug)] struct Bar { @@ -78,12 +77,12 @@ fn main() { assert_eq!(cc().unwrap(), 3); assert_eq!(dd().unwrap(), 3); - let i = box 32isize as Box<dyn A>; + let i = Box::new(32isize) as Box<dyn A>; assert_eq!(i.aaa(), 3); - let i = box 32isize as Box<dyn A>; + let i = Box::new(32isize) as Box<dyn A>; assert_eq!(i.bbb(), 3); - let i = box 32isize as Box<dyn A>; + let i = Box::new(32isize) as Box<dyn A>; assert_eq!(i.ccc().unwrap(), 3); - let i = box 32isize as Box<dyn A>; + let i = Box::new(32isize) as Box<dyn A>; assert_eq!(i.ddd().unwrap(), 3); } diff --git a/src/test/ui/issues/issue-16538.mir.stderr b/src/test/ui/issues/issue-16538.mir.stderr index 7dab7de76..e320df4b7 100644 --- a/src/test/ui/issues/issue-16538.mir.stderr +++ b/src/test/ui/issues/issue-16538.mir.stderr @@ -5,6 +5,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants + = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell error[E0133]: use of extern static is unsafe and requires unsafe function or block --> $DIR/issue-16538.rs:14:30 diff --git a/src/test/ui/issues/issue-16538.thir.stderr b/src/test/ui/issues/issue-16538.thir.stderr index a18b0197d..4a8628692 100644 --- a/src/test/ui/issues/issue-16538.thir.stderr +++ b/src/test/ui/issues/issue-16538.thir.stderr @@ -21,6 +21,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants + = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-16739.rs b/src/test/ui/issues/issue-16739.rs index 94da2ca5c..b21ea4bcd 100644 --- a/src/test/ui/issues/issue-16739.rs +++ b/src/test/ui/issues/issue-16739.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] #![feature(unboxed_closures, fn_traits)] // Test that unboxing shim for calling rust-call ABI methods through a @@ -35,12 +34,12 @@ impl FnOnce<(u32,u32)> for Foo { } fn main() { - let mut f = box Foo { foo: 42 } as Box<dyn FnMut() -> u32>; + let mut f = Box::new(Foo { foo: 42 }) as Box<dyn FnMut() -> u32>; assert_eq!(f.call_mut(()), 42); - let mut f = box Foo { foo: 40 } as Box<dyn FnMut(u32) -> u32>; + let mut f = Box::new(Foo { foo: 40 }) as Box<dyn FnMut(u32) -> u32>; assert_eq!(f.call_mut((2,)), 42); - let mut f = box Foo { foo: 40 } as Box<dyn FnMut(u32, u32) -> u32>; + let mut f = Box::new(Foo { foo: 40 }) as Box<dyn FnMut(u32, u32) -> u32>; assert_eq!(f.call_mut((1, 1)), 42); } diff --git a/src/test/ui/issues/issue-16774.rs b/src/test/ui/issues/issue-16774.rs index 9e9b84034..2b308ef76 100644 --- a/src/test/ui/issues/issue-16774.rs +++ b/src/test/ui/issues/issue-16774.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] #![feature(box_patterns)] use std::ops::{Deref, DerefMut}; @@ -35,7 +34,7 @@ impl DerefMut for X { fn main() { { - let mut test = X(box 5); + let mut test = X(Box::new(5)); { let mut change = || { *test = 10 }; change(); diff --git a/src/test/ui/issues/issue-16939.stderr b/src/test/ui/issues/issue-16939.stderr index aaa3c49b3..766456454 100644 --- a/src/test/ui/issues/issue-16939.stderr +++ b/src/test/ui/issues/issue-16939.stderr @@ -12,7 +12,7 @@ LL | fn _foo<F: Fn()> (f: F) { help: remove the extra argument | LL | |t| f(); - | ~~~ + | ~~ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17252.stderr b/src/test/ui/issues/issue-17252.stderr index 3a629e1eb..4856418ed 100644 --- a/src/test/ui/issues/issue-17252.stderr +++ b/src/test/ui/issues/issue-17252.stderr @@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO` --> $DIR/issue-17252.rs:1:1 | LL | const FOO: usize = FOO; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: ...which immediately requires const-evaluating + checking `FOO` again note: cycle used when const-evaluating + checking `main::{constant#0}` diff --git a/src/test/ui/issues/issue-17322.rs b/src/test/ui/issues/issue-17322.rs index 20a8d1361..b4fc40c3f 100644 --- a/src/test/ui/issues/issue-17322.rs +++ b/src/test/ui/issues/issue-17322.rs @@ -1,8 +1,6 @@ // run-pass // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - use std::io::{self, Write}; fn f(wr: &mut dyn Write) { @@ -10,6 +8,6 @@ fn f(wr: &mut dyn Write) { } fn main() { - let mut wr = box io::stdout() as Box<dyn Write>; + let mut wr = Box::new(io::stdout()) as Box<dyn Write>; f(&mut wr); } diff --git a/src/test/ui/issues/issue-18611.stderr b/src/test/ui/issues/issue-18611.stderr index bd18d4622..22c3470b6 100644 --- a/src/test/ui/issues/issue-18611.stderr +++ b/src/test/ui/issues/issue-18611.stderr @@ -1,8 +1,10 @@ error[E0277]: the trait bound `isize: HasState` is not satisfied - --> $DIR/issue-18611.rs:1:18 + --> $DIR/issue-18611.rs:1:1 | -LL | fn add_state(op: <isize as HasState>::State) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize` +LL | / fn add_state(op: <isize as HasState>::State) { +LL | | +LL | | } + | |_^ the trait `HasState` is not implemented for `isize` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18819.stderr b/src/test/ui/issues/issue-18819.stderr index 6499dd0d8..767fdd5ca 100644 --- a/src/test/ui/issues/issue-18819.stderr +++ b/src/test/ui/issues/issue-18819.stderr @@ -2,11 +2,13 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/issue-18819.rs:16:5 | LL | print_x(X); - | ^^^^^^^--- - | || - | |expected reference, found struct `X` - | an argument of type `&str` is missing + | ^^^^^^^--- an argument of type `&str` is missing | +note: expected reference, found struct `X` + --> $DIR/issue-18819.rs:16:13 + | +LL | print_x(X); + | ^ = note: expected reference `&dyn Foo<Item = bool>` found struct `X` note: function defined here @@ -21,7 +23,7 @@ LL | print_x(&X); help: provide the argument | LL | print_x(/* &dyn Foo<Item = bool> */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr index d70bf6e1d..3f9b3be98 100644 --- a/src/test/ui/issues/issue-20162.stderr +++ b/src/test/ui/issues/issue-20162.stderr @@ -1,8 +1,10 @@ error[E0277]: the trait bound `X: Ord` is not satisfied - --> $DIR/issue-20162.rs:5:7 + --> $DIR/issue-20162.rs:5:5 | LL | b.sort(); - | ^^^^ the trait `Ord` is not implemented for `X` + | ^ ---- required by a bound introduced by this call + | | + | the trait `Ord` is not implemented for `X` | note: required by a bound in `slice::<impl [T]>::sort` --> $SRC_DIR/alloc/src/slice.rs:LL:COL diff --git a/src/test/ui/issues/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr index ea493c58a..2db60b641 100644 --- a/src/test/ui/issues/issue-20413.stderr +++ b/src/test/ui/issues/issue-20413.stderr @@ -14,13 +14,13 @@ LL | impl<T> Foo for T where NoData<T>: Foo { | ^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`) -note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo` --> $DIR/issue-20413.rs:8:9 | LL | impl<T> Foo for T where NoData<T>: Foo { | ^^^ ^ = note: 127 redundant requirements hidden - = note: required because of the requirements on the impl of `Foo` for `NoData<T>` + = note: required for `NoData<T>` to implement `Foo` error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz` --> $DIR/issue-20413.rs:27:42 @@ -29,18 +29,18 @@ LL | impl<T> Bar for T where EvenLessData<T>: Baz { | ^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`) -note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar` --> $DIR/issue-20413.rs:27:9 | LL | impl<T> Bar for T where EvenLessData<T>: Baz { | ^^^ ^ -note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz` --> $DIR/issue-20413.rs:34:9 | LL | impl<T> Baz for T where AlmostNoData<T>: Bar { | ^^^ ^ = note: 126 redundant requirements hidden - = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>` + = note: required for `EvenLessData<T>` to implement `Baz` error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar` --> $DIR/issue-20413.rs:34:42 @@ -49,18 +49,18 @@ LL | impl<T> Baz for T where AlmostNoData<T>: Bar { | ^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`) -note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz` --> $DIR/issue-20413.rs:34:9 | LL | impl<T> Baz for T where AlmostNoData<T>: Bar { | ^^^ ^ -note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar` --> $DIR/issue-20413.rs:27:9 | LL | impl<T> Bar for T where EvenLessData<T>: Baz { | ^^^ ^ = note: 126 redundant requirements hidden - = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>` + = note: required for `AlmostNoData<T>` to implement `Bar` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-20605.stderr b/src/test/ui/issues/issue-20605.stderr index 41eefe3f8..e1858b639 100644 --- a/src/test/ui/issues/issue-20605.stderr +++ b/src/test/ui/issues/issue-20605.stderr @@ -2,10 +2,10 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann --> $DIR/issue-20605.rs:2:17 | LL | for item in *things { *item = 0 } - | ^^^^^^^ expected an implementor of trait `IntoIterator` + | ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>` | = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied - = note: required because of the requirements on the impl of `IntoIterator` for `dyn Iterator<Item = &'a mut u8>` + = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator` help: consider mutably borrowing here | LL | for item in &mut *things { *item = 0 } diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr index 57f9575bd..ef62dece8 100644 --- a/src/test/ui/issues/issue-20831-debruijn.stderr +++ b/src/test/ui/issues/issue-20831-debruijn.stderr @@ -1,8 +1,14 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements - --> $DIR/issue-20831-debruijn.rs:28:8 + --> $DIR/issue-20831-debruijn.rs:28:5 | -LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { - | ^^^^^^^^^ +LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { +LL | | // Not obvious, but there is an implicit lifetime here -------^ +LL | | +LL | | // +... | +LL | | self.sub = t; +LL | | } + | |_____^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... --> $DIR/issue-20831-debruijn.rs:28:58 @@ -15,10 +21,16 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined he LL | impl<'a> Publisher<'a> for MyStruct<'a> { | ^^ note: ...so that the types are compatible - --> $DIR/issue-20831-debruijn.rs:28:8 + --> $DIR/issue-20831-debruijn.rs:28:5 | -LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { - | ^^^^^^^^^ +LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { +LL | | // Not obvious, but there is an implicit lifetime here -------^ +LL | | +LL | | // +... | +LL | | self.sub = t; +LL | | } + | |_____^ = note: expected `<MyStruct<'a> as Publisher<'_>>` found `<MyStruct<'_> as Publisher<'_>>` diff --git a/src/test/ui/issues/issue-21033.rs b/src/test/ui/issues/issue-21033.rs index 86cc7707e..91f72eb36 100644 --- a/src/test/ui/issues/issue-21033.rs +++ b/src/test/ui/issues/issue-21033.rs @@ -4,7 +4,6 @@ // pretty-expanded FIXME #23616 #![feature(box_patterns)] -#![feature(box_syntax)] enum E { StructVar { boxed: Box<i32> } @@ -13,7 +12,7 @@ enum E { fn main() { // Test matching each shorthand notation for field patterns. - let mut a = E::StructVar { boxed: box 3 }; + let mut a = E::StructVar { boxed: Box::new(3) }; match a { E::StructVar { box boxed } => { } } @@ -38,7 +37,7 @@ fn main() { // Test matching non shorthand notation. Recreate a since last test // moved `boxed` - let mut a = E::StructVar { boxed: box 3 }; + let mut a = E::StructVar { boxed: Box::new(3) }; match a { E::StructVar { boxed: box ref mut num } => { } } diff --git a/src/test/ui/issues/issue-21763.stderr b/src/test/ui/issues/issue-21763.stderr index b8b38c0a7..72c650297 100644 --- a/src/test/ui/issues/issue-21763.stderr +++ b/src/test/ui/issues/issue-21763.stderr @@ -1,12 +1,12 @@ error[E0277]: `Rc<()>` cannot be sent between threads safely - --> $DIR/issue-21763.rs:9:5 + --> $DIR/issue-21763.rs:9:11 | LL | foo::<HashMap<Rc<()>, Rc<()>>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely + | ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely | = help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>` = note: required because it appears within the type `(Rc<()>, Rc<()>)` - = note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` + = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send` = note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>` = note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>` note: required by a bound in `foo` diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr index 4909398bb..731615a6b 100644 --- a/src/test/ui/issues/issue-21950.stderr +++ b/src/test/ui/issues/issue-21950.stderr @@ -1,3 +1,12 @@ +error[E0191]: the value of the associated type `Output` (from trait `Add`) must be specified + --> $DIR/issue-21950.rs:10:25 + | +LL | type Output; + | ----------- `Output` defined here +... +LL | let x = &10 as &dyn Add; + | ^^^ help: specify the associated type: `Add<Output = Type>` + error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-21950.rs:10:25 | @@ -9,15 +18,6 @@ LL | let x = &10 as &dyn Add; | = note: because of the default `Self` reference, type parameters must be specified on object types -error[E0191]: the value of the associated type `Output` (from trait `Add`) must be specified - --> $DIR/issue-21950.rs:10:25 - | -LL | type Output; - | ----------- `Output` defined here -... -LL | let x = &10 as &dyn Add; - | ^^^ help: specify the associated type: `Add<Output = Type>` - error: aborting due to 2 previous errors Some errors have detailed explanations: E0191, E0393. diff --git a/src/test/ui/issues/issue-22872.stderr b/src/test/ui/issues/issue-22872.stderr index a84cb7d8c..7382d40c0 100644 --- a/src/test/ui/issues/issue-22872.stderr +++ b/src/test/ui/issues/issue-22872.stderr @@ -5,7 +5,7 @@ LL | let _: Box<dyn for<'b> Wrap<'b>> = Box::new(Wrapper(process)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `<P as Process<'_>>::Item` is not an iterator | = help: the trait `Iterator` is not implemented for `<P as Process<'_>>::Item` -note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for `Wrapper<P>` +note: required for `Wrapper<P>` to implement `for<'b> Wrap<'b>` --> $DIR/issue-22872.rs:7:13 | LL | impl<'b, P> Wrap<'b> for Wrapper<P> diff --git a/src/test/ui/issues/issue-2288.rs b/src/test/ui/issues/issue-2288.rs index c74e53fca..6fd690a4d 100644 --- a/src/test/ui/issues/issue-2288.rs +++ b/src/test/ui/issues/issue-2288.rs @@ -1,8 +1,6 @@ // run-pass #![allow(non_camel_case_types)] -#![feature(box_syntax)] - trait clam<A> { fn chowder(&self, y: A); } @@ -30,6 +28,6 @@ fn f<A>(x: Box<dyn clam<A>>, a: A) { pub fn main() { let c = foo(42); - let d: Box<dyn clam<isize>> = box c as Box<dyn clam<isize>>; + let d: Box<dyn clam<isize>> = Box::new(c) as Box<dyn clam<isize>>; f(d, c.x); } diff --git a/src/test/ui/issues/issue-23024.rs b/src/test/ui/issues/issue-23024.rs index e92273bd4..010281ee3 100644 --- a/src/test/ui/issues/issue-23024.rs +++ b/src/test/ui/issues/issue-23024.rs @@ -1,11 +1,10 @@ -#![feature(box_syntax)] use std::any::Any; fn main() { fn h(x:i32) -> i32 {3*x} let mut vfnfer:Vec<Box<dyn Any>> = vec![]; - vfnfer.push(box h); + vfnfer.push(Box::new(h)); println!("{:?}",(vfnfer[0] as dyn Fn)(3)); //~^ ERROR the precise format of `Fn`-family traits' //~| ERROR missing generics for trait `Fn` diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr index 7a4d90b44..73f93c51d 100644 --- a/src/test/ui/issues/issue-23024.stderr +++ b/src/test/ui/issues/issue-23024.stderr @@ -1,5 +1,5 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change - --> $DIR/issue-23024.rs:9:39 + --> $DIR/issue-23024.rs:8:39 | LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); | ^^ help: use parenthetical notation instead: `Fn() -> ()` @@ -8,7 +8,7 @@ LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable error[E0107]: missing generics for trait `Fn` - --> $DIR/issue-23024.rs:9:39 + --> $DIR/issue-23024.rs:8:39 | LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); | ^^ expected 1 generic argument @@ -24,7 +24,7 @@ LL | println!("{:?}",(vfnfer[0] as dyn Fn<Args>)(3)); | ~~~~~~~~ error[E0191]: the value of the associated type `Output` (from trait `FnOnce`) must be specified - --> $DIR/issue-23024.rs:9:39 + --> $DIR/issue-23024.rs:8:39 | LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); | ^^ help: specify the associated type: `Fn<Output = Type>` diff --git a/src/test/ui/issues/issue-23122-2.stderr b/src/test/ui/issues/issue-23122-2.stderr index 7519e632d..f6cda3de5 100644 --- a/src/test/ui/issues/issue-23122-2.stderr +++ b/src/test/ui/issues/issue-23122-2.stderr @@ -1,15 +1,10 @@ -error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized` +error[E0275]: overflow evaluating the requirement `<T as Next>::Next` --> $DIR/issue-23122-2.rs:10:17 | LL | type Next = <GetNext<T::Next> as Next>::Next; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`) -note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` - --> $DIR/issue-23122-2.rs:9:15 - | -LL | impl<T: Next> Next for GetNext<T> { - | ^^^^ ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23302-3.stderr b/src/test/ui/issues/issue-23302-3.stderr index dcb99605d..074939f68 100644 --- a/src/test/ui/issues/issue-23302-3.stderr +++ b/src/test/ui/issues/issue-23302-3.stderr @@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `A` --> $DIR/issue-23302-3.rs:1:1 | LL | const A: i32 = B; - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ | note: ...which requires const-evaluating + checking `B`... --> $DIR/issue-23302-3.rs:3:1 | LL | const B: i32 = A; - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ = note: ...which again requires const-evaluating + checking `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/src/test/ui/issues/issue-23491.rs b/src/test/ui/issues/issue-23491.rs index 1cb969731..e5f9dd3ef 100644 --- a/src/test/ui/issues/issue-23491.rs +++ b/src/test/ui/issues/issue-23491.rs @@ -1,9 +1,8 @@ // run-pass #![allow(unused_variables)] -#![feature(box_syntax)] struct Node<T: ?Sized>(#[allow(unused_tuple_struct_fields)] T); fn main() { - let x: Box<Node<[isize]>> = box Node([]); + let x: Box<Node<[isize]>> = Box::new(Node([])); } diff --git a/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs b/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs index 403cf970b..cdb130d60 100644 --- a/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs +++ b/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs @@ -97,7 +97,7 @@ pub fn main() { // ever hands f_A off to instances of GaspA, and thus one should // be able to prove the invariant that f_A is *only* invoked from // from an instance of GaspA (either via the GaspA drop - // implementation or the E drop implementaton). Yet the old (bad) + // implementation or the E drop implementation). Yet the old (bad) // behavior allowed a call to f_A to leak in while we are tearing // down a value of type GaspB. } diff --git a/src/test/ui/issues/issue-25901.stderr b/src/test/ui/issues/issue-25901.stderr index e933745c4..c6c80e41c 100644 --- a/src/test/ui/issues/issue-25901.stderr +++ b/src/test/ui/issues/issue-25901.stderr @@ -16,6 +16,7 @@ note: impl defined here, but it is not `const` LL | impl Deref for A { | ^^^^^^^^^^^^^^^^ = note: calls in statics are limited to constant functions, tuple structs and tuple variants + = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell error: aborting due to previous error diff --git a/src/test/ui/issues/issue-26217.stderr b/src/test/ui/issues/issue-26217.stderr index c7601caac..73c772205 100644 --- a/src/test/ui/issues/issue-26217.stderr +++ b/src/test/ui/issues/issue-26217.stderr @@ -5,6 +5,12 @@ LL | fn bar<'a>() { | -- lifetime `'a` defined here LL | foo::<&'a i32>(); | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | +note: due to current limitations in the borrow checker, this implies a `'static` lifetime + --> $DIR/issue-26217.rs:1:30 + | +LL | fn foo<T>() where for<'a> T: 'a {} + | ^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-2708.rs b/src/test/ui/issues/issue-2708.rs index abd5e9507..4e53b9d14 100644 --- a/src/test/ui/issues/issue-2708.rs +++ b/src/test/ui/issues/issue-2708.rs @@ -4,7 +4,7 @@ // pretty-expanded FIXME #23616 -#![feature(box_syntax)] + struct Font { fontbuf: usize, @@ -26,5 +26,5 @@ fn Font() -> Font { } pub fn main() { - let _f: Box<_> = box Font(); + let _f: Box<_> = Box::new(Font()); } diff --git a/src/test/ui/issues/issue-2734.rs b/src/test/ui/issues/issue-2734.rs index d449f6449..df4f394dc 100644 --- a/src/test/ui/issues/issue-2734.rs +++ b/src/test/ui/issues/issue-2734.rs @@ -4,21 +4,19 @@ // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - trait hax { fn dummy(&self) { } } impl<A> hax for A { } fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> { - box x as Box<dyn hax+'static> + Box::new(x) as Box<dyn hax+'static> } fn deadcode() { - perform_hax(box "deadcode".to_string()); + perform_hax(Box::new("deadcode".to_string())); } pub fn main() { - let _ = perform_hax(box 42); + let _ = perform_hax(Box::new(42)); } diff --git a/src/test/ui/issues/issue-2735.rs b/src/test/ui/issues/issue-2735.rs index 794c7d4ed..20d3949a9 100644 --- a/src/test/ui/issues/issue-2735.rs +++ b/src/test/ui/issues/issue-2735.rs @@ -4,21 +4,19 @@ // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - trait hax { fn dummy(&self) { } } impl<A> hax for A { } fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> { - box x as Box<dyn hax+'static> + Box::new(x) as Box<dyn hax+'static> } fn deadcode() { - perform_hax(box "deadcode".to_string()); + perform_hax(Box::new("deadcode".to_string())); } pub fn main() { - perform_hax(box 42); + perform_hax(Box::new(42)); } diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr index b1d1c01b2..85a8698af 100644 --- a/src/test/ui/issues/issue-28344.stderr +++ b/src/test/ui/issues/issue-28344.stderr @@ -25,7 +25,7 @@ LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^ | | | function or associated item not found in `dyn BitXor<_>` - | help: there is an associated function with a similar name: `bitxor` + | help: there is a method with a similar name: `bitxor` warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-28344.rs:10:13 @@ -53,7 +53,7 @@ LL | let g = BitXor::bitor; | ^^^^^ | | | function or associated item not found in `dyn BitXor<_>` - | help: there is an associated function with a similar name: `bitxor` + | help: there is a method with a similar name: `bitxor` error: aborting due to 4 previous errors; 2 warnings emitted diff --git a/src/test/ui/issues/issue-2935.rs b/src/test/ui/issues/issue-2935.rs index 11641ca73..37f818199 100644 --- a/src/test/ui/issues/issue-2935.rs +++ b/src/test/ui/issues/issue-2935.rs @@ -1,7 +1,6 @@ // run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] -#![feature(box_syntax)] //type t = { a: isize }; // type t = { a: bool }; @@ -20,7 +19,7 @@ pub fn main() { // let y = box ({a: 4}); // let z = box ({a: 4} as it); // let z = box ({a: true} as it); - let z: Box<_> = box (box true as Box<dyn it>); + let z: Box<_> = Box::new(Box::new(true) as Box<dyn it>); // x.f(); // y.f(); // (*z).f(); diff --git a/src/test/ui/issues/issue-3026.rs b/src/test/ui/issues/issue-3026.rs index 1dea8134f..4619a3fe7 100644 --- a/src/test/ui/issues/issue-3026.rs +++ b/src/test/ui/issues/issue-3026.rs @@ -1,13 +1,11 @@ // run-pass // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - use std::collections::HashMap; pub fn main() { let x: Box<_>; let mut buggy_map: HashMap<usize, &usize> = HashMap::new(); - x = box 1; + x = Box::new(1); buggy_map.insert(42, &*x); } diff --git a/src/test/ui/issues/issue-31173.rs b/src/test/ui/issues/issue-31173.rs index 48061ae54..04efa2718 100644 --- a/src/test/ui/issues/issue-31173.rs +++ b/src/test/ui/issues/issue-31173.rs @@ -3,12 +3,13 @@ use std::vec::IntoIter; pub fn get_tok(it: &mut IntoIter<u8>) { let mut found_e = false; - let temp: Vec<u8> = it.take_while(|&x| { - found_e = true; - false - }) + let temp: Vec<u8> = it + //~^ ERROR to be an iterator that yields `&_`, but it yields `u8` + .take_while(|&x| { + found_e = true; + false + }) .cloned() - //~^ ERROR type mismatch resolving .collect(); //~ ERROR the method } diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 68337a715..e3334eef3 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -1,8 +1,16 @@ -error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item == &_` - --> $DIR/issue-31173.rs:10:10 - | -LL | .cloned() - | ^^^^^^ expected reference, found `u8` +error[E0271]: expected `TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>` to be an iterator that yields `&_`, but it yields `u8` + --> $DIR/issue-31173.rs:6:25 + | +LL | let temp: Vec<u8> = it + | _________________________^ +LL | | +LL | | .take_while(|&x| { +LL | | found_e = true; +LL | | false +LL | | }) + | |__________^ expected reference, found `u8` +LL | .cloned() + | ------ required by a bound introduced by this call | = note: expected reference `&_` found type `u8` @@ -12,27 +20,27 @@ note: required by a bound in `cloned` LL | Self: Sized + Iterator<Item = &'a T>, | ^^^^^^^^^^^^ required by this bound in `cloned` -error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>`, but its trait bounds were not satisfied - --> $DIR/issue-31173.rs:12:10 +error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>`, but its trait bounds were not satisfied + --> $DIR/issue-31173.rs:13:10 | LL | .collect(); - | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>` due to unsatisfied trait bounds - | - ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL - | -LL | pub struct Cloned<I> { - | -------------------- doesn't satisfy `_: Iterator` + | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>` due to unsatisfied trait bounds | ::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL | LL | pub struct TakeWhile<I, P> { | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_` | + ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL + | +LL | pub struct Cloned<I> { + | -------------------- doesn't satisfy `_: Iterator` + | = note: the following trait bounds were not satisfied: - `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item = &_` - which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator` - `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator` - which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator` + `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]> as Iterator>::Item = &_` + which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator` + `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator` + which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-3121.rs b/src/test/ui/issues/issue-3121.rs index f7bbfa9f6..4bf5b9b60 100644 --- a/src/test/ui/issues/issue-3121.rs +++ b/src/test/ui/issues/issue-3121.rs @@ -1,7 +1,6 @@ // run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] -#![feature(box_syntax)] #[derive(Copy, Clone)] enum side { mayo, catsup, vinegar } @@ -21,5 +20,5 @@ fn foo(m: Box<meal>, cond: bool) { } pub fn main() { - foo(box meal::for_here(order::hamburger), true) + foo(Box::new(meal::for_here(order::hamburger)), true) } diff --git a/src/test/ui/issues/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr index 4d8eb6360..aa0b5ce64 100644 --- a/src/test/ui/issues/issue-3214.stderr +++ b/src/test/ui/issues/issue-3214.stderr @@ -2,10 +2,9 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-3214.rs:3:12 | LL | fn foo<T>() { - | --- - type parameter from outer function - | | - | try adding a local generic parameter in this method instead + | - type parameter from outer function LL | struct Foo { + | - help: try using a local generic parameter instead: `<T>` LL | x: T, | ^ use of generic parameter from outer function diff --git a/src/test/ui/issues/issue-32709.stderr b/src/test/ui/issues/issue-32709.stderr index 112cb3359..1d595ca56 100644 --- a/src/test/ui/issues/issue-32709.stderr +++ b/src/test/ui/issues/issue-32709.stderr @@ -10,7 +10,7 @@ LL | Err(5)?; = help: the following other types implement trait `FromResidual<R>`: <Result<T, F> as FromResidual<Result<Infallible, E>>> <Result<T, F> as FromResidual<Yeet<E>>> - = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>` + = note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-3290.rs b/src/test/ui/issues/issue-3290.rs index 840c7ff83..7014d517f 100644 --- a/src/test/ui/issues/issue-3290.rs +++ b/src/test/ui/issues/issue-3290.rs @@ -1,9 +1,8 @@ // run-pass -#![feature(box_syntax)] #![allow(dead_code)] pub fn main() { - let mut x: Box<_> = box 3; + let mut x: Box<_> = Box::new(3); x = x; assert_eq!(*x, 3); } diff --git a/src/test/ui/issues/issue-33941.rs b/src/test/ui/issues/issue-33941.rs index a1213623e..8430e85df 100644 --- a/src/test/ui/issues/issue-33941.rs +++ b/src/test/ui/issues/issue-33941.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; fn main() { - for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch - //~^ ERROR type mismatch - //~| ERROR type mismatch + for _ in HashMap::new().iter().cloned() {} //~ ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` + //~^ ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` + //~| ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` } diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index e1ce6eed9..691b8f88f 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -1,8 +1,10 @@ -error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` - --> $DIR/issue-33941.rs:6:36 +error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` + --> $DIR/issue-33941.rs:6:14 | LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^ expected reference, found tuple + | ^^^^^^^^^^^^^^^^^^^^^ ------ required by a bound introduced by this call + | | + | expected reference, found tuple | = note: expected reference `&_` found tuple `(&_, &_)` @@ -12,7 +14,7 @@ note: required by a bound in `cloned` LL | Self: Sized + Iterator<Item = &'a T>, | ^^^^^^^^^^^^ required by this bound in `cloned` -error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` +error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` --> $DIR/issue-33941.rs:6:14 | LL | for _ in HashMap::new().iter().cloned() {} @@ -20,10 +22,10 @@ LL | for _ in HashMap::new().iter().cloned() {} | = note: expected tuple `(&_, &_)` found reference `&_` - = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` - = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` + = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator` + = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `IntoIterator` -error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` +error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)` --> $DIR/issue-33941.rs:6:14 | LL | for _ in HashMap::new().iter().cloned() {} @@ -31,7 +33,7 @@ LL | for _ in HashMap::new().iter().cloned() {} | = note: expected tuple `(&_, &_)` found reference `&_` - = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` + = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index 48ae2df69..72082f0cd 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -13,10 +13,12 @@ LL | let sr: Vec<(u32, _, _)> = vec![]; | + error[E0277]: a value of type `Vec<(u32, _, _)>` cannot be built from an iterator over elements of type `()` - --> $DIR/issue-34334.rs:5:87 + --> $DIR/issue-34334.rs:5:33 | LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect(); - | ^^^^^^^ value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call + | | + | value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>` | = help: the trait `FromIterator<()>` is not implemented for `Vec<(u32, _, _)>` = help: the trait `FromIterator<T>` is implemented for `Vec<T>` diff --git a/src/test/ui/issues/issue-34349.stderr b/src/test/ui/issues/issue-34349.stderr index d0b51961b..8e9a16619 100644 --- a/src/test/ui/issues/issue-34349.stderr +++ b/src/test/ui/issues/issue-34349.stderr @@ -7,7 +7,15 @@ LL | farewell.push_str("!!!"); | -------- closure is `FnMut` because it mutates the variable `farewell` here ... LL | apply(diary); - | ----- the requirement to implement `Fn` derives from here + | ----- ----- the requirement to implement `Fn` derives from here + | | + | required by a bound introduced by this call + | +note: required by a bound in `apply` + --> $DIR/issue-34349.rs:11:32 + | +LL | fn apply<F>(f: F) where F: Fn() { + | ^^^^ required by this bound in `apply` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-3447.rs b/src/test/ui/issues/issue-3447.rs index 1e329d152..ee5b22778 100644 --- a/src/test/ui/issues/issue-3447.rs +++ b/src/test/ui/issues/issue-3447.rs @@ -2,7 +2,6 @@ #![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] -#![feature(box_syntax)] use std::cell::RefCell; @@ -20,7 +19,7 @@ impl<T:'static> list<T> { next: None }; - self.next = Some(box RefCell::new(newList)); + self.next = Some(Box::new(RefCell::new(newList))); } } diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr index a66289a1c..9ee7654a0 100644 --- a/src/test/ui/issues/issue-35241.stderr +++ b/src/test/ui/issues/issue-35241.stderr @@ -13,8 +13,8 @@ LL | fn test() -> Foo { Foo } found fn item `fn(u32) -> Foo {Foo}` help: use parentheses to instantiate this tuple struct | -LL | fn test() -> Foo { Foo(_) } - | +++ +LL | fn test() -> Foo { Foo(/* u32 */) } + | +++++++++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-35570.rs b/src/test/ui/issues/issue-35570.rs index 42cef9a47..a2b0222d4 100644 --- a/src/test/ui/issues/issue-35570.rs +++ b/src/test/ui/issues/issue-35570.rs @@ -6,7 +6,8 @@ trait Trait2<'a> { } fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) { -//~^ the trait bound `for<'a> (): Trait2<'a>` is not satisfied + //~^ ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied + //~| ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied let _e: (usize, usize) = unsafe{mem::transmute(param)}; } diff --git a/src/test/ui/issues/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr index 2697d46bd..ebc40f678 100644 --- a/src/test/ui/issues/issue-35570.stderr +++ b/src/test/ui/issues/issue-35570.stderr @@ -1,9 +1,19 @@ error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied + --> $DIR/issue-35570.rs:8:1 + | +LL | / fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) { +LL | | +LL | | +LL | | let _e: (usize, usize) = unsafe{mem::transmute(param)}; +LL | | } + | |_^ the trait `for<'a> Trait2<'a>` is not implemented for `()` + +error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied --> $DIR/issue-35570.rs:8:40 | LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) { | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()` -error: aborting due to previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-3794.rs b/src/test/ui/issues/issue-3794.rs index 1809e822c..b1f028fbc 100644 --- a/src/test/ui/issues/issue-3794.rs +++ b/src/test/ui/issues/issue-3794.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] #![allow(dead_code)] trait T { @@ -26,7 +25,7 @@ fn print_s(s: &S) { } pub fn main() { - let s: Box<S> = box S { s: 5 }; + let s: Box<S> = Box::new(S { s: 5 }); print_s(&*s); let t: Box<dyn T> = s as Box<dyn T>; print_t(&*t); diff --git a/src/test/ui/issues/issue-3878.rs b/src/test/ui/issues/issue-3878.rs index a121f0ba8..6de3405af 100644 --- a/src/test/ui/issues/issue-3878.rs +++ b/src/test/ui/issues/issue-3878.rs @@ -2,9 +2,8 @@ // pretty-expanded FIXME #23616 #![allow(path_statements)] -#![feature(box_syntax)] pub fn main() { - let y: Box<_> = box 1; + let y: Box<_> = Box::new(1); y; } diff --git a/src/test/ui/issues/issue-38821.stderr b/src/test/ui/issues/issue-38821.stderr index cdf1f0dfc..9abd2436b 100644 --- a/src/test/ui/issues/issue-38821.stderr +++ b/src/test/ui/issues/issue-38821.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat LL | #[derive(Debug, Copy, Clone)] | ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType` | -note: required because of the requirements on the impl of `IntoNullable` for `<Col as Expression>::SqlType` +note: required for `<Col as Expression>::SqlType` to implement `IntoNullable` --> $DIR/issue-38821.rs:9:18 | LL | impl<T: NotNull> IntoNullable for T { diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index 1f64a90bc..774575d1d 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -9,7 +9,7 @@ note: expected this to be `()` | LL | type Element = &'a (); | ^^^^^^ -note: required because of the requirements on the impl of `Visit` for `()` +note: required for `()` to implement `Visit` --> $DIR/issue-39970.rs:13:6 | LL | impl Visit for () where diff --git a/src/test/ui/issues/issue-40510-3.stderr b/src/test/ui/issues/issue-40510-3.stderr index 22186ba9a..eb077415e 100644 --- a/src/test/ui/issues/issue-40510-3.stderr +++ b/src/test/ui/issues/issue-40510-3.stderr @@ -14,6 +14,10 @@ LL | | } | = note: `FnMut` closures only have access to their captured variables while they are executing... = note: ...therefore, they cannot allow references to captured variables to escape +help: consider adding 'move' keyword before the nested closure + | +LL | move || { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40827.stderr b/src/test/ui/issues/issue-40827.stderr index 11c23e5b6..7f5c578ae 100644 --- a/src/test/ui/issues/issue-40827.stderr +++ b/src/test/ui/issues/issue-40827.stderr @@ -12,7 +12,7 @@ note: required because it appears within the type `Bar` | LL | enum Bar { | ^^^ - = note: required because of the requirements on the impl of `Send` for `Arc<Bar>` + = note: required for `Arc<Bar>` to implement `Send` note: required because it appears within the type `Foo` --> $DIR/issue-40827.rs:4:8 | @@ -38,7 +38,7 @@ note: required because it appears within the type `Bar` | LL | enum Bar { | ^^^ - = note: required because of the requirements on the impl of `Send` for `Arc<Bar>` + = note: required for `Arc<Bar>` to implement `Send` note: required because it appears within the type `Foo` --> $DIR/issue-40827.rs:4:8 | diff --git a/src/test/ui/issues/issue-41139.stderr b/src/test/ui/issues/issue-41139.stderr index 48b22bca2..97492e6e0 100644 --- a/src/test/ui/issues/issue-41139.stderr +++ b/src/test/ui/issues/issue-41139.stderr @@ -5,9 +5,7 @@ LL | fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait { | -------------------------------------------------- `get_function` defined here returns `&dyn Fn() -> (dyn Trait + 'static)` ... LL | let t: &dyn Trait = &get_function()(); - | ^^^^^^^^^^^^^^-- - | | - | call expression requires function + | ^^^^^^^^^^^^^^ this trait object returns an unsized value `(dyn Trait + 'static)`, so it cannot be called error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41726.stderr b/src/test/ui/issues/issue-41726.stderr index 22631e7c2..b05c1fb14 100644 --- a/src/test/ui/issues/issue-41726.stderr +++ b/src/test/ui/issues/issue-41726.stderr @@ -5,6 +5,10 @@ LL | things[src.as_str()].sort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<String, Vec<String>>` +help: to modify a `HashMap<String, Vec<String>>` use `.get_mut()` + | +LL | things.get_mut(src.as_str()).map(|val| val.sort()); + | ~~~~~~~~~ ~~~~~~~~~~~~~~~ + error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41974.stderr b/src/test/ui/issues/issue-41974.stderr index fcbb40140..e249db9df 100644 --- a/src/test/ui/issues/issue-41974.stderr +++ b/src/test/ui/issues/issue-41974.stderr @@ -7,11 +7,11 @@ LL | impl<T> Drop for T where T: A { = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local = note: only traits defined in the current crate can be implemented for a type parameter -error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions +error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions --> $DIR/issue-41974.rs:7:18 | LL | impl<T> Drop for T where T: A { - | ^ must be a struct, enum, or union + | ^ must be a struct, enum, or union in the current crate error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-43988.stderr b/src/test/ui/issues/issue-43988.stderr index 03aa37f52..02c5dd5bf 100644 --- a/src/test/ui/issues/issue-43988.stderr +++ b/src/test/ui/issues/issue-43988.stderr @@ -31,12 +31,16 @@ 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` error[E0552]: unrecognized representation hint --> $DIR/issue-43988.rs:18:12 | 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` error[E0518]: attribute should be applied to function or closure --> $DIR/issue-43988.rs:30:5 diff --git a/src/test/ui/issues/issue-47511.stderr b/src/test/ui/issues/issue-47511.stderr index 5b84f7ed6..9998ee0e8 100644 --- a/src/test/ui/issues/issue-47511.stderr +++ b/src/test/ui/issues/issue-47511.stderr @@ -4,7 +4,8 @@ error[E0581]: return type references an anonymous lifetime, which is not constra LL | fn f(_: X) -> X { | ^ | - = note: lifetimes appearing in an associated type are not considered constrained + = note: lifetimes appearing in an associated or opaque type are not considered constrained + = note: consider introducing a named lifetime parameter error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types --> $DIR/issue-47511.rs:12:23 diff --git a/src/test/ui/issues/issue-4759.rs b/src/test/ui/issues/issue-4759.rs index 53785af09..e5b9e2ed5 100644 --- a/src/test/ui/issues/issue-4759.rs +++ b/src/test/ui/issues/issue-4759.rs @@ -2,8 +2,6 @@ // pretty-expanded FIXME #23616 #![allow(non_shorthand_field_patterns)] -#![feature(box_syntax)] - struct T { a: Box<isize> } trait U { @@ -15,6 +13,6 @@ impl U for Box<isize> { } pub fn main() { - let T { a: a } = T { a: box 0 }; + let T { a: a } = T { a: Box::new(0) }; a.f(); } diff --git a/src/test/ui/issues/issue-4935.stderr b/src/test/ui/issues/issue-4935.stderr index aab19a699..bb45fa083 100644 --- a/src/test/ui/issues/issue-4935.stderr +++ b/src/test/ui/issues/issue-4935.stderr @@ -12,7 +12,7 @@ LL | fn foo(a: usize) {} help: remove the extra argument | LL | fn main() { foo(5) } - | ~~~~~~ + | ~~~ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4972.rs b/src/test/ui/issues/issue-4972.rs index fab258f13..3f1c6f855 100644 --- a/src/test/ui/issues/issue-4972.rs +++ b/src/test/ui/issues/issue-4972.rs @@ -1,5 +1,4 @@ #![feature(box_patterns)] -#![feature(box_syntax)] trait MyTrait { fn dummy(&self) {} diff --git a/src/test/ui/issues/issue-4972.stderr b/src/test/ui/issues/issue-4972.stderr index 40db50278..83daded7e 100644 --- a/src/test/ui/issues/issue-4972.stderr +++ b/src/test/ui/issues/issue-4972.stderr @@ -1,5 +1,5 @@ error[E0033]: type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced - --> $DIR/issue-4972.rs:14:25 + --> $DIR/issue-4972.rs:13:25 | LL | TraitWrapper::A(box ref map) => map, | ^^^^^^^^^^^ type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced diff --git a/src/test/ui/issues/issue-49824.stderr b/src/test/ui/issues/issue-49824.stderr index 2fec48254..14beadece 100644 --- a/src/test/ui/issues/issue-49824.stderr +++ b/src/test/ui/issues/issue-49824.stderr @@ -14,6 +14,10 @@ LL | | } | = note: `FnMut` closures only have access to their captured variables while they are executing... = note: ...therefore, they cannot allow references to captured variables to escape +help: consider adding 'move' keyword before the nested closure + | +LL | move || { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5100.rs b/src/test/ui/issues/issue-5100.rs index 5e926fabe..69ed4b0e4 100644 --- a/src/test/ui/issues/issue-5100.rs +++ b/src/test/ui/issues/issue-5100.rs @@ -1,5 +1,5 @@ #![feature(box_patterns)] -#![feature(box_syntax)] + enum A { B, C } diff --git a/src/test/ui/issues/issue-5192.rs b/src/test/ui/issues/issue-5192.rs index 5a83d1c2f..e2f835c19 100644 --- a/src/test/ui/issues/issue-5192.rs +++ b/src/test/ui/issues/issue-5192.rs @@ -2,8 +2,6 @@ #![allow(dead_code)] // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - pub trait EventLoop { fn dummy(&self) { } } @@ -37,5 +35,5 @@ impl Scheduler { } pub fn main() { - let _sched = Scheduler::new(box UvEventLoop::new() as Box<dyn EventLoop>); + let _sched = Scheduler::new(Box::new(UvEventLoop::new()) as Box<dyn EventLoop>); } diff --git a/src/test/ui/issues/issue-5439.rs b/src/test/ui/issues/issue-5439.rs index cd039506f..852b264dc 100644 --- a/src/test/ui/issues/issue-5439.rs +++ b/src/test/ui/issues/issue-5439.rs @@ -1,5 +1,3 @@ -#![feature(box_syntax)] - struct Foo { foo: isize, } @@ -10,7 +8,7 @@ struct Bar { impl Bar { fn make_foo (&self, i: isize) -> Box<Foo> { - return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named + return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR: no field named } } diff --git a/src/test/ui/issues/issue-5439.stderr b/src/test/ui/issues/issue-5439.stderr index bd0cb670b..dc8f8b878 100644 --- a/src/test/ui/issues/issue-5439.stderr +++ b/src/test/ui/issues/issue-5439.stderr @@ -1,8 +1,8 @@ error[E0560]: struct `Foo` has no field named `nonexistent` - --> $DIR/issue-5439.rs:13:26 + --> $DIR/issue-5439.rs:11:31 | -LL | return box Foo { nonexistent: self, foo: i }; - | ^^^^^^^^^^^ `Foo` does not have this field +LL | return Box::new(Foo { nonexistent: self, foo: i }); + | ^^^^^^^^^^^ `Foo` does not have this field | = note: available fields are: `foo` diff --git a/src/test/ui/issues/issue-5666.rs b/src/test/ui/issues/issue-5666.rs index aa5132778..810895b1b 100644 --- a/src/test/ui/issues/issue-5666.rs +++ b/src/test/ui/issues/issue-5666.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(box_syntax)] struct Dog { name : String @@ -17,8 +16,8 @@ impl Barks for Dog { pub fn main() { - let snoopy = box Dog{name: "snoopy".to_string()}; - let bubbles = box Dog{name: "bubbles".to_string()}; + let snoopy = Box::new(Dog{name: "snoopy".to_string()}); + let bubbles = Box::new(Dog{name: "bubbles".to_string()}); let barker = [snoopy as Box<dyn Barks>, bubbles as Box<dyn Barks>]; for pup in &barker { diff --git a/src/test/ui/issues/issue-5718.rs b/src/test/ui/issues/issue-5718.rs index 63efec953..f29a1e2a0 100644 --- a/src/test/ui/issues/issue-5718.rs +++ b/src/test/ui/issues/issue-5718.rs @@ -1,14 +1,12 @@ // run-pass // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - struct Element; macro_rules! foo { ($tag: expr, $string: expr) => { if $tag == $string { - let element: Box<_> = box Element; + let element: Box<_> = Box::new(Element); unsafe { return std::mem::transmute::<_, usize>(element); } diff --git a/src/test/ui/issues/issue-57362-1.stderr b/src/test/ui/issues/issue-57362-1.stderr index 8e19f1400..b10273f14 100644 --- a/src/test/ui/issues/issue-57362-1.stderr +++ b/src/test/ui/issues/issue-57362-1.stderr @@ -2,9 +2,7 @@ error[E0599]: no method named `f` found for fn pointer `fn(&u8)` in the current --> $DIR/issue-57362-1.rs:20:7 | LL | a.f(); - | - ^ method not found in `fn(&u8)` - | | - | this is a function, perhaps you wish to call it + | ^ method not found in `fn(&u8)` | = help: items from traits can only be used if the trait is implemented and in scope note: `Trait` defines an item `f`, perhaps you need to implement it diff --git a/src/test/ui/issues/issue-5884.rs b/src/test/ui/issues/issue-5884.rs index 2f64342a6..991c52321 100644 --- a/src/test/ui/issues/issue-5884.rs +++ b/src/test/ui/issues/issue-5884.rs @@ -2,8 +2,6 @@ #![allow(dead_code)] // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - pub struct Foo { a: isize, } @@ -14,7 +12,7 @@ struct Bar<'a> { } fn check(a: Box<Foo>) { - let _ic = Bar{ b: &*a, a: box None }; + let _ic = Bar{ b: &*a, a: Box::new(None) }; } pub fn main(){} diff --git a/src/test/ui/issues/issue-59488.rs b/src/test/ui/issues/issue-59488.rs index 922b59393..384501e3e 100644 --- a/src/test/ui/issues/issue-59488.rs +++ b/src/test/ui/issues/issue-59488.rs @@ -30,4 +30,5 @@ fn main() { assert_eq!(Foo::Bar, i); //~^ ERROR binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` [E0369] //~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` [E0277] + //~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` [E0277] } diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr index 7ce3dedaa..08fe0b35e 100644 --- a/src/test/ui/issues/issue-59488.stderr +++ b/src/test/ui/issues/issue-59488.stderr @@ -6,7 +6,7 @@ LL | foo > 12; | | | fn() -> i32 {foo} | -help: you might have forgotten to call this function +help: use parentheses to call this function | LL | foo() > 12; | ++ @@ -28,10 +28,10 @@ LL | bar > 13; | | | fn(i64) -> i64 {bar} | -help: you might have forgotten to call this function +help: use parentheses to call this function | -LL | bar( /* arguments */ ) > 13; - | +++++++++++++++++++ +LL | bar(/* i64 */) > 13; + | +++++++++++ error[E0308]: mismatched types --> $DIR/issue-59488.rs:18:11 @@ -50,14 +50,10 @@ LL | foo > foo; | | | fn() -> i32 {foo} | -help: you might have forgotten to call this function +help: use parentheses to call these | -LL | foo() > foo; - | ++ -help: you might have forgotten to call this function - | -LL | foo > foo(); - | ++ +LL | foo() > foo(); + | ++ ++ error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}` --> $DIR/issue-59488.rs:25:9 @@ -93,7 +89,26 @@ error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` LL | assert_eq!(Foo::Bar, i); | ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug` | - = help: the trait `Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}` + = help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}` + = help: the following other types implement trait `Debug`: + extern "C" fn() -> Ret + extern "C" fn(A, B) -> Ret + extern "C" fn(A, B, ...) -> Ret + extern "C" fn(A, B, C) -> Ret + extern "C" fn(A, B, C, ...) -> Ret + extern "C" fn(A, B, C, D) -> Ret + extern "C" fn(A, B, C, D, ...) -> Ret + extern "C" fn(A, B, C, D, E) -> Ret + and 68 others + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` + --> $DIR/issue-59488.rs:30:5 + | +LL | assert_eq!(Foo::Bar, i); + | ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}` = help: the following other types implement trait `Debug`: extern "C" fn() -> Ret extern "C" fn(A, B) -> Ret @@ -106,7 +121,7 @@ LL | assert_eq!(Foo::Bar, i); and 68 others = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 9 previous errors +error: aborting due to 10 previous errors Some errors have detailed explanations: E0277, E0308, E0369. For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-5997-enum.stderr b/src/test/ui/issues/issue-5997-enum.stderr index 1c58b9c39..3a79215d3 100644 --- a/src/test/ui/issues/issue-5997-enum.stderr +++ b/src/test/ui/issues/issue-5997-enum.stderr @@ -2,11 +2,11 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-5997-enum.rs:2:16 | LL | fn f<Z>() -> bool { - | - - type parameter from outer function - | | - | try adding a local generic parameter in this method instead + | - type parameter from outer function LL | enum E { V(Z) } - | ^ use of generic parameter from outer function + | - ^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `<Z>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5997-struct.stderr b/src/test/ui/issues/issue-5997-struct.stderr index 5b388d16d..d2e97f767 100644 --- a/src/test/ui/issues/issue-5997-struct.stderr +++ b/src/test/ui/issues/issue-5997-struct.stderr @@ -2,11 +2,11 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-5997-struct.rs:2:14 | LL | fn f<T>() -> bool { - | - - type parameter from outer function - | | - | try adding a local generic parameter in this method instead + | - type parameter from outer function LL | struct S(T); - | ^ use of generic parameter from outer function + | -^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `<T>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-60218.stderr b/src/test/ui/issues/issue-60218.stderr index 870b25014..dd72b6515 100644 --- a/src/test/ui/issues/issue-60218.stderr +++ b/src/test/ui/issues/issue-60218.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `&u32: Foo` is not satisfied - --> $DIR/issue-60218.rs:18:27 + --> $DIR/issue-60218.rs:18:19 | LL | trigger_error(vec![], |x: &u32| x) - | ------------- ^^^^^^^^^^^ the trait `Foo` is not implemented for `&u32` + | ------------- ^^^^^^ the trait `Foo` is not implemented for `&u32` | | | required by a bound introduced by this call | diff --git a/src/test/ui/issues/issue-62480.rs b/src/test/ui/issues/issue-62480.rs index 5c3be3e64..94a9c2ab8 100644 --- a/src/test/ui/issues/issue-62480.rs +++ b/src/test/ui/issues/issue-62480.rs @@ -1,5 +1,3 @@ -#![feature(label_break_value)] - fn main() { // This used to ICE during liveness check because `target_id` passed to // `propagate_through_expr` would be the closure and not the `loop`, which wouldn't be found in diff --git a/src/test/ui/issues/issue-62480.stderr b/src/test/ui/issues/issue-62480.stderr index 17085ef90..db2305370 100644 --- a/src/test/ui/issues/issue-62480.stderr +++ b/src/test/ui/issues/issue-62480.stderr @@ -1,5 +1,5 @@ error[E0767]: use of unreachable label `'a` - --> $DIR/issue-62480.rs:8:18 + --> $DIR/issue-62480.rs:6:18 | LL | 'a: { | -- unreachable label defined here @@ -9,7 +9,7 @@ LL | || break 'a = note: labels are unreachable through functions, closures, async blocks and modules error[E0267]: `break` inside of a closure - --> $DIR/issue-62480.rs:8:12 + --> $DIR/issue-62480.rs:6:12 | LL | || break 'a | -- ^^^^^^^^ cannot `break` inside of a closure diff --git a/src/test/ui/issues/issue-6318.rs b/src/test/ui/issues/issue-6318.rs index d8bd83f0d..e5f245f6f 100644 --- a/src/test/ui/issues/issue-6318.rs +++ b/src/test/ui/issues/issue-6318.rs @@ -1,8 +1,6 @@ // run-pass // pretty-expanded FIXME #23616 -#![feature(box_syntax)] - pub enum Thing { A(Box<dyn Foo+'static>) } @@ -16,7 +14,7 @@ pub struct Struct; impl Foo for Struct {} pub fn main() { - match Thing::A(box Struct as Box<dyn Foo + 'static>) { + match Thing::A(Box::new(Struct) as Box<dyn Foo + 'static>) { Thing::A(_a) => 0, }; } diff --git a/src/test/ui/issues/issue-6557.rs b/src/test/ui/issues/issue-6557.rs index e066aa529..757e9608f 100644 --- a/src/test/ui/issues/issue-6557.rs +++ b/src/test/ui/issues/issue-6557.rs @@ -3,7 +3,6 @@ // pretty-expanded FIXME #23616 #![feature(box_patterns)] -#![feature(box_syntax)] fn foo(box (_x, _y): Box<(isize, isize)>) {} diff --git a/src/test/ui/issues/issue-66706.rs b/src/test/ui/issues/issue-66706.rs index 4585bcc8c..835fdfae8 100644 --- a/src/test/ui/issues/issue-66706.rs +++ b/src/test/ui/issues/issue-66706.rs @@ -2,7 +2,6 @@ fn a() { [0; [|_: _ &_| ()].len()] //~^ ERROR expected `,`, found `&` //~| ERROR type annotations needed - //~| ERROR mismatched types } fn b() { @@ -13,13 +12,11 @@ fn b() { fn c() { [0; [|&_: _ &_| {}; 0 ].len()] //~^ ERROR expected `,`, found `&` - //~| ERROR mismatched types } fn d() { [0; match [|f @ &ref _| () ] {} ] //~^ ERROR expected identifier, found reserved identifier `_` - //~| ERROR mismatched types } fn main() {} diff --git a/src/test/ui/issues/issue-66706.stderr b/src/test/ui/issues/issue-66706.stderr index 1c55560cb..8a30c0cad 100644 --- a/src/test/ui/issues/issue-66706.stderr +++ b/src/test/ui/issues/issue-66706.stderr @@ -7,13 +7,13 @@ LL | [0; [|_: _ &_| ()].len()] | help: missing `,` error: expected identifier, found reserved identifier `_` - --> $DIR/issue-66706.rs:9:20 + --> $DIR/issue-66706.rs:8:20 | LL | [0; [|f @ &ref _| {} ; 0 ].len() ]; | ^ expected identifier, found reserved identifier error: expected `,`, found `&` - --> $DIR/issue-66706.rs:14:17 + --> $DIR/issue-66706.rs:13:17 | LL | [0; [|&_: _ &_| {}; 0 ].len()] | -^ expected `,` @@ -21,7 +21,7 @@ LL | [0; [|&_: _ &_| {}; 0 ].len()] | help: missing `,` error: expected identifier, found reserved identifier `_` - --> $DIR/issue-66706.rs:20:26 + --> $DIR/issue-66706.rs:18:26 | LL | [0; match [|f @ &ref _| () ] {} ] | ^ expected identifier, found reserved identifier @@ -32,31 +32,6 @@ error[E0282]: type annotations needed LL | [0; [|_: _ &_| ()].len()] | ^ cannot infer type -error[E0308]: mismatched types - --> $DIR/issue-66706.rs:2:5 - | -LL | fn a() { - | - help: try adding a return type: `-> [i32; _]` -LL | [0; [|_: _ &_| ()].len()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]` - -error[E0308]: mismatched types - --> $DIR/issue-66706.rs:14:5 - | -LL | fn c() { - | - help: try adding a return type: `-> [i32; _]` -LL | [0; [|&_: _ &_| {}; 0 ].len()] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]` - -error[E0308]: mismatched types - --> $DIR/issue-66706.rs:20:5 - | -LL | fn d() { - | - help: try adding a return type: `-> [i32; _]` -LL | [0; match [|f @ &ref _| () ] {} ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]` - -error: aborting due to 8 previous errors +error: aborting due to 5 previous errors -Some errors have detailed explanations: E0282, E0308. -For more information about an error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr index d6e392516..2de150376 100644 --- a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr +++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr @@ -1,8 +1,10 @@ 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:8:39 + --> $DIR/issue-66923-show-error-for-correct-call.rs:8:24 | LL | let x2: Vec<f64> = x1.into_iter().collect(); - | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` + | ^^^^^^^^^^^^^^ ------- required by a bound introduced by this call + | | + | value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>` = help: the trait `FromIterator<T>` is implemented for `Vec<T>` @@ -13,10 +15,12 @@ LL | fn collect<B: FromIterator<Self::Item>>(self) -> B | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect` 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:14 | LL | let x3 = x1.into_iter().collect::<Vec<f64>>(); - | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` + | ^^^^^^^^^^^^^^ ------- required by a bound introduced by this call + | | + | value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>` = help: the trait `FromIterator<T>` is implemented for `Vec<T>` diff --git a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr index 733456a1a..37e2c3bdd 100644 --- a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr +++ b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr @@ -6,7 +6,7 @@ LL | let _ = Pin::new(Apple) == Rc::pin(Apple); | = note: expected struct `Apple` found struct `Rc<Apple>` - = note: required because of the requirements on the impl of `PartialEq<Pin<Rc<Apple>>>` for `Pin<Apple>` + = note: required for `Pin<Apple>` to implement `PartialEq<Pin<Rc<Apple>>>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr index e5ab65169..f581429a2 100644 --- a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr +++ b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr @@ -17,10 +17,10 @@ LL | | } = note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) error: missing type for `const` item - --> $DIR/issue-69396-const-no-type-in-macro.rs:4:19 + --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20 | LL | const A = "A".$fn(); - | ^ help: provide a type for the constant: `A: usize` + | ^ help: provide a type for the constant: `: usize` ... LL | / suite! { LL | | len; @@ -31,13 +31,13 @@ LL | | } = note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/issue-69396-const-no-type-in-macro.rs:4:19 + --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20 | LL | const A = "A".$fn(); - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `bool` + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `bool` ... LL | / suite! { LL | | len; diff --git a/src/test/ui/issues/issue-69455.stderr b/src/test/ui/issues/issue-69455.stderr index b732df764..9d11cf19e 100644 --- a/src/test/ui/issues/issue-69455.stderr +++ b/src/test/ui/issues/issue-69455.stderr @@ -16,7 +16,7 @@ error[E0283]: type annotations needed LL | println!("{}", 23u64.test(xs.iter().sum())); | ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum` | | - | type must be known at this point + | required by a bound introduced by this call | note: multiple `impl`s satisfying `u64: Test<_>` found --> $DIR/issue-69455.rs:11:1 diff --git a/src/test/ui/issues/issue-7013.rs b/src/test/ui/issues/issue-7013.rs index c1f400b33..1fb01303c 100644 --- a/src/test/ui/issues/issue-7013.rs +++ b/src/test/ui/issues/issue-7013.rs @@ -1,5 +1,3 @@ -#![feature(box_syntax)] - use std::cell::RefCell; use std::rc::Rc; @@ -23,6 +21,6 @@ struct A { } fn main() { - let a = A {v: box B{v: None} as Box<dyn Foo + Send>}; + let a = A {v: Box::new(B{v: None}) as Box<dyn Foo + Send>}; //~^ ERROR `Rc<RefCell<A>>` cannot be sent between threads safely } diff --git a/src/test/ui/issues/issue-7013.stderr b/src/test/ui/issues/issue-7013.stderr index f6cb1cbdc..4575f4dba 100644 --- a/src/test/ui/issues/issue-7013.stderr +++ b/src/test/ui/issues/issue-7013.stderr @@ -1,13 +1,13 @@ error[E0277]: `Rc<RefCell<A>>` cannot be sent between threads safely - --> $DIR/issue-7013.rs:26:19 + --> $DIR/issue-7013.rs:24:19 | -LL | let a = A {v: box B{v: None} as Box<dyn Foo + Send>}; - | ^^^^^^^^^^^^^^ `Rc<RefCell<A>>` cannot be sent between threads safely +LL | let a = A {v: Box::new(B{v: None}) as Box<dyn Foo + Send>}; + | ^^^^^^^^^^^^^^^^^^^^ `Rc<RefCell<A>>` cannot be sent between threads safely | = help: within `B`, the trait `Send` is not implemented for `Rc<RefCell<A>>` = note: required because it appears within the type `Option<Rc<RefCell<A>>>` note: required because it appears within the type `B` - --> $DIR/issue-7013.rs:10:8 + --> $DIR/issue-7013.rs:8:8 | LL | struct B { | ^ diff --git a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr index c6e6ea1e0..7f29709ce 100644 --- a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr +++ b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr @@ -8,11 +8,6 @@ LL | assert_eq!(a, 0); | {integer} | = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -help: you might have forgotten to call this function - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | -LL | if !(*left_val() == *right_val) { - | ++ error[E0308]: mismatched types --> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5 @@ -21,7 +16,7 @@ LL | assert_eq!(a, 0); | ^^^^^^^^^^^^^^^^ expected fn item, found integer | = note: expected fn item `fn() -> i32 {a}` - found type `i32` + found type `{integer}` = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `fn() -> i32 {a}` doesn't implement `Debug` @@ -33,7 +28,7 @@ LL | fn a() -> i32 { LL | assert_eq!(a, 0); | ^^^^^^^^^^^^^^^^ `fn() -> i32 {a}` cannot be formatted using `{:?}` because it doesn't implement `Debug` | - = help: the trait `Debug` is not implemented for `fn() -> i32 {a}` + = help: the trait `Debug` is not implemented for fn item `fn() -> i32 {a}` = help: use parentheses to call the function: `a()` = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/issues/issue-7364.rs b/src/test/ui/issues/issue-7364.rs index 83c52d286..79642bd41 100644 --- a/src/test/ui/issues/issue-7364.rs +++ b/src/test/ui/issues/issue-7364.rs @@ -1,9 +1,7 @@ -#![feature(box_syntax)] - use std::cell::RefCell; // Regression test for issue 7364 -static boxed: Box<RefCell<isize>> = box RefCell::new(0); +static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0)); //~^ ERROR `RefCell<isize>` cannot be shared between threads safely [E0277] fn main() { } diff --git a/src/test/ui/issues/issue-7364.stderr b/src/test/ui/issues/issue-7364.stderr index f2e80f451..5dc8c2b60 100644 --- a/src/test/ui/issues/issue-7364.stderr +++ b/src/test/ui/issues/issue-7364.stderr @@ -1,11 +1,11 @@ error[E0277]: `RefCell<isize>` cannot be shared between threads safely - --> $DIR/issue-7364.rs:6:15 + --> $DIR/issue-7364.rs:4:15 | -LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0); +LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0)); | ^^^^^^^^^^^^^^^^^^^ `RefCell<isize>` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `RefCell<isize>` - = note: required because of the requirements on the impl of `Sync` for `Unique<RefCell<isize>>` + = note: required for `Unique<RefCell<isize>>` to implement `Sync` = note: required because it appears within the type `Box<RefCell<isize>>` = note: shared static variables must have a type that implements `Sync` diff --git a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs index 2961dc79f..c089c3308 100644 --- a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs +++ b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs @@ -8,8 +8,6 @@ */ -#![feature(box_syntax)] - pub fn main() {} trait A { @@ -19,4 +17,4 @@ trait A { impl<T: 'static> A for T {} fn owned2<T: 'static>(a: Box<T>) { a as Box<dyn A>; } -fn owned3<T: 'static>(a: Box<T>) { box a as Box<dyn A>; } +fn owned3<T: 'static>(a: Box<T>) { Box::new(a) as Box<dyn A>; } diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr index 399c940ca..b26c1834d 100644 --- a/src/test/ui/issues/issue-86756.stderr +++ b/src/test/ui/issues/issue-86756.stderr @@ -25,9 +25,8 @@ LL | eq::<dyn, Foo> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> help: use `dyn` | -LL - eq::<dyn, Foo> -LL + eq::<dyn, dyn Foo> - | +LL | eq::<dyn, dyn Foo> + | +++ error[E0107]: missing generics for trait `Foo` --> $DIR/issue-86756.rs:5:15 diff --git a/src/test/ui/issues/issue-9129.rs b/src/test/ui/issues/issue-9129.rs index 780a6419c..04110b3ae 100644 --- a/src/test/ui/issues/issue-9129.rs +++ b/src/test/ui/issues/issue-9129.rs @@ -4,8 +4,6 @@ #![allow(non_snake_case)] // ignore-pretty unreported -#![feature(box_syntax)] - pub trait bomb { fn boom(&self, _: Ident); } pub struct S; impl bomb for S { fn boom(&self, _: Ident) { } } @@ -29,6 +27,6 @@ pub fn light_fuse(fld: Box<dyn bomb>) { } pub fn main() { - let b = box S as Box<dyn bomb>; + let b = Box::new(S) as Box<dyn bomb>; light_fuse(b); } diff --git a/src/test/ui/issues/issue-9382.rs b/src/test/ui/issues/issue-9382.rs index dbb0fa524..65718343f 100644 --- a/src/test/ui/issues/issue-9382.rs +++ b/src/test/ui/issues/issue-9382.rs @@ -3,7 +3,6 @@ // run-pass #![allow(dead_code)] -#![feature(box_syntax)] // Tests for a previous bug that occurred due to an interaction // between struct field initialization and the auto-coercion @@ -24,11 +23,11 @@ struct Thing2<'a> { pub fn main() { let _t1_fixed = Thing1 { baz: &[], - bar: box 32, + bar: Box::new(32), }; Thing1 { baz: &Vec::new(), - bar: box 32, + bar: Box::new(32), }; let _t2_fixed = Thing2 { baz: &[], diff --git a/src/test/ui/issues/issue-99875.rs b/src/test/ui/issues/issue-99875.rs new file mode 100644 index 000000000..cf73fd8d3 --- /dev/null +++ b/src/test/ui/issues/issue-99875.rs @@ -0,0 +1,16 @@ +struct Argument; +struct Return; + +fn function(_: Argument) -> Return { todo!() } + +trait Trait {} +impl Trait for fn(Argument) -> Return {} + +fn takes(_: impl Trait) {} + +fn main() { + takes(function); + //~^ ERROR the trait bound + takes(|_: Argument| -> Return { todo!() }); + //~^ ERROR the trait bound +} diff --git a/src/test/ui/issues/issue-99875.stderr b/src/test/ui/issues/issue-99875.stderr new file mode 100644 index 000000000..3ff8f12f1 --- /dev/null +++ b/src/test/ui/issues/issue-99875.stderr @@ -0,0 +1,33 @@ +error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied + --> $DIR/issue-99875.rs:12:11 + | +LL | takes(function); + | ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}` + | | + | required by a bound introduced by this call + | + = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return` +note: required by a bound in `takes` + --> $DIR/issue-99875.rs:9:18 + | +LL | fn takes(_: impl Trait) {} + | ^^^^^ required by this bound in `takes` + +error[E0277]: the trait bound `[closure@$DIR/issue-99875.rs:14:11: 14:34]: Trait` is not satisfied + --> $DIR/issue-99875.rs:14:11 + | +LL | takes(|_: Argument| -> Return { todo!() }); + | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `[closure@$DIR/issue-99875.rs:14:11: 14:34]` + | | + | required by a bound introduced by this call + | + = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return` +note: required by a bound in `takes` + --> $DIR/issue-99875.rs:9:18 + | +LL | fn takes(_: impl Trait) {} + | ^^^^^ required by this bound in `takes` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. |