Skip to content
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

ICE with invalid syntax #5500

Closed
thestinger opened this issue Mar 22, 2013 · 5 comments · Fixed by #10067
Closed

ICE with invalid syntax #5500

thestinger opened this issue Mar 22, 2013 · 5 comments · Fixed by #10067
Labels
A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@thestinger
Copy link
Contributor

(updated test case for bug)

The following test inputs:

fn main() { &fail!() }

or, more elaborately:

struct TrieMapIterator<'self> {
    priv node: &'self uint
}

fn main() {
    let a = 5;
    let _iter = TrieMapIterator{node: &a};
    _iter.node = &
    fail!()
}

yields the ICE failure:

/tmp/issue5500.rs:8:17: 10:1 error: internal compiler error: ty_region() invoked on in appropriate ty: &ty_bot
/tmp/issue5500.rs:8     _iter.node = &
/tmp/issue5500.rs:9     fail!()
/tmp/issue5500.rs:10 }

(original bug test case follows)

struct TrieMapIterator {
    priv node: &'self uint
}

fn main() {
    let a = 5;
    let iter = TrieMapIterator{node: &a};
    iter.node = &
    fail!()
}
@jdm
Copy link
Contributor

jdm commented Mar 22, 2013

This may or may not be the same failure as

fn main() { &fail!() }

which fails with 'ty_region() invoked on in appropriate ty: ty_bot', /run/media/jdm/ssd/rust/src/librustc/middle/ty.rs:2760.

@toddaaro
Copy link
Contributor

toddaaro commented Jul 3, 2013

Visited for triage. Was able to reproduce. Nominating for "maturity number 5 - production ready".

@graydon
Copy link
Contributor

graydon commented Aug 8, 2013

accepted for production-ready milestone

@graydon
Copy link
Contributor

graydon commented Aug 8, 2013

just a bug, removing milestone/nomination.

@catamorphism
Copy link
Contributor

Both the smaller and the bigger versions still ICE as of b477f7a

@bors bors closed this as completed in dcdcd30 Oct 25, 2013
bors added a commit that referenced this issue Feb 12, 2014
While working on #11363 I stumbled over a couple of ignored tests, that seem to be fixed or invalid.

* src/test/run-pass/issue-3559.rs was fixed in #4726
* src/test/compile-fail/borrowck-call-sendfn.rs was fixed in #2978
* update src/test/compile-fail/issue-5500-1.rs to work with current Rust (I'm not 100% sure if the original condition is tested as mentioned in #5500, but I think so)
* removed src/test/compile-fail/issue-5500.rs because it is tested in
    src/test/run-fail/issue-5500.rs (they are the same test cases, I just renamed src/test/run-fail/addr-of-bot.rs to be consistent with the other issue name
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 2, 2020
New  lint `match_vec_item`

Added new lint to warn a match on index item which can panic. It's always better to use `get(..)` instead.
Closes rust-lang#5500
changelog: New lint `match_on_vec_items`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants