Debian Codegraph @

third_party/rust/inherent/tests/test.rs

raw
1 mod types {
2 use inherent::inherent;
3
4 trait Trait {
5 fn f<T: ?Sized>(self);
6 // A default method
7 fn g(&self) {}
8 }
9
10 pub struct Struct;
11
12 #[inherent]
13 impl Trait for Struct {
14 pub fn f<T: ?Sized>(self) {}
15 pub fn g(&self);
16 }
17 }
18
19 #[test]
20 fn test() {
21 // types::Trait is not in scope.
22 let s = types::Struct;
23 s.g();
24 s.f::<str>();
25 }