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
19 changes: 19 additions & 0 deletions tests/ui/traits/late-bound-type-method-probe.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// A method probe involving a late-bound type parameter should report normal
// diagnostics instead of ICEing while structurally normalizing obligations.

#![feature(non_lifetime_binders)]
#![allow(incomplete_features)]

pub trait T {
fn t<Tail>(&self, _: F) {}
//~^ ERROR cannot find type `F` in this scope
}

pub fn crash<V>(v: &V)
where
for<F> F: T + 'static,
{
v.t(|| {});
}

fn main() {}
17 changes: 17 additions & 0 deletions tests/ui/traits/late-bound-type-method-probe.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0425]: cannot find type `F` in this scope
--> $DIR/late-bound-type-method-probe.rs:8:26
|
LL | fn t<Tail>(&self, _: F) {}
| ^
|
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
= note: similarly named trait `Fn` defined here
help: a trait with a similar name exists
|
LL | fn t<Tail>(&self, _: Fn) {}
| +

error: aborting due to 1 previous error

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