File tree 3 files changed +35
-1
lines changed
3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1
- 2fdbf075cf502431ca9fee6616331b32e34f25de
1
+ a86705942c4cfaaee60f2e7308ca2bca703a710f
Original file line number Diff line number Diff line change
1
+ #![ allow( where_clauses_object_safety) ]
2
+
3
+ trait Trait { }
4
+
5
+ trait X {
6
+ fn foo ( & self )
7
+ where
8
+ Self : Trait ;
9
+ }
10
+
11
+ impl X for ( ) {
12
+ fn foo ( & self ) { }
13
+ }
14
+
15
+ impl Trait for dyn X { }
16
+
17
+ pub fn main ( ) {
18
+ <dyn X as X >:: foo ( & ( ) ) ; //~ERROR: trying to call something that is not a method
19
+ }
Original file line number Diff line number Diff line change
1
+ error: Undefined Behavior: `dyn` call trying to call something that is not a method
2
+ --> $DIR/issue-miri-2432.rs:LL:CC
3
+ |
4
+ LL | <dyn X as X>::foo(&());
5
+ | ^^^^^^^^^^^^^^^^^^^^^^ `dyn` call trying to call something that is not a method
6
+ |
7
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9
+ = note: backtrace:
10
+ = note: inside `main` at $DIR/issue-miri-2432.rs:LL:CC
11
+
12
+ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13
+
14
+ error: aborting due to previous error
15
+
You can’t perform that action at this time.
0 commit comments