Upstream: https://github.com/rust-lang/rust/issues/51117 The given example code should not be accepted, as "baz" borrows from "bar" -- the latter should be inaccessible until the former goes out of scope. Since this isn't properly enforced, a use-after-free becomes possible in safe code. fn main() { let mut foo = Some("foo".to_string()); let bar = &mut foo; match bar { Some(baz) => { bar.take(); println!("{:?}", baz); // UAF, segfaults or prints garbage }, None => unreachable!(), } } More analysis upstream, and fixed in https://github.com/rust-lang/rust/pull/51235 There will likely be a 1.26.2 release just to address this, so if possible I'd like to simply update to that: https://github.com/rust-lang/rust/pull/51258
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:2196