This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
3088c4b046
rust
/
tests
/
ui
/
borrowck
/
borrowck-uninit-after-item.rs
6 lines
83 B
Rust
Raw
Normal View
History
Unescape
Escape
new liveness pass to supercede last_use / initedness
2012-05-19 07:52:01 -05:00
fn
main
(
)
{
let
bar
;
Update compile fail tests to use isize.
2015-01-08 04:54:35 -06:00
fn
baz
(
_x
:
isize
)
{
}
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 unitialized 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.
2022-06-21 13:57:45 -05:00
baz
(
bar
)
;
//~ ERROR E0381
new liveness pass to supercede last_use / initedness
2012-05-19 07:52:01 -05:00
}
Reference in New Issue
Copy Permalink