trait Foo {}
impl<T: Fn<(i32,)>> Foo for T {}
fn baz<T: Foo>(_: T) {}
fn main() {
baz(|_| ());
//~^ ERROR implementation of `FnOnce` is not general enough
//~| ERROR implementation of `Fn` is not general enough
baz(|x| ());
//~^ ERROR implementation of `FnOnce` is not general enough
//~| ERROR implementation of `Fn` is not general enough
}
```
warning: unused variable: `x`
--> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10
|
8 | baz(|x| ());
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default
warning: 1 warning emitted
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: encountered type variable
--> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10
|
8 | baz(|x| ());
| ^
|
note: delayed at compiler/rustc_hir_typeck/src/expr_use_visitor.rs:174:20 - disabled backtrace
--> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10
|
8 | baz(|x| ());
| ^
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: please make sure that you have updated to the latest nightly
note: rustc 1.84.0-nightly (a0c2aba29 2024-10-15) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z crate-attr=feature(unboxed_closures) -Z dump-mir-dir=dir
query stack during panic:
end of query stack
```
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(unboxed_closures)
Program output
``` warning: unused variable: `x` --> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10 | 8 | baz(|x| ()); | ^ help: if this is intentional, prefix it with an underscore: `_x` | = note: `#[warn(unused_variables)]` on by default warning: 1 warning emitted note: no errors encountered even though delayed bugs were created note: those delayed bugs will now be shown as internal compiler errors error: internal compiler error: encountered type variable --> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10 | 8 | baz(|x| ()); | ^ | note: delayed at compiler/rustc_hir_typeck/src/expr_use_visitor.rs:174:20 - disabled backtrace --> /tmp/icemaker_global_tempdir.qRMnYYI19Q4z/rustc_testrunner_tmpdir_reporting.nQT3i3c5eog1/mvce.rs:8:10 | 8 | baz(|x| ()); | ^ note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md note: please make sure that you have updated to the latest nightly note: rustc 1.84.0-nightly (a0c2aba29 2024-10-15) running on x86_64-unknown-linux-gnu note: compiler flags: -Z crate-attr=feature(unboxed_closures) -Z dump-mir-dir=dir query stack during panic: end of query stack ```
@rustbot label +F-unboxed_closures