We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#![feature(rustc_attrs)] struct DerefEx; impl std::ops::Deref for DerefEx { type Target = u32; fn deref(&self) -> &u32 { loop {} } } #[rustc_mir] fn funky(s: &'static DerefEx) -> &'static u32 { s } fn main() {}
Generated MIR:
fn(arg0: &DerefEx) -> &u32 { let var0: &DerefEx; // s let mut tmp0: &u32; let mut tmp1: DerefEx; let mut tmp2: (); bb0: { var0 = arg0; tmp1 = (*var0); // <- BUG this deref should be a reborrow tmp0 = core::ops::Deref::deref(tmp1) -> bb2; } bb1: { return; } bb2: { return = &(*tmp0); goto -> bb1; } }
cc @nikomatsakis @nagisa
The text was updated successfully, but these errors were encountered:
350b50d
arielb1
No branches or pull requests
Generated MIR:
cc @nikomatsakis @nagisa
The text was updated successfully, but these errors were encountered: