Skip to content

compiler panic on "let v[0] = v[1]" where v is a vector #23212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mikeantonacci opened this issue Mar 9, 2015 · 3 comments
Closed

compiler panic on "let v[0] = v[1]" where v is a vector #23212

mikeantonacci opened this issue Mar 9, 2015 · 3 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mikeantonacci
Copy link

I was playing with rust for the first time today and I tried this code:
fn main(){
    let mut v = vec![5, 6, 5, 4, 3, 2];
    let tmp = v[0];
    let v[0] = v[1];
    let v[1] = tmp;
}
In retrospect that shouldn't compile anyway, but when I tried instead of it just being an error the compiler panics. ## Meta

rustc --version --verbose:
rustc 1.0.0-nightly (270a677d4 2015-03-07) (built 2015-03-07)
binary: rustc
commit-hash: 270a677d4d698916f5ad103f0afc3c070b8dbeb4
commit-date: 2015-03-07
build-date: 2015-03-07
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

Backtrace:
thread 'rustc' panicked at 'Box', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:129

stack backtrace:
1: 0x7ffd2bf5d2d2 - sys::backtrace::write::he3277a63d69f5b66QBA
2: 0x7ffd2bf83322 - panicking::on_panic::h2a4421d00c8eaa07jHJ
3: 0x7ffd2bec9a69 - rt::unwind::begin_unwind_inner::hb49f4d2d01640667mnJ
4: 0x7ffd294fd4ad - rt::unwind::begin_unwind::h7009344801856954356
5: 0x7ffd294fd453 - diagnostic::SpanHandler::span_bug::hc2a2d6179f91087747D
6: 0x7ffd29523445 - parse::parser::Parser<'a>::parse_pat::h7bb056c6956d3cabfHK
7: 0x7ffd2953541d - parse::parser::Parser<'a>::parse_local::hf9e9abc5dbe40b54zYK
8: 0x7ffd2953671f - parse::parser::Parser<'a>::parse_stmt::hf64ef6e19a06ac72k1K
9: 0x7ffd2953f389 - parse::parser::Parser<'a>::parse_block_tail_::h4c891b4206c9ae93tcL
10: 0x7ffd2951d9bc - parse::parser::Parser<'a>::parse_inner_attrs_and_block::h16f9671c2a8402a7VaL
11: 0x7ffd29543965 - parse::parser::Parser<'a>::parse_item_fn::h22fd08f202ca7c8dkQL
12: 0x7ffd29539c78 - parse::parser::Parser<'a>::parse_item_::h6fa6dafc5db24c9fUOM
13: 0x7ffd29549e95 - parse::parser::Parser<'a>::parse_mod_items::hc345aee461327f21UeM
14: 0x7ffd29551f1c - parse::parser::Parser<'a>::parse_crate_mod::hb0b177721e0e02a2rfN
15: 0x7ffd295638b8 - parse::parse_crate_from_file::h9da771b7e7d3ce72ftU
16: 0x7ffd2c584bd8 - driver::phase_1_parse_input::closure.15543
17: 0x7ffd2c55fd87 - driver::phase_1_parse_input::h22478ea7b47ad567Kqa
18: 0x7ffd2c55c560 - driver::compile_input::h4ead3acd85265c84Nba
19: 0x7ffd2c621ebd - run_compiler::h297fa686def10927G6b
20: 0x7ffd2c61fc2c - thunk::F.Invoke<A, R>::invoke::h13212375243324058858
21: 0x7ffd2c61e880 - rt::unwind::try::try_fn::h15556897595580953244
22: 0x7ffd2bfef0f8 - rust_try_inner
23: 0x7ffd2bfef0e5 - rust_try
24: 0x7ffd2c61f00b - thunk::F.Invoke<A, R>::invoke::h6333748217615269386
25: 0x7ffd2bf70b25 - sys::thread::thread_start::h14dbe992a2cfcf49t8E
26: 0x7ffd25fe2373 - start_thread
27: 0x7ffd2bb5227c - __clone
28: 0x0 -

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 9, 2015
@petrochenkov
Copy link
Contributor

Fixed by #23930

@pnkfelix pnkfelix added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 4, 2015
@petrochenkov
Copy link
Contributor

@alexcrichton
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants