File tree Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ pub const MIRI_DEFAULT_ARGS: &[&str] = &[
169
169
"-Zmir-emit-retag" ,
170
170
"-Zmir-keep-place-mention" ,
171
171
"-Zmir-opt-level=0" ,
172
- "-Zmir-enable-passes=-CheckAlignment" ,
172
+ "-Zmir-enable-passes=-CheckAlignment,-CheckNull " ,
173
173
// Deduplicating diagnostics means we miss events when tracking what happens during an
174
174
// execution. Let's not do that.
175
175
"-Zdeduplicate-diagnostics=no" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ fn main() {
10
10
replace_vptr ( ) ;
11
11
vtable_nop_cast ( ) ;
12
12
drop_principal ( ) ;
13
+ modulo_binder ( ) ;
14
+ modulo_assoc ( ) ;
13
15
}
14
16
15
17
fn vtable_nop_cast ( ) {
@@ -482,3 +484,53 @@ fn drop_principal() {
482
484
println ! ( "before" ) ;
483
485
drop ( y) ;
484
486
}
487
+
488
+ // Test for <https://github.com/rust-lang/rust/issues/135316>.
489
+ fn modulo_binder ( ) {
490
+ trait Supertrait < T > {
491
+ fn _print_numbers ( & self , mem : & [ usize ; 100 ] ) {
492
+ println ! ( "{mem:?}" ) ;
493
+ }
494
+ }
495
+ impl < T > Supertrait < T > for ( ) { }
496
+
497
+ trait Trait < T , U > : Supertrait < T > + Supertrait < U > {
498
+ fn say_hello ( & self , _: & usize ) {
499
+ println ! ( "Hello!" ) ;
500
+ }
501
+ }
502
+ impl < T , U > Trait < T , U > for ( ) { }
503
+
504
+ ( & ( ) as & ' static dyn for < ' a > Trait < & ' static ( ) , & ' a ( ) >
505
+ as & ' static dyn Trait < & ' static ( ) , & ' static ( ) > )
506
+ . say_hello ( & 0 ) ;
507
+ }
508
+
509
+ // Test for <https://github.com/rust-lang/rust/issues/135315>.
510
+ fn modulo_assoc ( ) {
511
+ trait Supertrait < T > {
512
+ fn _print_numbers ( & self , mem : & [ usize ; 100 ] ) {
513
+ println ! ( "{mem:?}" ) ;
514
+ }
515
+ }
516
+ impl < T > Supertrait < T > for ( ) { }
517
+
518
+ trait Identity {
519
+ type Selff ;
520
+ }
521
+ impl < Selff > Identity for Selff {
522
+ type Selff = Selff ;
523
+ }
524
+
525
+ trait Middle < T > : Supertrait < ( ) > + Supertrait < T > {
526
+ fn say_hello ( & self , _: & usize ) {
527
+ println ! ( "Hello!" ) ;
528
+ }
529
+ }
530
+ impl < T > Middle < T > for ( ) { }
531
+
532
+ trait Trait : Middle < <( ) as Identity >:: Selff > { }
533
+ impl Trait for ( ) { }
534
+
535
+ ( & ( ) as & dyn Trait as & dyn Middle < ( ) > ) . say_hello ( & 0 ) ;
536
+ }
Original file line number Diff line number Diff line change 2
2
goodbye
3
3
before
4
4
goodbye
5
+ Hello!
6
+ Hello!
You can’t perform that action at this time.
0 commit comments