Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pub fn compute_implied_outlives_bounds_inner<'tcx>(
continue;
}

let arg = ocx.infcx.resolve_vars_if_possible(arg);
// From the full set of obligations, just filter down to the region relationships.
for obligation in
wf::unnormalized_obligations(ocx.infcx, param_env, arg, DUMMY_SP, CRATE_DEF_ID)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//@ compile-flags: -Znext-solver

// Regression test for https://github.com/rust-lang/rust-clippy/issues/17439

#![feature(inherent_associated_types)]

struct Foo<T>(T);

impl<'a> Foo<fn(&'a ())> {
type Assoc = &'a ();
}

fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
//~^ ERROR: higher-ranked subtype error
//~| ERROR: higher-ranked subtype error
//~| ERROR: lifetime bound not satisfied [E0478]
//~| ERROR: lifetime bound not satisfied [E0478]

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
error[E0478]: lifetime bound not satisfied
--> $DIR/implied_outlives_bounds_not_resolving_vars_ice.rs:13:11
|
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
--> $DIR/implied_outlives_bounds_not_resolving_vars_ice.rs:13:11
|
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: higher-ranked subtype error
--> $DIR/implied_outlives_bounds_not_resolving_vars_ice.rs:13:1
|
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: higher-ranked subtype error
--> $DIR/implied_outlives_bounds_not_resolving_vars_ice.rs:13:8
|
LL | fn bar(_: fn(Foo<for<'b> fn(Foo<fn(&'b ())>::Assoc)>::Assoc)) {}
| ^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0478`.
Loading