diff options
Diffstat (limited to 'tests/ui/traits/issue-38604.rs')
| -rw-r--r-- | tests/ui/traits/issue-38604.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/traits/issue-38604.rs b/tests/ui/traits/issue-38604.rs new file mode 100644 index 00000000000..002a3c43fcb --- /dev/null +++ b/tests/ui/traits/issue-38604.rs @@ -0,0 +1,16 @@ +trait Q<T:?Sized> {} +trait Foo where u32: Q<Self> { + fn foo(&self); +} + +impl Q<()> for u32 {} +impl Foo for () { + fn foo(&self) { + println!("foo!"); + } +} + +fn main() { + let _f: Box<dyn Foo> = //~ ERROR `Foo` cannot be made into an object + Box::new(()); //~ ERROR `Foo` cannot be made into an object +} |
