2024-02-16 14:02:50 -06:00
|
|
|
//@ revisions: default feature
|
2023-10-30 10:54:08 -05:00
|
|
|
#![cfg_attr(feature, feature(arbitrary_self_types))]
|
2023-05-22 22:23:52 -05:00
|
|
|
|
|
|
|
use std::ops::Deref;
|
|
|
|
|
|
|
|
struct Foo(u32);
|
|
|
|
impl Foo {
|
2023-10-30 10:54:08 -05:00
|
|
|
fn get<R: Deref<Target = Self>>(self: R) -> u32 {
|
|
|
|
//[default]~^ ERROR: `R` cannot be used as the type of `self`
|
2023-05-22 22:23:52 -05:00
|
|
|
self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut foo = Foo(1);
|
|
|
|
foo.get::<&Foo>();
|
2023-10-30 10:54:08 -05:00
|
|
|
//[feature]~^ ERROR mismatched types
|
2023-05-22 22:23:52 -05:00
|
|
|
}
|