Skip to content

Commit

Permalink
we now handle higher-ranked subtyping correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Aug 31, 2017
1 parent 17b65c4 commit f6d72d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/test/compile-fail/hr-subtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ macro_rules! check {
//[bound_inv_a_b_vs_bound_inv_a]~^^^ ERROR mismatched types
//[bound_a_b_ret_a_vs_bound_a_ret_a]~^^^^ ERROR mismatched types
//[free_inv_x_vs_free_inv_y]~^^^^^ ERROR mismatched types
//[bound_a_b_vs_bound_a]~^^^^^^ ERROR mismatched types
//[bound_co_a_b_vs_bound_co_a]~^^^^^^^ ERROR mismatched types
//[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^ ERROR mismatched types
//[bound_co_a_co_b_ret_contra_a]~^^^^^^^^^ ERROR mismatched types
}
}
}
Expand Down Expand Up @@ -113,4 +109,8 @@ fn main() {
//[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful
//[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful
//[free_x_vs_free_x]~^^^^^ ERROR compilation successful
//[bound_a_b_vs_bound_a]~^^^^^^ ERROR compilation successful
//[bound_co_a_b_vs_bound_co_a]~^^^^^^^ ERROR compilation successful
//[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^ ERROR compilation successful
//[bound_co_a_co_b_ret_contra_a]~^^^^^^^^^ ERROR compilation successful
}
6 changes: 1 addition & 5 deletions src/test/compile-fail/regions-fn-subtyping-return-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ fn baz(x: &S) -> &S {
fn supply_F() {
want_F(foo);

// FIXME(#33684) -- this should be a subtype, but current alg. rejects it incorrectly
want_F(bar); //~ ERROR E0308
want_F(bar);

want_F(baz);
}
Expand All @@ -58,9 +57,6 @@ fn supply_G() {
want_G(bar);
want_G(baz);
//~^ ERROR mismatched types
//~| expected type `fn(&'cx S) -> &'static S`
//~| found type `fn(&S) -> &S {baz}`
//~| expected concrete lifetime, found bound lifetime parameter 'cx
}

pub fn main() {
Expand Down

0 comments on commit f6d72d2

Please sign in to comment.