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: Cannot relate bound region #10868

Closed
zslayton opened this issue Dec 9, 2013 · 3 comments
Closed

ICE: Cannot relate bound region #10868

zslayton opened this issue Dec 9, 2013 · 3 comments
Labels
A-lifetimes Area: Lifetimes / regions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@zslayton
Copy link
Contributor

zslayton commented Dec 9, 2013

Ostensibly related to #10841 which was created 2 days prior.

Error:

simplejson.rs:45:7: 46:7 error: internal compiler error: Cannot relate bound region: ReInfer(60) <= ReLateBound(78, BrNamed(syntax::ast::DefId{crate: 0u32, node: 108u32}, a))
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
simplejson.rs:45                                                        map.find_nested(key_iterator)
simplejson.rs:46                                                },
task 'rustc' failed at 'explicit failure', /home/zslayton/rust/src/libsyntax/diagnostic.rs:76
task '<main>' failed at 'explicit failure', /home/zslayton/rust/src/librustc/lib.rs:393

Source: https://gist.github.com/zslayton/7867213

64-Bit Linux Mint
rustc 0.9-pre (a6310f6 2013-12-08 11:51:22 -0800)
host: x86_64-unknown-linux-gnu

@alexcrichton
Copy link
Member

cc @nikomatsakis

@eminence
Copy link
Contributor

eminence commented Dec 9, 2013

I'm not sure if I'm running into the same issue, but if so I think I have a smaller reproducer for this:

trait Tag<'a> {
    fn get_name(&'a self) -> &'a str;
}

struct FooTag {
    _name: ~str
}
impl<'a> Tag<'a> for FooTag {
    fn get_name(&'a self) -> &'a str { self._name.as_slice() }
}

fn main() {
    let tag : ~Tag = ~FooTag {_name: ~"hello" } as ~Tag;
    let s = tag.get_name();

}
a.rs:14:12: 14:15 error: internal compiler error: Cannot relate bound region: ReEarlyBound(13, 0, a) <= ReInfer(3)
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
a.rs:14     let s = tag.get_name();

0.9-pre (aa4455e 2013-12-06 01:11:18 -0800)
host: x96_64 OSX 10.9

@nikomatsakis
Copy link
Contributor

Dup #5121

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…earth

Add `needless_if` lint

first off: Sorry about the large diff. Seems a ton of tests do this (understandably so).

this is basically everything I wanted in rust-lang#10868, while it doesn't lint *all* unnecessary empty blocks, it lints needless if statements; which are basically the crux of the issue (for me) anyway. I've committed code that includes this far too many times 😅 hopefully clippy can help me out soon

closes rust-lang#10868

changelog: New lint [`needless_if`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants