diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-07-29 17:19:57 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-07-29 17:50:42 +0300 |
| commit | 80cf3f99f4a3377fd9b544d18017ef29b8713dfd (patch) | |
| tree | 78abf14ee563149968a7e6b84f1b28b335a25aa5 /src/test | |
| parent | ad36f8febad77942b4f1f0e2ba0f422b69276d7b (diff) | |
| download | rust-80cf3f99f4a3377fd9b544d18017ef29b8713dfd.tar.gz rust-80cf3f99f4a3377fd9b544d18017ef29b8713dfd.zip | |
Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint
Diffstat (limited to 'src/test')
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 |
