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 using struct MyStruct<'a, 'b> { x: &'a MyTrait<'b>,} #12851

Closed
nielsle opened this issue Mar 12, 2014 · 3 comments
Closed

ICE using struct MyStruct<'a, 'b> { x: &'a MyTrait<'b>,} #12851

nielsle opened this issue Mar 12, 2014 · 3 comments

Comments

@nielsle
Copy link
Contributor

nielsle commented Mar 12, 2014

When I try to compile the following code with rustc --crate-type lib test_error.rs

trait MyTrait<'a> {
    fn yo(&'a self);
}

struct MyStruct<'a, 'b> {
    inner: &'a  MyTrait<'b>,
}

impl<'a,'b> MyStruct<'a, 'b> {

    fn foo_inner(&mut self) {
        self.inner.yo()
    }
}

.. then I get the following ICE:

test_error.rs:12:9: 12:19 error: internal compiler error: cannot relate bound region: ReEarlyBound(10, 0, a) <= ReInfer(0)
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
test_error.rs:12         self.inner.yo()

Possibly related to #5121

@nielsle
Copy link
Contributor Author

nielsle commented Mar 13, 2014

Actually, you only need one lifetime to trigger the ICE

trait MyTrait<'a> {
    fn yo(&'a self);
}

struct MyStruct<'a> {
    inner: &'a  MyTrait<'a>,
}

impl<'a> MyStruct<'a> {

    fn foo_inner(&mut self) {
        self.inner.yo()
    }
}

@flaper87
Copy link
Contributor

This looks like a dup of #5121

@pnkfelix
Copy link
Member

(still reproduces, as is, on rustc 0.10-pre (caf17fe 2014-03-21).)

fasterthanlime pushed a commit to fasterthanlime/rust that referenced this issue Jul 24, 2022
…match-guard, r=Veykril

fix: Don't add braces to 'if' completion in match guard position

fixes rust-lang#12823

Is this what you were thinking of here, `@Veykril` ? I haven't done any work on completions before, so I could definitely be misunderstanding the issue.
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 13, 2024
Add required parentheses around method receiver

Fix rust-lang#12846

changelog: [`needless_bool`]: Add missing parentheses around method receiver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants