diff options
Diffstat (limited to '')
-rw-r--r-- | third_party/rust/inherent/tests/test.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/rust/inherent/tests/test.rs b/third_party/rust/inherent/tests/test.rs new file mode 100644 index 0000000000..801b1c1165 --- /dev/null +++ b/third_party/rust/inherent/tests/test.rs @@ -0,0 +1,25 @@ +mod types { + use inherent::inherent; + + trait Trait { + fn f<T: ?Sized>(self); + // A default method + fn g(&self) {} + } + + pub struct Struct; + + #[inherent] + impl Trait for Struct { + pub fn f<T: ?Sized>(self) {} + pub fn g(&self); + } +} + +#[test] +fn test() { + // types::Trait is not in scope. + let s = types::Struct; + s.g(); + s.f::<str>(); +} |