diff --git a/tests/ui/feature-gates/feature-gate-ergonomic-clones.rs b/tests/ui/feature-gates/feature-gate-ergonomic-clones.rs index fb2b853893e..c2e44064cfa 100644 --- a/tests/ui/feature-gates/feature-gate-ergonomic-clones.rs +++ b/tests/ui/feature-gates/feature-gate-ergonomic-clones.rs @@ -9,6 +9,9 @@ fn ergonomic_clone(x: i32) -> i32 { #[derive(Clone)] struct Foo; +fn foo<T: UseCloned>() {} +//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658] + impl UseCloned for Foo {} //~^ ERROR use of unstable library feature `ergonomic_clones` [E0658] diff --git a/tests/ui/feature-gates/feature-gate-ergonomic-clones.stderr b/tests/ui/feature-gates/feature-gate-ergonomic-clones.stderr index af1b2022ccf..cf92f2f28df 100644 --- a/tests/ui/feature-gates/feature-gate-ergonomic-clones.stderr +++ b/tests/ui/feature-gates/feature-gate-ergonomic-clones.stderr @@ -9,7 +9,7 @@ LL | x.use = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: ergonomic clones are experimental - --> $DIR/feature-gate-ergonomic-clones.rs:18:14 + --> $DIR/feature-gate-ergonomic-clones.rs:21:14 | LL | let f2 = use || { | ^^^ @@ -19,7 +19,7 @@ LL | let f2 = use || { = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: ergonomic clones are experimental - --> $DIR/feature-gate-ergonomic-clones.rs:23:14 + --> $DIR/feature-gate-ergonomic-clones.rs:26:14 | LL | let f3 = use || { | ^^^ @@ -39,7 +39,17 @@ LL | use std::clone::UseCloned; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `ergonomic_clones` - --> $DIR/feature-gate-ergonomic-clones.rs:12:6 + --> $DIR/feature-gate-ergonomic-clones.rs:12:11 + | +LL | fn foo<T: UseCloned>() {} + | ^^^^^^^^^ + | + = note: see issue #132290 <https://github.com/rust-lang/rust/issues/132290> for more information + = help: add `#![feature(ergonomic_clones)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `ergonomic_clones` + --> $DIR/feature-gate-ergonomic-clones.rs:15:6 | LL | impl UseCloned for Foo {} | ^^^^^^^^^ @@ -48,6 +58,6 @@ LL | impl UseCloned for Foo {} = help: add `#![feature(ergonomic_clones)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0658`.