Skip to content

Commit d2bde63

Browse files
committed
Add slight variation to feature-gate ergonomic clones test
1 parent d7104dc commit d2bde63

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

tests/ui/feature-gates/feature-gate-ergonomic-clones.rs

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ fn ergonomic_clone(x: i32) -> i32 {
99
#[derive(Clone)]
1010
struct Foo;
1111

12+
fn foo<T: UseCloned>() {}
13+
//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658]
14+
1215
impl UseCloned for Foo {}
1316
//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658]
1417

tests/ui/feature-gates/feature-gate-ergonomic-clones.stderr

+14-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | x.use
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: ergonomic clones are experimental
12-
--> $DIR/feature-gate-ergonomic-clones.rs:18:14
12+
--> $DIR/feature-gate-ergonomic-clones.rs:21:14
1313
|
1414
LL | let f2 = use || {
1515
| ^^^
@@ -19,7 +19,7 @@ LL | let f2 = use || {
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error[E0658]: ergonomic clones are experimental
22-
--> $DIR/feature-gate-ergonomic-clones.rs:23:14
22+
--> $DIR/feature-gate-ergonomic-clones.rs:26:14
2323
|
2424
LL | let f3 = use || {
2525
| ^^^
@@ -39,7 +39,17 @@ LL | use std::clone::UseCloned;
3939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4040

4141
error[E0658]: use of unstable library feature `ergonomic_clones`
42-
--> $DIR/feature-gate-ergonomic-clones.rs:12:6
42+
--> $DIR/feature-gate-ergonomic-clones.rs:12:11
43+
|
44+
LL | fn foo<T: UseCloned>() {}
45+
| ^^^^^^^^^
46+
|
47+
= note: see issue #132290 <https://github.com/rust-lang/rust/issues/132290> for more information
48+
= help: add `#![feature(ergonomic_clones)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: use of unstable library feature `ergonomic_clones`
52+
--> $DIR/feature-gate-ergonomic-clones.rs:15:6
4353
|
4454
LL | impl UseCloned for Foo {}
4555
| ^^^^^^^^^
@@ -48,6 +58,6 @@ LL | impl UseCloned for Foo {}
4858
= help: add `#![feature(ergonomic_clones)]` to the crate attributes to enable
4959
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5060

51-
error: aborting due to 5 previous errors
61+
error: aborting due to 6 previous errors
5262

5363
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)