Skip to content

error: internal compiler error: src/librustc_typeck/astconv.rs:1267: anonymous bound region BrAnon(1) in return but not args #43594

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

Closed
Manishearth opened this issue Aug 1, 2017 · 2 comments
Labels
A-lifetimes Area: Lifetimes / regions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Manishearth
Copy link
Member

extern "C" {
    pub fn ICE(node: &u8) -> &u8;
}

produces

error: internal compiler error: src/librustc_typeck/astconv.rs:1267: anonymous bound region BrAnon(1) in return but not args
 --> test.rs:3:30
  |
3 |     pub fn ICE(node: &u8) -> &u8;
  |                              ^^^

It goes away if you stop relying on elision and put an explicit lifetime there.

This breaks stylo. (We can't work around this, we use lifetimes in FFI for additional safety and we need elision because bindgen doesn't know enough to insert manual lifetimes)

cc @eddyb @nikomatsakis

@Manishearth Manishearth added A-lifetimes Area: Lifetimes / regions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Aug 1, 2017
@eddyb
Copy link
Member

eddyb commented Aug 1, 2017

@Manishearth I thought we couldn't fix this without breaking some code (@nikomatsakis do you remember?). It was supposed to be unbound but I suppose astconv enforces soundness now.

@Mark-Simulacrum
Copy link
Member

I believe this is #43567, closing.

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

3 participants