]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/ufcs-object.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / ufcs-object.rs
1 // run-pass
2 // Test that when you use ufcs form to invoke a trait method (on a
3 // trait object) everything works fine.
4
5
6 trait Foo {
7     fn test(&self) -> i32;
8 }
9
10 impl Foo for i32 {
11     fn test(&self) -> i32 { *self }
12 }
13
14 fn main() {
15     let a: &dyn Foo = &22;
16     assert_eq!(Foo::test(a), 22);
17 }