@@ -7,7 +7,6 @@ use errors::{DiagnosticBuilder, Level};
7
7
use rustc:: hir;
8
8
use rustc:: hir:: map as hir_map;
9
9
use rustc:: infer:: outlives:: env:: OutlivesEnvironment ;
10
- use rustc:: infer:: type_variable:: TypeVariableOrigin ;
11
10
use rustc:: infer:: { self , InferOk , InferResult , SuppressRegionErrors } ;
12
11
use rustc:: middle:: region;
13
12
use rustc:: session:: config:: { OutputFilenames , OutputTypes } ;
@@ -26,7 +25,6 @@ use syntax::ast;
26
25
use syntax:: feature_gate:: UnstableFeatures ;
27
26
use syntax:: source_map:: { FileName , FilePathMapping , SourceMap } ;
28
27
use syntax:: symbol:: Symbol ;
29
- use syntax_pos:: DUMMY_SP ;
30
28
31
29
use std:: path:: PathBuf ;
32
30
use std:: sync:: mpsc;
@@ -431,17 +429,6 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
431
429
}
432
430
}
433
431
}
434
-
435
- /// Checks that `t1 <: t2` is false (this may register additional
436
- /// region checks).
437
- pub fn check_not_sub ( & self , t1 : Ty < ' tcx > , t2 : Ty < ' tcx > ) {
438
- match self . sub ( t1, t2) {
439
- Err ( _) => { }
440
- Ok ( _) => {
441
- panic ! ( "unexpected success computing sub({:?},{:?})" , t1, t2) ;
442
- }
443
- }
444
- }
445
432
}
446
433
447
434
#[ test]
@@ -470,25 +457,6 @@ fn contravariant_region_ptr_err() {
470
457
} )
471
458
}
472
459
473
- #[ test]
474
- fn sub_free_bound_false ( ) {
475
- //! Test that:
476
- //!
477
- //! fn(&'a isize) <: for<'b> fn(&'b isize)
478
- //!
479
- //! *does not* hold.
480
-
481
- test_env ( EMPTY_SOURCE_STR , errors ( & [ ] ) , |mut env| {
482
- env. create_simple_region_hierarchy ( ) ;
483
- let t_rptr_free1 = env. t_rptr_free ( 1 ) ;
484
- let t_rptr_bound1 = env. t_rptr_late_bound ( 1 ) ;
485
- env. check_not_sub (
486
- env. t_fn ( & [ t_rptr_free1] , env. tcx ( ) . types . isize ) ,
487
- env. t_fn ( & [ t_rptr_bound1] , env. tcx ( ) . types . isize ) ,
488
- ) ;
489
- } )
490
- }
491
-
492
460
#[ test]
493
461
fn sub_bound_free_true ( ) {
494
462
//! Test that:
@@ -508,25 +476,6 @@ fn sub_bound_free_true() {
508
476
} )
509
477
}
510
478
511
- #[ test]
512
- fn sub_free_bound_false_infer ( ) {
513
- //! Test that:
514
- //!
515
- //! fn(_#1) <: for<'b> fn(&'b isize)
516
- //!
517
- //! does NOT hold for any instantiation of `_#1`.
518
-
519
- test_env ( EMPTY_SOURCE_STR , errors ( & [ ] ) , |env| {
520
- let t_infer1 = env. infcx
521
- . next_ty_var ( TypeVariableOrigin :: MiscVariable ( DUMMY_SP ) ) ;
522
- let t_rptr_bound1 = env. t_rptr_late_bound ( 1 ) ;
523
- env. check_not_sub (
524
- env. t_fn ( & [ t_infer1] , env. tcx ( ) . types . isize ) ,
525
- env. t_fn ( & [ t_rptr_bound1] , env. tcx ( ) . types . isize ) ,
526
- ) ;
527
- } )
528
- }
529
-
530
479
/// Test substituting a bound region into a function, which introduces another level of binding.
531
480
/// This requires adjusting the Debruijn index.
532
481
#[ test]
0 commit comments