diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-35976.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-35976.rs b/src/test/ui/issues/issue-35976.rs new file mode 100644 index 000000000..d075794d9 --- /dev/null +++ b/src/test/ui/issues/issue-35976.rs @@ -0,0 +1,20 @@ +mod private { + pub trait Future { + fn wait(&self) where Self: Sized; + } + + impl Future for Box<dyn Future> { + fn wait(&self) { } + } +} + +//use private::Future; + +fn bar(arg: Box<dyn private::Future>) { + arg.wait(); + //~^ ERROR the `wait` method cannot be invoked on a trait object +} + +fn main() { + +} |