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

Putting &mut Trait in a struct causes an ICE #8249

Closed
alexcrichton opened this issue Aug 3, 2013 · 2 comments
Closed

Putting &mut Trait in a struct causes an ICE #8249

alexcrichton opened this issue Aug 3, 2013 · 2 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@alexcrichton
Copy link
Member

This code

trait A {}
struct B;
impl A for B {}

struct C<'self> {
    foo: &'self mut A,
}

fn foo(a: &mut A) {
    C{ foo: a };
}

fn main() {
}

fails with this message:

foo.rs:10:12: 10:13 error: internal compiler error: Cannot relate bound region as subregion: br_self                                                
foo.rs:10     C{ foo: a };                                                                                                                          
                      ^                                                                                                                             

cc @msullivan

@nikomatsakis
Copy link
Contributor

cc @nikomatsakis

@alexcrichton
Copy link
Member Author

Yay, this works now! Removing ICE tag and adding needstest tag

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 13, 2022
Set binary-dep-depinfo in .cargo/config.toml

Fixes rust-lang#8248

According to https://doc.rust-lang.org/cargo/reference/unstable this
seems to be the right place to set it, and it does fix the build for me.

I haven't removed the other `rustflags` because perhaps it's needed on
different cargo/rust versions?

---

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: none
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.
Projects
None yet
Development

No branches or pull requests

2 participants