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
Code like the following one
use std::marker::PhantomData; struct Zst { phantom: PhantomData<Zst> } #[rustc_mir(graphviz="foo.gv")] fn mir(){ let x = Zst { phantom: PhantomData }; }
generates some unnecessary LLVM IR. Namely:
bb0: ; preds = %entry-block %0 = getelementptr inbounds %Zst, %Zst* %x, i32 0, i32 0 store %"2.core::marker::PhantomData<Zst>" undef, %"2.core::marker::PhantomData<Zst>"* %0, align 1 br label %bb1
We should skip zero-sized fields in this code.
The text was updated successfully, but these errors were encountered:
[MIR] Avoid some code generation for stores of ZST
20618d0
Fixes rust-lang#30831
Auto merge of #30848 - nagisa:mir-no-store-zsts, r=nikomatsakis
e5bab5d
Fixes #30831 r? @nikomatsakis
No branches or pull requests
Code like the following one
generates some unnecessary LLVM IR. Namely:
We should skip zero-sized fields in this code.
The text was updated successfully, but these errors were encountered: