Skip to content

Commit

Permalink
Fix merge conflict about [] coercions in new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Nov 18, 2014
1 parent 56ba260 commit 6866bf3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/librustc_trans/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ fn subst_ty_renumber_bound() {
* level of binding. This requires adjusting the Debruijn index.
*/

test_env(EMPTY_SOURCE_STR, errors([]), |env| {
test_env(EMPTY_SOURCE_STR, errors(&[]), |env| {
// Situation:
// Theta = [A -> &'a foo]

Expand All @@ -549,7 +549,7 @@ fn subst_ty_renumber_bound() {
// t_source = fn(A)
let t_source = {
let t_param = env.t_param(subst::TypeSpace, 0);
env.t_fn([t_param], env.t_nil())
env.t_fn(&[t_param], env.t_nil())
};

let substs = subst::Substs::new_type(vec![t_rptr_bound1], vec![]);
Expand All @@ -558,7 +558,7 @@ fn subst_ty_renumber_bound() {
// t_expected = fn(&'a int)
let t_expected = {
let t_ptr_bound2 = env.t_rptr_late_bound_with_debruijn(1, ty::DebruijnIndex::new(2));
env.t_fn([t_ptr_bound2], env.t_nil())
env.t_fn(&[t_ptr_bound2], env.t_nil())
};

debug!("subst_bound: t_source={} substs={} t_substituted={} t_expected={}",
Expand All @@ -578,7 +578,7 @@ fn subst_ty_renumber_some_bounds() {
* level of binding. This requires adjusting the Debruijn index.
*/

test_env(EMPTY_SOURCE_STR, errors([]), |env| {
test_env(EMPTY_SOURCE_STR, errors(&[]), |env| {
// Situation:
// Theta = [A -> &'a foo]

Expand All @@ -587,7 +587,7 @@ fn subst_ty_renumber_some_bounds() {
// t_source = (A, fn(A))
let t_source = {
let t_param = env.t_param(subst::TypeSpace, 0);
env.t_pair(t_param, env.t_fn([t_param], env.t_nil()))
env.t_pair(t_param, env.t_fn(&[t_param], env.t_nil()))
};

let substs = subst::Substs::new_type(vec![t_rptr_bound1], vec![]);
Expand All @@ -598,7 +598,7 @@ fn subst_ty_renumber_some_bounds() {
// but not that the Debruijn index is different in the different cases.
let t_expected = {
let t_rptr_bound2 = env.t_rptr_late_bound_with_debruijn(1, ty::DebruijnIndex::new(2));
env.t_pair(t_rptr_bound1, env.t_fn([t_rptr_bound2], env.t_nil()))
env.t_pair(t_rptr_bound1, env.t_fn(&[t_rptr_bound2], env.t_nil()))
};

debug!("subst_bound: t_source={} substs={} t_substituted={} t_expected={}",
Expand All @@ -618,7 +618,7 @@ fn escaping() {
* regions or not.
*/

test_env(EMPTY_SOURCE_STR, errors([]), |env| {
test_env(EMPTY_SOURCE_STR, errors(&[]), |env| {
// Situation:
// Theta = [A -> &'a foo]

Expand All @@ -636,19 +636,19 @@ fn escaping() {
// t_fn = fn(A)
let t_param = env.t_param(subst::TypeSpace, 0);
assert!(!ty::type_has_escaping_regions(t_param));
let t_fn = env.t_fn([t_param], env.t_nil());
let t_fn = env.t_fn(&[t_param], env.t_nil());
assert!(!ty::type_has_escaping_regions(t_fn));

// t_fn = |&int|+'a
let t_fn = env.t_closure([t_rptr_bound1], env.t_nil(), env.re_free(0, 1));
let t_fn = env.t_closure(&[t_rptr_bound1], env.t_nil(), env.re_free(0, 1));
assert!(!ty::type_has_escaping_regions(t_fn));

// t_fn = |&int|+'a (where &int has depth 2)
let t_fn = env.t_closure([t_rptr_bound2], env.t_nil(), env.re_free(0, 1));
let t_fn = env.t_closure(&[t_rptr_bound2], env.t_nil(), env.re_free(0, 1));
assert!(ty::type_has_escaping_regions(t_fn));

// t_fn = |&int|+&int
let t_fn = env.t_closure([t_rptr_bound1], env.t_nil(),
let t_fn = env.t_closure(&[t_rptr_bound1], env.t_nil(),
env.re_late_bound_with_debruijn(1, ty::DebruijnIndex::new(1)));
assert!(ty::type_has_escaping_regions(t_fn));
})
Expand All @@ -661,13 +661,13 @@ fn subst_region_renumber_region() {
* for an early-bound region is a late-bound region.
*/

test_env(EMPTY_SOURCE_STR, errors([]), |env| {
test_env(EMPTY_SOURCE_STR, errors(&[]), |env| {
let re_bound1 = env.re_late_bound_with_debruijn(1, ty::DebruijnIndex::new(1));

// type t_source<'a> = fn(&'a int)
let t_source = {
let re_early = env.re_early_bound(subst::TypeSpace, 0, "'a");
env.t_fn([env.t_rptr(re_early)], env.t_nil())
env.t_fn(&[env.t_rptr(re_early)], env.t_nil())
};

let substs = subst::Substs::new_type(vec![], vec![re_bound1]);
Expand All @@ -678,7 +678,7 @@ fn subst_region_renumber_region() {
// but not that the Debruijn index is different in the different cases.
let t_expected = {
let t_rptr_bound2 = env.t_rptr_late_bound_with_debruijn(1, ty::DebruijnIndex::new(2));
env.t_fn([t_rptr_bound2], env.t_nil())
env.t_fn(&[t_rptr_bound2], env.t_nil())
};

debug!("subst_bound: t_source={} substs={} t_substituted={} t_expected={}",
Expand Down

1 comment on commit 6866bf3

@nikomatsakis
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=pcwalton p=22

Please sign in to comment.