about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-07-07 23:36:21 +0000
committerbors <bors@rust-lang.org>2022-07-07 23:36:21 +0000
commit9b21131278cc38ab8d79444de340015faadd061c (patch)
treed1ab6e8690db439b7e41afc90a576d6a07dfaa04 /compiler/rustc_codegen_llvm/src/context.rs
parent1517f5de01c445b5124b30f02257b02b4c5ef3b2 (diff)
parent2a2df9dda98524c3027e4b77b95403a144086a9b (diff)
downloadrust-9b21131278cc38ab8d79444de340015faadd061c.tar.gz
rust-9b21131278cc38ab8d79444de340015faadd061c.zip
Auto merge of #98360 - estebank:uninit-binding, r=oli-obk
 On partial uninit error point at where we need init

When a binding is declared without a value, borrowck verifies that all
codepaths have *one* assignment to them to initialize them fully. If
there are any cases where a condition can be met that leaves the binding
uninitialized or we attempt to initialize a field of an uninitialized
binding, we emit E0381.

We now look at all the statements that initialize the binding, and use
them to explore branching code paths that *don't* and point at them. If
we find *no* potential places where an assignment to the binding might
be missing, we display the spans of all the existing initializers to
provide some context.

Fix https://github.com/rust-lang/rust/issues/97956.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
0 files changed, 0 insertions, 0 deletions