Closed
Description
I'm seeing an internal compiler error on the following input (found by fuzz-rustc):
fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
*x
}
fn main() {
let _ = test_ref &u;
}
$ rustc main.rs
error[E0425]: cannot find value `u` in this scope
--> main.rs:6:23
|
6 | let _ = test_ref &u;
| ^ not found in this scope
error[E0277]: the trait bound `u32: std::future::Future` is not satisfied
--> main.rs:1:25
|
1 | fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `u32`
2 | *x
| -- this returned value is of type `u32`
|
= note: the return type of a function must have a statically known size
thread 'rustc' panicked at 'assertion failed: !bounds.has_escaping_bound_vars()', src/librustc_typeck/check/method/mod.rs:390:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.45.0-nightly (7f65393b9 2020-05-01) running on x86_64-unknown-linux-gnu
error: aborting due to 2 previous errors
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Lifetimes / regionsCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to beta.