]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-11493.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-11493.rs
index 80ecc24543e17d0c6f234ac10b58e017bef552ef..b28c173b19b7187b0491c4d59514f695eb0a14fb 100644 (file)
@@ -1,24 +1,7 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// This file must never have a trailing newline
-//
-// revisions: ast mir
-// compile-flags: -Z borrowck=compare
-
 fn id<T>(x: T) -> T { x }
 
 fn main() {
     let x = Some(3);
-    let y = x.as_ref().unwrap_or(&id(5));
-    //[ast]~^ ERROR borrowed value does not live long enough (Ast)
-    //[mir]~^^ ERROR borrowed value does not live long enough (Ast)
-    // This actually passes in mir
+    let y = x.as_ref().unwrap_or(&id(5));  //~ ERROR
+    &y;
 }