about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-30 12:48:20 +0000
committerbors <bors@rust-lang.org>2017-07-30 12:48:20 +0000
commit477e9f01714b6dffa1fb75e95b890d7abc2fcc52 (patch)
treee14286226a468b3a745cfa19190596f42252b508 /src/test
parent5c71e4ef90ef79c1ac79c4132333cbc80f5b85b9 (diff)
parent80cf3f99f4a3377fd9b544d18017ef29b8713dfd (diff)
downloadrust-477e9f01714b6dffa1fb75e95b890d7abc2fcc52.tar.gz
rust-477e9f01714b6dffa1fb75e95b890d7abc2fcc52.zip
Auto merge of #43543 - petrochenkov:32330, r=nikomatsakis
Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint

r? @nikomatsakis
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs24
-rw-r--r--src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs46
-rw-r--r--src/test/compile-fail/hr-subtype.rs3
-rw-r--r--src/test/ui/regions-fn-subtyping-return-static.stderr2
4 files changed, 30 insertions, 45 deletions
diff --git a/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs b/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs
index c5557cee7cc..0e822aff01e 100644
--- a/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs
+++ b/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs
@@ -43,23 +43,19 @@ fn baz<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
     (a, b)
 }
 
-// FIXME(#32330)
-//#[cfg(transmute)] // one instantiations: BAD
-//fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
-//    bar(foo, x) //[transmute] ERROR E0495
-//}
+#[cfg(transmute)] // one instantiations: BAD
+fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
+   bar(foo, x) //[transmute]~ ERROR E0495
+}
 
-// FIXME(#32330)
-//#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
-//fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
-//    let a = bar(foo, y); //[krisskross] ERROR E0495
-//    let b = bar(foo, x); //[krisskross] ERROR E0495
-//    (a, b)
-//}
+#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
+fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
+   let a = bar(foo, y); //[krisskross]~ ERROR E0495
+   let b = bar(foo, x); //[krisskross]~ ERROR E0495
+   (a, b)
+}
 
 #[rustc_error]
 fn main() { }
 //[ok]~^ ERROR compilation successful
 //[oneuse]~^^ ERROR compilation successful
-//[transmute]~^^^ ERROR compilation successful
-//[krisskross]~^^^^ ERROR compilation successful
diff --git a/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs b/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs
index a15422e42d9..10fe612980d 100644
--- a/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs
+++ b/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs
@@ -42,35 +42,29 @@ fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
     (a, b)
 }
 
-// FIXME(#32330)
-//#[cfg(oneuse)] // one instantiation: BAD
-//fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-//    let f = foo; // <-- No consistent type can be inferred for `f` here.
-//    let a = bar(f, x); //[oneuse] ERROR E0495
-//    let b = bar(f, y);
-//    (a, b)
-//}
+#[cfg(oneuse)] // one instantiation: BAD
+fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
+   let f = foo; // <-- No consistent type can be inferred for `f` here.
+   let a = bar(f, x); //[oneuse]~^ ERROR E0495
+   let b = bar(f, y);
+   (a, b)
+}
 
-// FIXME(#32330)
-//#[cfg(transmute)] // one instantiations: BAD
-//fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
-//    // Cannot instantiate `foo` with any lifetime other than `'a`,
-//    // since it is provided as input.
-//
-//    bar(foo, x) //[transmute] ERROR E0495
-//}
+#[cfg(transmute)] // one instantiations: BAD
+fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
+   // Cannot instantiate `foo` with any lifetime other than `'a`,
+   // since it is provided as input.
 
-// FIXME(#32330)
-//#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
-//fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
-//    let a = bar(foo, y); //[krisskross] ERROR E0495
-//    let b = bar(foo, x); //[krisskross] ERROR E0495
-//    (a, b)
-//}
+   bar(foo, x) //[transmute]~ ERROR E0495
+}
+
+#[cfg(krisskross)] // two instantiations, mixing and matching: BAD
+fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
+   let a = bar(foo, y); //[krisskross]~ ERROR E0495
+   let b = bar(foo, x); //[krisskross]~ ERROR E0495
+   (a, b)
+}
 
 #[rustc_error]
 fn main() { }
 //[ok]~^ ERROR compilation successful
-//[oneuse]~^^ ERROR compilation successful
-//[transmute]~^^^ ERROR compilation successful
-//[krisskross]~^^^^ ERROR compilation successful
diff --git a/src/test/compile-fail/hr-subtype.rs b/src/test/compile-fail/hr-subtype.rs
index 95e469ebcfd..c88d74d53ce 100644
--- a/src/test/compile-fail/hr-subtype.rs
+++ b/src/test/compile-fail/hr-subtype.rs
@@ -91,9 +91,6 @@ check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
 // - if we are covariant, then 'a and 'b can be set to the call-site
 //   intersection;
 // - if we are contravariant, then 'a can be inferred to 'static.
-//
-// FIXME(#32330) this is true, but we are not currently impl'ing this
-// full semantics
 check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32),
                                 for<'a>    fn(&'a u32, &'a u32)) }
 check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>),
diff --git a/src/test/ui/regions-fn-subtyping-return-static.stderr b/src/test/ui/regions-fn-subtyping-return-static.stderr
index 0c7b44af949..1598a8a40d2 100644
--- a/src/test/ui/regions-fn-subtyping-return-static.stderr
+++ b/src/test/ui/regions-fn-subtyping-return-static.stderr
@@ -6,8 +6,6 @@ error[E0308]: mismatched types
    |
    = note: expected type `fn(&'cx S) -> &'cx S`
               found type `fn(&'a S) -> &S {bar::<'_>}`
-   = note: lifetime parameter `'b` declared on fn `bar` appears only in the return type, but here is required to be higher-ranked, which means that `'b` must appear in both argument and return types
-   = note: this error is the result of a recent bug fix; for more information, see issue #33685 <https://github.com/rust-lang/rust/issues/33685>
 
 error: aborting due to previous error