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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
697 B
Rust
Raw Normal View History

2024-12-11 18:00:56 -03:00
use std::clone::UseCloned;
//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658]
2024-10-29 17:11:57 -03:00
fn ergonomic_clone(x: i32) -> i32 {
x.use
//~^ ERROR ergonomic clones are experimental [E0658]
2024-10-29 17:11:57 -03:00
}
2024-12-11 18:00:56 -03:00
#[derive(Clone)]
struct Foo;
fn foo<T: UseCloned>() {}
//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658]
2024-12-11 18:00:56 -03:00
impl UseCloned for Foo {}
//~^ ERROR use of unstable library feature `ergonomic_clones` [E0658]
2024-10-29 17:11:57 -03:00
fn ergonomic_closure_clone() {
2024-12-11 18:00:56 -03:00
let f1 = Foo;
2024-10-29 17:11:57 -03:00
2024-12-11 18:00:56 -03:00
let f2 = use || {
//~^ ERROR ergonomic clones are experimental [E0658]
2024-12-11 18:00:56 -03:00
f1
2024-10-29 17:11:57 -03:00
};
2024-12-11 18:00:56 -03:00
let f3 = use || {
//~^ ERROR ergonomic clones are experimental [E0658]
2024-12-11 18:00:56 -03:00
f1
2024-10-29 17:11:57 -03:00
};
}
fn main() {}