// of the various arms, particularly in the case where regions are
// involved.
-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
pub fn opt_str0<'a>(maybestr: &'a Option<String>) -> &'a str {
match *maybestr {
Some(ref s) => {
Some(ref s) => {
let s: &'a str = s;
s
- //[base]~^ ERROR E0312
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
}
}
Some(ref s) => {
let s: &'a str = s;
s
- //[base]~^ ERROR E0312
- //[nll]~^^ ERROR lifetime may not live long enough
+ //~^ ERROR lifetime may not live long enough
}
None => "(none)",
}