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

internal compiler error with impl Aaa for &mut Aaa #17771

Closed
stepancheg opened this issue Oct 4, 2014 · 3 comments · Fixed by #19780
Closed

internal compiler error with impl Aaa for &mut Aaa #17771

stepancheg opened this issue Oct 4, 2014 · 3 comments · Fixed by #19780
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

@stepancheg
Copy link
Contributor

Code:

trait Aaa {}

impl<'a> Aaa for &'a mut Aaa + 'a {}

struct Bar<'a> {
    writer: &'a mut Aaa + 'a,
}

fn baz(_: &mut Aaa) {
}

fn foo<'a>(mut bar: Bar<'a>) {
    baz(&mut bar.writer);
}

fn main() {
}
error: internal compiler error: trying to take the sizing type of Aaa+'a, an unsized type
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 4, 2014
@nodakai
Copy link
Contributor

nodakai commented Oct 5, 2014

@stepancheg Can you check if this is the same issue as #17351 ?

@stepancheg
Copy link
Contributor Author

@nodakai I don't know, looks similar.

@ghost ghost added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Oct 25, 2014
@nodakai
Copy link
Contributor

nodakai commented Nov 28, 2014

Added parenthesis as per PR #19298 and then it compiled fine.

trait Aaa {}

impl<'a> Aaa for &'a mut (Aaa + 'a) {}

struct Bar<'a> {
    writer: &'a mut (Aaa + 'a),
}

fn baz(_: &mut Aaa) {
}

fn foo<'a>(mut bar: Bar<'a>) {
    baz(&mut bar.writer);
}

fn main() {
}

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Dec 12, 2014
bors added a commit that referenced this issue Dec 18, 2014
Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.
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

Successfully merging a pull request may close this issue.

3 participants