Add run-pass test for dyn Receiver

This commit is contained in:
Alice Ryhl
2026-04-07 08:55:27 +00:00
parent 2d8ae32c58
commit 46a84f6c4f
@@ -0,0 +1,21 @@
//@ run-pass
#![feature(arbitrary_self_types)]
use std::ops::Receiver;
trait Trait {
fn foo(self: &dyn Receiver<Target=Self>);
}
struct Thing;
impl Trait for Thing {
fn foo(self: &dyn Receiver<Target=Self>) {
println!("huh???");
}
}
fn main() {
let x = Box::new(Thing);
let y: &dyn Receiver<Target=Thing> = &x;
y.foo();
}