diff options
Diffstat (limited to 'tests/ui/implied-bounds/references-err.rs')
-rw-r--r-- | tests/ui/implied-bounds/references-err.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/implied-bounds/references-err.rs b/tests/ui/implied-bounds/references-err.rs new file mode 100644 index 000000000..203d512e3 --- /dev/null +++ b/tests/ui/implied-bounds/references-err.rs @@ -0,0 +1,22 @@ +trait Identity { + type Identity; +} +impl<T> Identity for T { + type Identity = T; +} + +trait Trait { + type Assoc: Identity; + fn tokenize(&self) -> <Self::Assoc as Identity>::Identity; +} + +impl Trait for () { + type Assoc = DoesNotExist; + //~^ ERROR cannot find type `DoesNotExist` in this scope + + fn tokenize(&self) -> <Self::Assoc as Identity>::Identity { + unimplemented!() + } +} + +fn main() {} |