Skip to content

Commit

Permalink
remove outdated rustc_driver tests
Browse files Browse the repository at this point in the history
they are subsumed by `hr-subtype/hr-subtype.rs` and other tests
  • Loading branch information
nikomatsakis committed Jan 2, 2019
1 parent a2d9179 commit 0b03b9b
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions src/librustc_driver/test.rs
Expand Up @@ -7,7 +7,6 @@ use errors::{DiagnosticBuilder, Level};
use rustc::hir;
use rustc::hir::map as hir_map;
use rustc::infer::outlives::env::OutlivesEnvironment;
use rustc::infer::type_variable::TypeVariableOrigin;
use rustc::infer::{self, InferOk, InferResult, SuppressRegionErrors};
use rustc::middle::region;
use rustc::session::config::{OutputFilenames, OutputTypes};
Expand All @@ -26,7 +25,6 @@ use syntax::ast;
use syntax::feature_gate::UnstableFeatures;
use syntax::source_map::{FileName, FilePathMapping, SourceMap};
use syntax::symbol::Symbol;
use syntax_pos::DUMMY_SP;

use std::path::PathBuf;
use std::sync::mpsc;
Expand Down Expand Up @@ -431,17 +429,6 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
}
}
}

/// Checks that `t1 <: t2` is false (this may register additional
/// region checks).
pub fn check_not_sub(&self, t1: Ty<'tcx>, t2: Ty<'tcx>) {
match self.sub(t1, t2) {
Err(_) => {}
Ok(_) => {
panic!("unexpected success computing sub({:?},{:?})", t1, t2);
}
}
}
}

#[test]
Expand Down Expand Up @@ -470,25 +457,6 @@ fn contravariant_region_ptr_err() {
})
}

#[test]
fn sub_free_bound_false() {
//! Test that:
//!
//! fn(&'a isize) <: for<'b> fn(&'b isize)
//!
//! *does not* hold.

test_env(EMPTY_SOURCE_STR, errors(&[]), |mut env| {
env.create_simple_region_hierarchy();
let t_rptr_free1 = env.t_rptr_free(1);
let t_rptr_bound1 = env.t_rptr_late_bound(1);
env.check_not_sub(
env.t_fn(&[t_rptr_free1], env.tcx().types.isize),
env.t_fn(&[t_rptr_bound1], env.tcx().types.isize),
);
})
}

#[test]
fn sub_bound_free_true() {
//! Test that:
Expand All @@ -508,25 +476,6 @@ fn sub_bound_free_true() {
})
}

#[test]
fn sub_free_bound_false_infer() {
//! Test that:
//!
//! fn(_#1) <: for<'b> fn(&'b isize)
//!
//! does NOT hold for any instantiation of `_#1`.

test_env(EMPTY_SOURCE_STR, errors(&[]), |env| {
let t_infer1 = env.infcx
.next_ty_var(TypeVariableOrigin::MiscVariable(DUMMY_SP));
let t_rptr_bound1 = env.t_rptr_late_bound(1);
env.check_not_sub(
env.t_fn(&[t_infer1], env.tcx().types.isize),
env.t_fn(&[t_rptr_bound1], env.tcx().types.isize),
);
})
}

/// Test substituting a bound region into a function, which introduces another level of binding.
/// This requires adjusting the Debruijn index.
#[test]
Expand Down

0 comments on commit 0b03b9b

Please sign in to comment.