diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs index b9a6f67ab0dcc..2e64fc290fcc2 100644 --- a/compiler/rustc_middle/src/ty/diagnostics.rs +++ b/compiler/rustc_middle/src/ty/diagnostics.rs @@ -698,6 +698,7 @@ impl<'tcx> FallibleTypeFolder> for MakeSuggestableFolder<'tcx> { } Closure(..) + | CoroutineClosure(..) | FnDef(..) | Infer(..) | Coroutine(..) diff --git a/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.rs b/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.rs new file mode 100644 index 0000000000000..f5926e19a150a --- /dev/null +++ b/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.rs @@ -0,0 +1,12 @@ +//@ edition: 2024 + +struct T<'g>(); +//~^ ERROR lifetime parameter `'g` is never used + +fn ord() -> _ { + //~^ WARN type parameter `a` should have an upper camel case name + //~| ERROR the placeholder `_` is not allowed within types on item signatures for return types + async || {} +} + +fn main() {} diff --git a/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.stderr b/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.stderr new file mode 100644 index 0000000000000..ca98d210579f3 --- /dev/null +++ b/tests/ui/async-await/async-closures/ice-async-closure-variance-issue-148488.stderr @@ -0,0 +1,26 @@ +warning: type parameter `a` should have an upper camel case name + --> $DIR/ice-async-closure-variance-issue-148488.rs:6:8 + | +LL | fn ord() -> _ { + | ^ help: convert the identifier to upper camel case: `A` + | + = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default + +error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/ice-async-closure-variance-issue-148488.rs:6:16 + | +LL | fn ord() -> _ { + | ^ not allowed in type signatures + +error[E0392]: lifetime parameter `'g` is never used + --> $DIR/ice-async-closure-variance-issue-148488.rs:3:10 + | +LL | struct T<'g>(); + | ^^ unused lifetime parameter + | + = help: consider removing `'g`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 2 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0121, E0392. +For more information about an error, try `rustc --explain E0121`.