diff options
Diffstat (limited to 'tests/ui/typeck/typeck-default-trait-impl-assoc-type.rs')
-rw-r--r-- | tests/ui/typeck/typeck-default-trait-impl-assoc-type.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/typeck/typeck-default-trait-impl-assoc-type.rs b/tests/ui/typeck/typeck-default-trait-impl-assoc-type.rs new file mode 100644 index 000000000..bafc16577 --- /dev/null +++ b/tests/ui/typeck/typeck-default-trait-impl-assoc-type.rs @@ -0,0 +1,17 @@ +// run-rustfix +// Test that we do not consider associated types to be sendable without +// some applicable trait bound (and we don't ICE). +#![allow(dead_code)] + +trait Trait { + type AssocType; + fn dummy(&self) { } +} +fn bar<T:Trait+Send>() { + is_send::<T::AssocType>(); //~ ERROR E0277 +} + +fn is_send<T:Send>() { +} + +fn main() { } |