Remove feature(nll) when compare mode is sufficient

This commit is contained in:
Matthew Jasper 2019-04-07 16:07:36 +01:00
parent ff71b80a85
commit be5fe051a8
301 changed files with 774 additions and 1029 deletions

View File

@ -13,7 +13,6 @@
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
#![feature(never_type)]
#![feature(nll)]
#[derive(Copy, Clone)]
pub struct Entity {

View File

@ -2,8 +2,6 @@
// ignore-wasm32-bare
#![feature(nll)]
fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
match x {
Some(0) if c => 0,

View File

@ -1,7 +1,5 @@
// error-pattern: thread 'main' panicked at 'explicit panic'
#![feature(nll)]
fn main() {
let mut vec = vec![];
vec.push((vec.len(), panic!()));

View File

@ -3,8 +3,6 @@
#![allow(unused_variables)]
// Test case from #39963.
#![feature(nll)]
#[derive(Clone)]
struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);

View File

@ -1,5 +1,4 @@
// run-pass
#![feature(nll)]
#![deny(unused_mut)]
#[derive(Debug)]

View File

@ -1,8 +1,4 @@
// run-pass
// revisions: lxl nll
#![cfg_attr(nll, feature(nll))]
use std::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign};
use std::ops::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};

View File

@ -5,7 +5,6 @@
// See further discussion on rust-lang/rust#24535,
// rust-lang/rfcs#1006, and rust-lang/rfcs#107
#![feature(nll)]
#![feature(bind_by_move_pattern_guards)]
fn main() {

View File

@ -1,7 +1,6 @@
// run-pass
#![allow(unused_must_use)]
// Test that we are able to reinitialize box with moved referent
#![feature(nll)]
static mut ORDER: [usize; 3] = [0, 0, 0];
static mut INDEX: usize = 0;

View File

@ -1,6 +1,5 @@
// run-pass
#![allow(unreachable_code)]
#![feature(nll)]
fn main() {
let mut v = Vec::new();

View File

@ -3,7 +3,6 @@
// Regression test for #47153: constants in a generic context (such as
// a trait) used to ICE.
#![feature(nll)]
#![allow(warnings)]
trait Foo {

View File

@ -1,7 +1,5 @@
// run-pass
#![feature(nll)]
pub struct DescriptorSet<'a> {
pub slots: Vec<AttachInfo<'a, Resources>>
}

View File

@ -2,8 +2,6 @@
#![allow(path_statements)]
#![allow(dead_code)]
#![feature(nll)]
struct WithDrop;
impl Drop for WithDrop {

View File

@ -2,7 +2,6 @@
#![allow(path_statements)]
#![allow(dead_code)]
#![feature(nll)]
#![feature(generators, generator_trait)]
struct WithDrop;

View File

@ -1,6 +1,5 @@
// run-pass
#![feature(nll)]
#![deny(unused_mut)]
fn main() {

View File

@ -1,6 +1,5 @@
// run-pass
#![feature(nll)]
#![deny(unused_mut)]
struct Foo {

View File

@ -1,6 +1,5 @@
// run-pass
#![feature(nll)]
#![allow(unused_variables)]
pub trait TryTransform {

View File

@ -1,7 +1,5 @@
// run-pass
#![feature(nll)]
struct List<T> {
value: T,
next: Option<Box<List<T>>>,

View File

@ -1,7 +1,5 @@
// run-pass
#![feature(nll)]
use std::collections::HashMap;
fn process_or_insert_default(map: &mut HashMap<usize, String>, key: usize) {

View File

@ -6,8 +6,6 @@
// `x`. The lexical checker makes this very painful. The NLL checker
// does not.
#![feature(nll)]
use std::rc::Rc;
#[derive(Debug, PartialEq, Eq)]

View File

@ -1,5 +1,3 @@
#![feature(nll)]
struct Node {
elem: i32,
next: Option<Box<Node>>,

View File

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `src`
--> $DIR/borrowck-issue-48962.rs:16:5
--> $DIR/borrowck-issue-48962.rs:14:5
|
LL | let mut src = &mut node;
| ------- move occurs because `src` has type `&mut Node`, which does not implement the `Copy` trait
@ -9,7 +9,7 @@ LL | src.next = None;
| ^^^^^^^^ value used here after move
error[E0382]: use of moved value: `src`
--> $DIR/borrowck-issue-48962.rs:22:5
--> $DIR/borrowck-issue-48962.rs:20:5
|
LL | let mut src = &mut (22, 44);
| ------- move occurs because `src` has type `&mut (i32, i32)`, which does not implement the `Copy` trait

View File

@ -1,7 +1,5 @@
// run-pass
#![feature(nll)]
enum Nat {
S(Box<Nat>),
Z

View File

@ -8,8 +8,6 @@
// run-pass
#![feature(nll)]
fn foo(x: &mut Result<(u32, u32), (u32, u32)>) -> u32 {
match *x {
Ok((ref mut v, _)) | Err((_, ref mut v)) if *v > 0 => { *v }

View File

@ -2,8 +2,6 @@
// computing liveness that wound up accidentally causing the program
// below to be accepted.
#![feature(nll)]
fn foo<'a>(x: &'a mut u32) -> u32 {
let mut x = 22;
let y = &x;

View File

@ -1,5 +1,5 @@
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/issue-52713-bug.rs:14:5
--> $DIR/issue-52713-bug.rs:12:5
|
LL | let y = &x;
| -- borrow of `x` occurs here

View File

@ -1,5 +1,3 @@
#![feature(nll)]
#![allow(dead_code)]
#[derive(Debug)]

View File

@ -1,5 +1,5 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:16:13
--> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:14:13
|
LL | *array
| ^^^^^^

View File

@ -1,19 +1,11 @@
// ignore-compare-mode-nll
// revisions: migrate nll
#![cfg_attr(nll, feature(nll))]
fn main() {
let mut greeting = "Hello world!".to_string();
let res = (|| (|| &greeting)())();
greeting = "DEALLOCATED".to_string();
//[migrate]~^ ERROR cannot assign
//[nll]~^^ ERROR cannot assign
//~^ ERROR cannot assign
drop(greeting);
//[migrate]~^ ERROR cannot move
//[nll]~^^ ERROR cannot move
//~^ ERROR cannot move
println!("thread result: {:?}", res);
}

View File

@ -1,5 +1,5 @@
error[E0506]: cannot assign to `greeting` because it is borrowed
--> $DIR/issue-58776-borrowck-scans-children.rs:11:5
--> $DIR/issue-58776-borrowck-scans-children.rs:5:5
|
LL | let res = (|| (|| &greeting)())();
| -- -------- borrow occurs due to use in closure
@ -13,7 +13,7 @@ LL | println!("thread result: {:?}", res);
| --- borrow later used here
error[E0505]: cannot move out of `greeting` because it is borrowed
--> $DIR/issue-58776-borrowck-scans-children.rs:14:10
--> $DIR/issue-58776-borrowck-scans-children.rs:7:10
|
LL | let res = (|| (|| &greeting)())();
| -- -------- borrow occurs due to use in closure

View File

@ -1,8 +1,6 @@
// Test that a borrow which starts as a 2-phase borrow and gets
// carried around a loop winds up conflicting with itself.
#![feature(nll)]
struct Foo { x: String }
impl Foo {

View File

@ -1,5 +1,5 @@
error[E0499]: cannot borrow `foo` as mutable more than once at a time
--> $DIR/two-phase-across-loop.rs:19:22
--> $DIR/two-phase-across-loop.rs:17:22
|
LL | strings.push(foo.get_string());
| ^^^ mutable borrow starts here in previous iteration of loop

View File

@ -1,5 +1,3 @@
#![feature(nll)]
struct Foo {
}

View File

@ -1,5 +1,5 @@
error[E0499]: cannot borrow `foo` as mutable more than once at a time
--> $DIR/two-phase-multi-mut.rs:13:5
--> $DIR/two-phase-multi-mut.rs:11:5
|
LL | foo.method(&mut foo);
| ^^^^------^--------^
@ -9,7 +9,7 @@ LL | foo.method(&mut foo);
| second mutable borrow occurs here
error[E0499]: cannot borrow `foo` as mutable more than once at a time
--> $DIR/two-phase-multi-mut.rs:13:16
--> $DIR/two-phase-multi-mut.rs:11:16
|
LL | foo.method(&mut foo);
| --- ------ ^^^^^^^^ second mutable borrow occurs here

View File

@ -1,31 +0,0 @@
#![crate_type="lib"]
#![no_std]
#![feature(c_variadic)]
// The tests in this file are similar to that of variadic-ffi-4, but this
// one enables nll.
#![feature(nll)]
use core::ffi::VaList;
pub unsafe extern "C" fn no_escape0<'a>(_: usize, ap: ...) -> VaList<'a> {
ap //~ ERROR: explicit lifetime required
}
pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> {
ap //~ ERROR: explicit lifetime required
}
pub unsafe extern "C" fn no_escape2(_: usize, ap: ...) {
let _ = ap.with_copy(|ap| { ap }); //~ ERROR: lifetime may not live long enough
}
pub unsafe extern "C" fn no_escape3(_: usize, ap0: &mut VaList, mut ap1: ...) {
*ap0 = ap1; //~ ERROR: lifetime may not live long enough
}
pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) {
ap0 = &mut ap1;
//~^ ERROR: lifetime may not live long enough
//~^^ ERROR: lifetime may not live long enough
//~^^^ ERROR: `ap1` does not live long enough
}

View File

@ -1,73 +0,0 @@
error[E0621]: explicit lifetime required in the type of `ap`
--> $DIR/variadic-ffi-5.rs:11:5
|
LL | pub unsafe extern "C" fn no_escape0<'a>(_: usize, ap: ...) -> VaList<'a> {
| --- help: add explicit lifetime `'a` to the type of `ap`: `core::ffi::VaList<'a>`
LL | ap
| ^^ lifetime `'a` required
error[E0621]: explicit lifetime required in the type of `ap`
--> $DIR/variadic-ffi-5.rs:15:5
|
LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> {
| --- help: add explicit lifetime `'static` to the type of `ap`: `core::ffi::VaList<'static>`
LL | ap
| ^^ lifetime `'static` required
error: lifetime may not live long enough
--> $DIR/variadic-ffi-5.rs:19:33
|
LL | let _ = ap.with_copy(|ap| { ap });
| --- ^^ returning this value requires that `'1` must outlive `'2`
| | |
| | return type of closure is core::ffi::VaList<'2>
| has type `core::ffi::VaList<'1>`
error: lifetime may not live long enough
--> $DIR/variadic-ffi-5.rs:23:5
|
LL | pub unsafe extern "C" fn no_escape3(_: usize, ap0: &mut VaList, mut ap1: ...) {
| --- ------- has type `core::ffi::VaList<'1>`
| |
| has type `&mut core::ffi::VaList<'2>`
LL | *ap0 = ap1;
| ^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
error: lifetime may not live long enough
--> $DIR/variadic-ffi-5.rs:27:5
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) {
| ------- ------- has type `core::ffi::VaList<'2>`
| |
| has type `&mut core::ffi::VaList<'1>`
LL | ap0 = &mut ap1;
| ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
error: lifetime may not live long enough
--> $DIR/variadic-ffi-5.rs:27:5
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) {
| ------- ------- has type `core::ffi::VaList<'1>`
| |
| has type `&mut core::ffi::VaList<'2>`
LL | ap0 = &mut ap1;
| ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
error[E0597]: `ap1` does not live long enough
--> $DIR/variadic-ffi-5.rs:27:11
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) {
| - let's call the lifetime of this reference `'1`
LL | ap0 = &mut ap1;
| ------^^^^^^^^
| | |
| | borrowed value does not live long enough
| assignment requires that `ap1` is borrowed for `'1`
...
LL | }
| - `ap1` dropped here while still borrowed
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0597, E0621.
For more information about an error, try `rustc --explain E0597`.

View File

@ -1,7 +1,5 @@
// compile-pass
#![feature(nll)]
pub fn main() {
let y: &'static mut [u8; 0] = &mut [];
}

View File

@ -1,5 +1,3 @@
#![feature(nll)]
const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); //~ ERROR temporary value dropped while borrowed
use std::borrow::Cow;

View File

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/issue-54224.rs:3:39
--> $DIR/issue-54224.rs:1:39
|
LL | const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]);
| ------^^^^^^^^^-
@ -9,7 +9,7 @@ LL | const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]);
| using this value as a constant requires that borrow lasts for `'static`
error[E0716]: temporary value dropped while borrowed
--> $DIR/issue-54224.rs:11:57
--> $DIR/issue-54224.rs:9:57
|
LL | pub const Z: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[*b"ABC"]);
| ---------------^^^^^^^^^-

View File

@ -1,7 +1,5 @@
//compile-pass
#![feature(nll)]
fn main() {
let _: &'static usize = &(loop {}, 1).1;

View File

@ -1,8 +1,6 @@
// compile-pass
// aux-build:promotable_const_fn_lib.rs
#![feature(nll)]
extern crate promotable_const_fn_lib;
use promotable_const_fn_lib::{foo, Foo};

View File

@ -1,7 +1,5 @@
// compile-pass
#![feature(nll)]
fn main() {
let x: &'static u8 = &u8::max_value();
let x: &'static u16 = &u16::max_value();

View File

@ -1,8 +1,4 @@
// revisions: migrate nll
// ignore-compare-mode-nll
#![feature(generators, generator_trait)]
#![cfg_attr(nll, feature(nll))]
use std::ops::{Generator, GeneratorState};
use std::pin::Pin;
@ -14,8 +10,7 @@ fn dangle(x: &mut i32) -> &'static mut i32 {
loop {
match Pin::new(&mut g).resume() {
GeneratorState::Complete(c) => return c,
//[nll]~^ ERROR explicit lifetime required
//[migrate]~^^ ERROR explicit lifetime required
//~^ ERROR explicit lifetime required
GeneratorState::Yielded(_) => (),
}
}

View File

@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/generator-region-requirements.rs:16:51
--> $DIR/generator-region-requirements.rs:12:51
|
LL | fn dangle(x: &mut i32) -> &'static mut i32 {
| -------- help: add explicit lifetime `'static` to the type of `x`: `&'static mut i32`

View File

@ -1,5 +1,4 @@
#![feature(generators)]
#![feature(nll)]
fn main() {
|| {

View File

@ -1,5 +1,5 @@
error[E0626]: borrow may still be in use when generator yields
--> $DIR/generator-with-nll.rs:8:17
--> $DIR/generator-with-nll.rs:7:17
|
LL | let b = &mut true;
| ^^^^^^^^^

View File

@ -1,5 +1,3 @@
#![feature(nll)]
// Regression test for #54593: the MIR type checker was going wrong
// when a closure returns the `impl Copy` from its parent fn. It was
// (incorrectly) replacing the `impl Copy` in its return type with the

View File

@ -9,7 +9,6 @@
#![allow(dead_code)]
#![feature(in_band_lifetimes)]
#![feature(nll)]
fn foo(x: &'x u32) -> impl Fn() -> &'y u32
where 'x: 'y

View File

@ -9,7 +9,6 @@
#![allow(dead_code)]
#![feature(in_band_lifetimes)]
#![feature(nll)]
trait Trait<'a> { }

View File

@ -5,7 +5,6 @@
#![allow(dead_code)]
#![feature(in_band_lifetimes)]
#![feature(nll)]
use std::cell::Cell;

View File

@ -1,11 +1,11 @@
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> $DIR/region-escape-via-bound.rs:16:29
--> $DIR/region-escape-via-bound.rs:15:29
|
LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
| ^^^^^^^^^^^^^^
|
note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 18:7
--> $DIR/region-escape-via-bound.rs:18:7
note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 17:7
--> $DIR/region-escape-via-bound.rs:17:7
|
LL | where 'x: 'y
| ^^

View File

@ -1,5 +1,3 @@
#![feature(nll)]
pub trait Foo {
fn zero(self) -> Self;
}

View File

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `x`
--> $DIR/issue-34721.rs:27:9
--> $DIR/issue-34721.rs:25:9
|
LL | pub fn baz<T: Foo>(x: T) -> T {
| - - move occurs because `x` has type `T`, which does not implement the `Copy` trait

View File

@ -6,11 +6,6 @@
// We will explicitly test NLL, and migration modes; thus we will also skip the
// automated compare-mode=nll.
// revisions: nll migrate
// ignore-compare-mode-nll
#![cfg_attr(nll, feature(nll))]
// run-pass
// This test has structs and functions that are by definition unusable

View File

@ -1,6 +1,5 @@
// Issue 46036: [NLL] false edges on infinite loops
// Infinite loops should create false edges to the cleanup block.
#![feature(nll)]
struct Foo { x: &'static u32 }

View File

@ -1,5 +1,5 @@
error[E0597]: `a` does not live long enough
--> $DIR/issue-46036.rs:9:24
--> $DIR/issue-46036.rs:8:24
|
LL | let foo = Foo { x: &a };
| ^^

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn foo(x: &u32) -> &'static u32 {
&*x
//~^ ERROR explicit lifetime required in the type of `x` [E0621]

View File

@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/issue-46983.rs:4:5
--> $DIR/issue-46983.rs:2:5
|
LL | fn foo(x: &u32) -> &'static u32 {
| ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn main() {
let _vec: Vec<&'static String> = vec![&String::new()];
//~^ ERROR temporary value dropped while borrowed [E0716]

View File

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/issue-47184.rs:4:44
--> $DIR/issue-47184.rs:2:44
|
LL | let _vec: Vec<&'static String> = vec![&String::new()];
| -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement

View File

@ -1,6 +1,3 @@
#![allow(warnings)]
#![feature(nll)]
use std::collections::BinaryHeap;
fn main() {

View File

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as mutable
--> $DIR/issue-47646.rs:12:30
--> $DIR/issue-47646.rs:9:30
|
LL | let borrow = heap.peek_mut();
| ---- mutable borrow occurs here

View File

@ -1,6 +1,4 @@
// compile-pass
#![allow(dead_code)]
#![feature(nll)]
struct AtomicRefMut<'a> {
value: &'a mut i32,

View File

@ -1,6 +1,4 @@
// compile-pass
#![allow(dead_code)]
#![feature(nll)]
struct WithDrop;

View File

@ -1,6 +1,4 @@
// compile-pass
#![allow(dead_code)]
#![feature(nll)]
struct MyStruct<'a> {
field: &'a mut (),

View File

@ -1,10 +1,8 @@
// compile-pass
#![allow(dead_code)]
// Tests that automatic coercions from &mut T to *mut T
// allow borrows of T to expire immediately - essentially, that
// they work identically to 'foo as *mut T'
#![feature(nll)]
struct SelfReference {
self_reference: *mut SelfReference,

View File

@ -1,9 +1,6 @@
// compile-pass
#![allow(dead_code)]
#![allow(non_upper_case_globals)]
#![feature(nll)]
static mut x: &'static u32 = &0;
fn foo() {

View File

@ -3,9 +3,6 @@
// run-pass
#![feature(nll)]
#![allow(warnings)]
struct Inner<I, V> {
iterator: I,
item: V,

View File

@ -3,9 +3,6 @@
// run-pass
#![feature(nll)]
#![allow(warnings)]
pub struct Container<T: Iterator> {
value: Option<T::Item>,
}

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn flatten<'a, 'b, T>(x: &'a &'b T) -> &'a T {
x
}

View File

@ -1,5 +1,5 @@
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/issue-48803.rs:12:5
--> $DIR/issue-48803.rs:10:5
|
LL | let y = &x;
| -- borrow of `x` occurs here

View File

@ -1,8 +1,6 @@
// compile-pass
// ignore-emscripten no i128 support
#![feature(nll)]
fn fibs(n: u32) -> impl Iterator<Item=u128> {
(0 .. n)
.scan((0, 1), |st, _| {

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn main() {
let foo = &16;
//~^ HELP consider changing this to be a mutable reference

View File

@ -1,5 +1,5 @@
error[E0594]: cannot assign to `*foo` which is behind a `&` reference
--> $DIR/issue-51515.rs:7:5
--> $DIR/issue-51515.rs:5:5
|
LL | let foo = &16;
| --- help: consider changing this to be a mutable reference: `&mut 16`
@ -8,7 +8,7 @@ LL | *foo = 32;
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
error[E0594]: cannot assign to `*bar` which is behind a `&` reference
--> $DIR/issue-51515.rs:12:5
--> $DIR/issue-51515.rs:10:5
|
LL | let bar = foo;
| --- help: consider changing this to be a mutable reference: `&mut i32`

View File

@ -4,8 +4,6 @@
//
// run-pass
#![feature(nll)]
pub trait Parser {
type Input;

View File

@ -4,8 +4,6 @@
//
// compile-pass
#![feature(nll)]
fn main() {}
fn fail<'a>() -> Struct<'a, Generic<()>> {

View File

@ -3,9 +3,6 @@
//
// compile-pass
#![feature(nll)]
#![allow(dead_code)]
trait Future {
type Item;
}

View File

@ -1,5 +1,3 @@
#![feature(nll)]
// This test is a minimal version of an ICE in the dropck-eyepatch tests
// found in the fix for #54943.

View File

@ -1,5 +1,3 @@
#![feature(nll)]
// This test is a minimal version of an ICE in the dropck-eyepatch tests
// found in the fix for #54943. In particular, this test is in unreachable
// code as the initial fix for this ICE only worked if the code was reachable.

View File

@ -0,0 +1,11 @@
error: lifetime may not live long enough
--> $DIR/issue-54943.rs:6:13
|
LL | fn boo<'a>() {
| -- lifetime `'a` defined here
...
LL | let x = foo::<&'a u32>();
| ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
error: aborting due to previous error

View File

@ -1,13 +1,10 @@
#![feature(nll)]
#![allow(warnings)]
fn foo<T: 'static>() { }
fn boo<'a>() {
return;
let x = foo::<&'a u32>();
//~^ ERROR lifetime may not live long enough
//~^ ERROR
}
fn main() {}

View File

@ -1,11 +1,10 @@
error: lifetime may not live long enough
--> $DIR/issue-54943.rs:9:13
error[E0477]: the type `&'a u32` does not fulfill the required lifetime
--> $DIR/issue-54943.rs:6:13
|
LL | fn boo<'a>() {
| -- lifetime `'a` defined here
...
LL | let x = foo::<&'a u32>();
| ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
| ^^^^^^^^^^^^^^
|
= note: type must satisfy the static lifetime
error: aborting due to previous error

View File

@ -1,6 +1,5 @@
// General test of maybe_uninits state computed by MIR dataflow.
#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;

View File

@ -1,23 +1,23 @@
error: rustc_peek: bit not set
--> $DIR/def-inits-1.rs:15:14
--> $DIR/def-inits-1.rs:14:14
|
LL | unsafe { rustc_peek(&ret); }
| ^^^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/def-inits-1.rs:31:14
--> $DIR/def-inits-1.rs:30:14
|
LL | unsafe { rustc_peek(&z); }
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/def-inits-1.rs:34:14
--> $DIR/def-inits-1.rs:33:14
|
LL | unsafe { rustc_peek(&y); }
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/def-inits-1.rs:42:14
--> $DIR/def-inits-1.rs:41:14
|
LL | unsafe { rustc_peek(&x); }
| ^^^^^^^^^^^^^^

View File

@ -1,6 +1,5 @@
// General test of maybe_inits state computed by MIR dataflow.
#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;

View File

@ -1,17 +1,17 @@
error: rustc_peek: bit not set
--> $DIR/inits-1.rs:15:14
--> $DIR/inits-1.rs:14:14
|
LL | unsafe { rustc_peek(&ret); }
| ^^^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/inits-1.rs:35:14
--> $DIR/inits-1.rs:34:14
|
LL | unsafe { rustc_peek(&y); }
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/inits-1.rs:43:14
--> $DIR/inits-1.rs:42:14
|
LL | unsafe { rustc_peek(&x); }
| ^^^^^^^^^^^^^^

View File

@ -1,6 +1,5 @@
// General test of maybe_uninits state computed by MIR dataflow.
#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;

View File

@ -1,29 +1,29 @@
error: rustc_peek: bit not set
--> $DIR/uninits-1.rs:19:14
--> $DIR/uninits-1.rs:18:14
|
LL | unsafe { rustc_peek(&x) };
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/uninits-1.rs:20:14
--> $DIR/uninits-1.rs:19:14
|
LL | unsafe { rustc_peek(&y) };
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/uninits-1.rs:21:14
--> $DIR/uninits-1.rs:20:14
|
LL | unsafe { rustc_peek(&z) };
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/uninits-1.rs:37:14
--> $DIR/uninits-1.rs:36:14
|
LL | unsafe { rustc_peek(&x); }
| ^^^^^^^^^^^^^^
error: rustc_peek: bit not set
--> $DIR/uninits-1.rs:45:14
--> $DIR/uninits-1.rs:44:14
|
LL | unsafe { rustc_peek(&ret); }
| ^^^^^^^^^^^^^^^^

View File

@ -1,6 +1,5 @@
// General test of maybe_uninits state computed by MIR dataflow.
#![feature(nll)]
#![feature(core_intrinsics, rustc_attrs)]
use std::intrinsics::rustc_peek;

View File

@ -1,5 +1,5 @@
error: rustc_peek: bit not set
--> $DIR/uninits-2.rs:15:14
--> $DIR/uninits-2.rs:14:14
|
LL | unsafe { rustc_peek(&x) };
| ^^^^^^^^^^^^^^

View File

@ -1,5 +1,3 @@
#![feature(nll)]
// run-pass
fn vec() {

View File

@ -3,7 +3,6 @@
//
// FIXME(#54366) - We probably shouldn't allow #[thread_local] static mut to get a 'static lifetime.
#![feature(nll)]
#![feature(thread_local)]
#[thread_local]

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}

View File

@ -1,5 +1,5 @@
error[E0597]: `v` does not live long enough
--> $DIR/borrowed-local-error.rs:10:9
--> $DIR/borrowed-local-error.rs:8:9
|
LL | let x = gimme({
| ----- borrow later used by call

View File

@ -1,7 +1,6 @@
// Regression test for issue #38899
#![feature(nll)]
#![allow(dead_code)]
pub struct Block<'a> {
current: &'a u8,

View File

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
--> $DIR/borrowed-referent-issue-38899.rs:14:21
--> $DIR/borrowed-referent-issue-38899.rs:13:21
|
LL | let x = &mut block;
| ---------- mutable borrow occurs here

View File

@ -1,5 +1,3 @@
#![feature(nll)]
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}

View File

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/borrowed-temporary-error.rs:10:10
--> $DIR/borrowed-temporary-error.rs:8:10
|
LL | &(v,)
| ^^^^ creates a temporary which is freed while still in use

View File

@ -1,6 +1,3 @@
#![feature(nll)]
#![allow(warnings)]
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
let v = 22;
&v

View File

@ -1,5 +1,5 @@
error[E0515]: cannot return reference to local variable `v`
--> $DIR/borrowed-universal-error-2.rs:6:5
--> $DIR/borrowed-universal-error-2.rs:3:5
|
LL | &v
| ^^ returns a reference to data owned by the current function

View File

@ -1,6 +1,3 @@
#![feature(nll)]
#![allow(warnings)]
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}

Some files were not shown because too many files have changed in this diff Show More