Closed
Description
The compiler unexpectedly panicked on wrong code.
Reduced version of code:
fn main() {
bug("", "");
}
fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
let _ = v1.chars();
let _ = v2.split('.').map(|p| p.parse::<u64>());
std::mem::swap(v1, v2);
}
Output:
error: expected type, found `'a`
--> src/main.rs:5:20
|
5 | fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
| ^^
error: expected type, found `'a`
--> src/main.rs:5:36
|
5 | fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
| ^^
error[E0425]: cannot find value `v1` in this scope
--> src/main.rs:6:13
|
6 | let _ = v1.chars();
| ^^ not found in this scope
error[E0425]: cannot find value `v2` in this scope
--> src/main.rs:7:13
|
7 | let _ = v2.split('.').map(|p| p.parse::<u64>());
| ^^ not found in this scope
error[E0425]: cannot find value `v1` in this scope
--> src/main.rs:9:20
|
9 | std::mem::swap(v1, v2);
| ^^ not found in this scope
error[E0425]: cannot find value `v2` in this scope
--> src/main.rs:9:24
|
9 | std::mem::swap(v1, v2);
| ^^ not found in this scope
error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:2015: no type for node 33: type u64 (id=33) in fcx 0x7f53da9f2000
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.22.0-nightly (6c476ce46 2017-09-25) running on x86_64-unknown-linux-gnu
thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:492:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Meta
rustc 1.22.0-nightly (6c476ce 2017-09-25)
Link to playground