We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7a8ce1 commit 57dec5cCopy full SHA for 57dec5c
tests/run-pass/dyn-traits.rs
@@ -5,12 +5,18 @@ fn ref_box_dyn() {
5
6
trait Trait {
7
fn method(&self);
8
+
9
+ fn box_method(self: Box<Self>);
10
}
11
12
impl Trait for Struct {
13
fn method(&self) {
14
assert_eq!(self.0, 42);
15
16
17
+ fn box_method(self: Box<Self>) {
18
+ assert_eq!(self.0, 7);
19
+ }
20
21
22
struct Foo<T: ?Sized>(T);
@@ -27,6 +33,9 @@ fn ref_box_dyn() {
27
33
28
34
let y = &y;
29
35
y.method();
36
37
+ let y: Box<dyn Trait> = Box::new(Struct(7));
38
+ y.box_method();
30
39
31
40
32
41
0 commit comments