diff options
Diffstat (limited to 'src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs')
-rw-r--r-- | src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs new file mode 100644 index 000000000..e898b224e --- /dev/null +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs @@ -0,0 +1,30 @@ +trait Foo<A> { + fn foo(&self, a: A) -> A { + a + } +} + +trait NotRelevant<A> { + fn nr(&self, a: A) -> A { + a + } +} + +struct Bar; + +impl Foo<i8> for Bar {} +impl Foo<i16> for Bar {} +impl Foo<i32> for Bar {} + +impl Foo<u8> for Bar {} +impl Foo<u16> for Bar {} +impl Foo<u32> for Bar {} + +impl NotRelevant<usize> for Bar {} + +fn main() { + let f1 = Bar; + + f1.foo(1usize); + //~^ error: the trait bound `Bar: Foo<usize>` is not satisfied +} |