Remove feature(nll) when compare mode is sufficient
This commit is contained in:
parent
ff71b80a85
commit
be5fe051a8
301 changed files with 774 additions and 1029 deletions
|
@ -13,7 +13,6 @@
|
||||||
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
|
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
|
||||||
|
|
||||||
#![feature(never_type)]
|
#![feature(never_type)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Entity {
|
pub struct Entity {
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
// ignore-wasm32-bare
|
// ignore-wasm32-bare
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
|
fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
|
||||||
match x {
|
match x {
|
||||||
Some(0) if c => 0,
|
Some(0) if c => 0,
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// error-pattern: thread 'main' panicked at 'explicit panic'
|
// error-pattern: thread 'main' panicked at 'explicit panic'
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut vec = vec![];
|
let mut vec = vec![];
|
||||||
vec.push((vec.len(), panic!()));
|
vec.push((vec.len(), panic!()));
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
// Test case from #39963.
|
// Test case from #39963.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);
|
struct Foo(Option<Box<Foo>>, Option<Box<Foo>>);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
#![feature(nll)]
|
|
||||||
#![deny(unused_mut)]
|
#![deny(unused_mut)]
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
// revisions: lxl nll
|
|
||||||
|
|
||||||
#![cfg_attr(nll, feature(nll))]
|
|
||||||
|
|
||||||
use std::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign};
|
use std::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign};
|
||||||
use std::ops::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};
|
use std::ops::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
// See further discussion on rust-lang/rust#24535,
|
// See further discussion on rust-lang/rust#24535,
|
||||||
// rust-lang/rfcs#1006, and rust-lang/rfcs#107
|
// rust-lang/rfcs#1006, and rust-lang/rfcs#107
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(bind_by_move_pattern_guards)]
|
#![feature(bind_by_move_pattern_guards)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
// Test that we are able to reinitialize box with moved referent
|
// Test that we are able to reinitialize box with moved referent
|
||||||
#![feature(nll)]
|
|
||||||
static mut ORDER: [usize; 3] = [0, 0, 0];
|
static mut ORDER: [usize; 3] = [0, 0, 0];
|
||||||
static mut INDEX: usize = 0;
|
static mut INDEX: usize = 0;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
#![allow(unreachable_code)]
|
#![allow(unreachable_code)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut v = Vec::new();
|
let mut v = Vec::new();
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// Regression test for #47153: constants in a generic context (such as
|
// Regression test for #47153: constants in a generic context (such as
|
||||||
// a trait) used to ICE.
|
// a trait) used to ICE.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
#![allow(warnings)]
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
pub struct DescriptorSet<'a> {
|
pub struct DescriptorSet<'a> {
|
||||||
pub slots: Vec<AttachInfo<'a, Resources>>
|
pub slots: Vec<AttachInfo<'a, Resources>>
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#![allow(path_statements)]
|
#![allow(path_statements)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct WithDrop;
|
struct WithDrop;
|
||||||
|
|
||||||
impl Drop for WithDrop {
|
impl Drop for WithDrop {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#![allow(path_statements)]
|
#![allow(path_statements)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(generators, generator_trait)]
|
#![feature(generators, generator_trait)]
|
||||||
|
|
||||||
struct WithDrop;
|
struct WithDrop;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![deny(unused_mut)]
|
#![deny(unused_mut)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![deny(unused_mut)]
|
#![deny(unused_mut)]
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
pub trait TryTransform {
|
pub trait TryTransform {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct List<T> {
|
struct List<T> {
|
||||||
value: T,
|
value: T,
|
||||||
next: Option<Box<List<T>>>,
|
next: Option<Box<List<T>>>,
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
fn process_or_insert_default(map: &mut HashMap<usize, String>, key: usize) {
|
fn process_or_insert_default(map: &mut HashMap<usize, String>, key: usize) {
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
// `x`. The lexical checker makes this very painful. The NLL checker
|
// `x`. The lexical checker makes this very painful. The NLL checker
|
||||||
// does not.
|
// does not.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct Node {
|
struct Node {
|
||||||
elem: i32,
|
elem: i32,
|
||||||
next: Option<Box<Node>>,
|
next: Option<Box<Node>>,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0382]: use of moved value: `src`
|
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;
|
LL | let mut src = &mut node;
|
||||||
| ------- move occurs because `src` has type `&mut Node`, which does not implement the `Copy` trait
|
| ------- 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
|
| ^^^^^^^^ value used here after move
|
||||||
|
|
||||||
error[E0382]: use of moved value: `src`
|
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);
|
LL | let mut src = &mut (22, 44);
|
||||||
| ------- move occurs because `src` has type `&mut (i32, i32)`, which does not implement the `Copy` trait
|
| ------- move occurs because `src` has type `&mut (i32, i32)`, which does not implement the `Copy` trait
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
enum Nat {
|
enum Nat {
|
||||||
S(Box<Nat>),
|
S(Box<Nat>),
|
||||||
Z
|
Z
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn foo(x: &mut Result<(u32, u32), (u32, u32)>) -> u32 {
|
fn foo(x: &mut Result<(u32, u32), (u32, u32)>) -> u32 {
|
||||||
match *x {
|
match *x {
|
||||||
Ok((ref mut v, _)) | Err((_, ref mut v)) if *v > 0 => { *v }
|
Ok((ref mut v, _)) | Err((_, ref mut v)) if *v > 0 => { *v }
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
// computing liveness that wound up accidentally causing the program
|
// computing liveness that wound up accidentally causing the program
|
||||||
// below to be accepted.
|
// below to be accepted.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn foo<'a>(x: &'a mut u32) -> u32 {
|
fn foo<'a>(x: &'a mut u32) -> u32 {
|
||||||
let mut x = 22;
|
let mut x = 22;
|
||||||
let y = &x;
|
let y = &x;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0506]: cannot assign to `x` because it is borrowed
|
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;
|
LL | let y = &x;
|
||||||
| -- borrow of `x` occurs here
|
| -- borrow of `x` occurs here
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0507]: cannot move out of borrowed content
|
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
|
LL | *array
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
@ -1,19 +1,11 @@
|
||||||
// ignore-compare-mode-nll
|
|
||||||
|
|
||||||
// revisions: migrate nll
|
|
||||||
|
|
||||||
#![cfg_attr(nll, feature(nll))]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut greeting = "Hello world!".to_string();
|
let mut greeting = "Hello world!".to_string();
|
||||||
let res = (|| (|| &greeting)())();
|
let res = (|| (|| &greeting)())();
|
||||||
|
|
||||||
greeting = "DEALLOCATED".to_string();
|
greeting = "DEALLOCATED".to_string();
|
||||||
//[migrate]~^ ERROR cannot assign
|
//~^ ERROR cannot assign
|
||||||
//[nll]~^^ ERROR cannot assign
|
|
||||||
drop(greeting);
|
drop(greeting);
|
||||||
//[migrate]~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
//[nll]~^^ ERROR cannot move
|
|
||||||
|
|
||||||
println!("thread result: {:?}", res);
|
println!("thread result: {:?}", res);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0506]: cannot assign to `greeting` because it is borrowed
|
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)())();
|
LL | let res = (|| (|| &greeting)())();
|
||||||
| -- -------- borrow occurs due to use in closure
|
| -- -------- borrow occurs due to use in closure
|
||||||
|
@ -13,7 +13,7 @@ LL | println!("thread result: {:?}", res);
|
||||||
| --- borrow later used here
|
| --- borrow later used here
|
||||||
|
|
||||||
error[E0505]: cannot move out of `greeting` because it is borrowed
|
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)())();
|
LL | let res = (|| (|| &greeting)())();
|
||||||
| -- -------- borrow occurs due to use in closure
|
| -- -------- borrow occurs due to use in closure
|
|
@ -1,8 +1,6 @@
|
||||||
// Test that a borrow which starts as a 2-phase borrow and gets
|
// Test that a borrow which starts as a 2-phase borrow and gets
|
||||||
// carried around a loop winds up conflicting with itself.
|
// carried around a loop winds up conflicting with itself.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct Foo { x: String }
|
struct Foo { x: String }
|
||||||
|
|
||||||
impl Foo {
|
impl Foo {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0499]: cannot borrow `foo` as mutable more than once at a time
|
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());
|
LL | strings.push(foo.get_string());
|
||||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0499]: cannot borrow `foo` as mutable more than once at a time
|
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);
|
LL | foo.method(&mut foo);
|
||||||
| ^^^^------^--------^
|
| ^^^^------^--------^
|
||||||
|
@ -9,7 +9,7 @@ LL | foo.method(&mut foo);
|
||||||
| second mutable borrow occurs here
|
| second mutable borrow occurs here
|
||||||
|
|
||||||
error[E0499]: cannot borrow `foo` as mutable more than once at a time
|
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);
|
LL | foo.method(&mut foo);
|
||||||
| --- ------ ^^^^^^^^ second mutable borrow occurs here
|
| --- ------ ^^^^^^^^ second mutable borrow occurs here
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
|
@ -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`.
|
|
|
@ -1,7 +1,5 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let y: &'static mut [u8; 0] = &mut [];
|
let y: &'static mut [u8; 0] = &mut [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); //~ ERROR temporary value dropped while borrowed
|
const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); //~ ERROR temporary value dropped while borrowed
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0716]: temporary value dropped while borrowed
|
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"]);
|
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`
|
| using this value as a constant requires that borrow lasts for `'static`
|
||||||
|
|
||||||
error[E0716]: temporary value dropped while borrowed
|
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"]);
|
LL | pub const Z: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[*b"ABC"]);
|
||||||
| ---------------^^^^^^^^^-
|
| ---------------^^^^^^^^^-
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
//compile-pass
|
//compile-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
let _: &'static usize = &(loop {}, 1).1;
|
let _: &'static usize = &(loop {}, 1).1;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
// aux-build:promotable_const_fn_lib.rs
|
// aux-build:promotable_const_fn_lib.rs
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
extern crate promotable_const_fn_lib;
|
extern crate promotable_const_fn_lib;
|
||||||
|
|
||||||
use promotable_const_fn_lib::{foo, Foo};
|
use promotable_const_fn_lib::{foo, Foo};
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: &'static u8 = &u8::max_value();
|
let x: &'static u8 = &u8::max_value();
|
||||||
let x: &'static u16 = &u16::max_value();
|
let x: &'static u16 = &u16::max_value();
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
// revisions: migrate nll
|
|
||||||
// ignore-compare-mode-nll
|
|
||||||
|
|
||||||
#![feature(generators, generator_trait)]
|
#![feature(generators, generator_trait)]
|
||||||
#![cfg_attr(nll, feature(nll))]
|
|
||||||
use std::ops::{Generator, GeneratorState};
|
use std::ops::{Generator, GeneratorState};
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
@ -14,8 +10,7 @@ fn dangle(x: &mut i32) -> &'static mut i32 {
|
||||||
loop {
|
loop {
|
||||||
match Pin::new(&mut g).resume() {
|
match Pin::new(&mut g).resume() {
|
||||||
GeneratorState::Complete(c) => return c,
|
GeneratorState::Complete(c) => return c,
|
||||||
//[nll]~^ ERROR explicit lifetime required
|
//~^ ERROR explicit lifetime required
|
||||||
//[migrate]~^^ ERROR explicit lifetime required
|
|
||||||
GeneratorState::Yielded(_) => (),
|
GeneratorState::Yielded(_) => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0621]: explicit lifetime required in the type of `x`
|
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 {
|
LL | fn dangle(x: &mut i32) -> &'static mut i32 {
|
||||||
| -------- help: add explicit lifetime `'static` to the type of `x`: `&'static mut i32`
|
| -------- help: add explicit lifetime `'static` to the type of `x`: `&'static mut i32`
|
|
@ -1,5 +1,4 @@
|
||||||
#![feature(generators)]
|
#![feature(generators)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|| {
|
|| {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0626]: borrow may still be in use when generator yields
|
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;
|
LL | let b = &mut true;
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
// Regression test for #54593: the MIR type checker was going wrong
|
// Regression test for #54593: the MIR type checker was going wrong
|
||||||
// when a closure returns the `impl Copy` from its parent fn. It was
|
// when a closure returns the `impl Copy` from its parent fn. It was
|
||||||
// (incorrectly) replacing the `impl Copy` in its return type with the
|
// (incorrectly) replacing the `impl Copy` in its return type with the
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![feature(in_band_lifetimes)]
|
#![feature(in_band_lifetimes)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn foo(x: &'x u32) -> impl Fn() -> &'y u32
|
fn foo(x: &'x u32) -> impl Fn() -> &'y u32
|
||||||
where 'x: 'y
|
where 'x: 'y
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![feature(in_band_lifetimes)]
|
#![feature(in_band_lifetimes)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
trait Trait<'a> { }
|
trait Trait<'a> { }
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![feature(in_band_lifetimes)]
|
#![feature(in_band_lifetimes)]
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
|
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>
|
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
|
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:18:7
|
--> $DIR/region-escape-via-bound.rs:17:7
|
||||||
|
|
|
|
||||||
LL | where 'x: 'y
|
LL | where 'x: 'y
|
||||||
| ^^
|
| ^^
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
fn zero(self) -> Self;
|
fn zero(self) -> Self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0382]: use of moved value: `x`
|
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 {
|
LL | pub fn baz<T: Foo>(x: T) -> T {
|
||||||
| - - move occurs because `x` has type `T`, which does not implement the `Copy` trait
|
| - - move occurs because `x` has type `T`, which does not implement the `Copy` trait
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
// We will explicitly test NLL, and migration modes; thus we will also skip the
|
// We will explicitly test NLL, and migration modes; thus we will also skip the
|
||||||
// automated compare-mode=nll.
|
// automated compare-mode=nll.
|
||||||
|
|
||||||
// revisions: nll migrate
|
|
||||||
// ignore-compare-mode-nll
|
|
||||||
|
|
||||||
#![cfg_attr(nll, feature(nll))]
|
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
// This test has structs and functions that are by definition unusable
|
// This test has structs and functions that are by definition unusable
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Issue 46036: [NLL] false edges on infinite loops
|
// Issue 46036: [NLL] false edges on infinite loops
|
||||||
// Infinite loops should create false edges to the cleanup block.
|
// Infinite loops should create false edges to the cleanup block.
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct Foo { x: &'static u32 }
|
struct Foo { x: &'static u32 }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0597]: `a` does not live long enough
|
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 };
|
LL | let foo = Foo { x: &a };
|
||||||
| ^^
|
| ^^
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn foo(x: &u32) -> &'static u32 {
|
fn foo(x: &u32) -> &'static u32 {
|
||||||
&*x
|
&*x
|
||||||
//~^ ERROR explicit lifetime required in the type of `x` [E0621]
|
//~^ ERROR explicit lifetime required in the type of `x` [E0621]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0621]: explicit lifetime required in the type of `x`
|
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 {
|
LL | fn foo(x: &u32) -> &'static u32 {
|
||||||
| ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`
|
| ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _vec: Vec<&'static String> = vec![&String::new()];
|
let _vec: Vec<&'static String> = vec![&String::new()];
|
||||||
//~^ ERROR temporary value dropped while borrowed [E0716]
|
//~^ ERROR temporary value dropped while borrowed [E0716]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0716]: temporary value dropped while borrowed
|
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()];
|
LL | let _vec: Vec<&'static String> = vec![&String::new()];
|
||||||
| -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
|
| -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#![allow(warnings)]
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
use std::collections::BinaryHeap;
|
use std::collections::BinaryHeap;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as mutable
|
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();
|
LL | let borrow = heap.peek_mut();
|
||||||
| ---- mutable borrow occurs here
|
| ---- mutable borrow occurs here
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
#![allow(dead_code)]
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct AtomicRefMut<'a> {
|
struct AtomicRefMut<'a> {
|
||||||
value: &'a mut i32,
|
value: &'a mut i32,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
#![allow(dead_code)]
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct WithDrop;
|
struct WithDrop;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
#![allow(dead_code)]
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct MyStruct<'a> {
|
struct MyStruct<'a> {
|
||||||
field: &'a mut (),
|
field: &'a mut (),
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
// Tests that automatic coercions from &mut T to *mut T
|
// Tests that automatic coercions from &mut T to *mut T
|
||||||
// allow borrows of T to expire immediately - essentially, that
|
// allow borrows of T to expire immediately - essentially, that
|
||||||
// they work identically to 'foo as *mut T'
|
// they work identically to 'foo as *mut T'
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
struct SelfReference {
|
struct SelfReference {
|
||||||
self_reference: *mut SelfReference,
|
self_reference: *mut SelfReference,
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
#![allow(dead_code)]
|
|
||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
static mut x: &'static u32 = &0;
|
static mut x: &'static u32 = &0;
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
|
||||||
|
|
||||||
struct Inner<I, V> {
|
struct Inner<I, V> {
|
||||||
iterator: I,
|
iterator: I,
|
||||||
item: V,
|
item: V,
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
|
||||||
|
|
||||||
pub struct Container<T: Iterator> {
|
pub struct Container<T: Iterator> {
|
||||||
value: Option<T::Item>,
|
value: Option<T::Item>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn flatten<'a, 'b, T>(x: &'a &'b T) -> &'a T {
|
fn flatten<'a, 'b, T>(x: &'a &'b T) -> &'a T {
|
||||||
x
|
x
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0506]: cannot assign to `x` because it is borrowed
|
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;
|
LL | let y = &x;
|
||||||
| -- borrow of `x` occurs here
|
| -- borrow of `x` occurs here
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// compile-pass
|
// compile-pass
|
||||||
// ignore-emscripten no i128 support
|
// ignore-emscripten no i128 support
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn fibs(n: u32) -> impl Iterator<Item=u128> {
|
fn fibs(n: u32) -> impl Iterator<Item=u128> {
|
||||||
(0 .. n)
|
(0 .. n)
|
||||||
.scan((0, 1), |st, _| {
|
.scan((0, 1), |st, _| {
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let foo = &16;
|
let foo = &16;
|
||||||
//~^ HELP consider changing this to be a mutable reference
|
//~^ HELP consider changing this to be a mutable reference
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0594]: cannot assign to `*foo` which is behind a `&` reference
|
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;
|
LL | let foo = &16;
|
||||||
| --- help: consider changing this to be a mutable reference: `&mut 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
|
| ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written
|
||||||
|
|
||||||
error[E0594]: cannot assign to `*bar` which is behind a `&` reference
|
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;
|
LL | let bar = foo;
|
||||||
| --- help: consider changing this to be a mutable reference: `&mut i32`
|
| --- help: consider changing this to be a mutable reference: `&mut i32`
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
//
|
//
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
pub trait Parser {
|
pub trait Parser {
|
||||||
type Input;
|
type Input;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
//
|
//
|
||||||
// compile-pass
|
// compile-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
||||||
fn fail<'a>() -> Struct<'a, Generic<()>> {
|
fn fail<'a>() -> Struct<'a, Generic<()>> {
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
//
|
//
|
||||||
// compile-pass
|
// compile-pass
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
trait Future {
|
trait Future {
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
// This test is a minimal version of an ICE in the dropck-eyepatch tests
|
// This test is a minimal version of an ICE in the dropck-eyepatch tests
|
||||||
// found in the fix for #54943.
|
// found in the fix for #54943.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
// This test is a minimal version of an ICE in the dropck-eyepatch tests
|
// 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
|
// 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.
|
// code as the initial fix for this ICE only worked if the code was reachable.
|
||||||
|
|
11
src/test/ui/issues/issue-54943.nll.stderr
Normal file
11
src/test/ui/issues/issue-54943.nll.stderr
Normal 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
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
|
||||||
|
|
||||||
fn foo<T: 'static>() { }
|
fn foo<T: 'static>() { }
|
||||||
|
|
||||||
fn boo<'a>() {
|
fn boo<'a>() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let x = foo::<&'a u32>();
|
let x = foo::<&'a u32>();
|
||||||
//~^ ERROR lifetime may not live long enough
|
//~^ ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
error: lifetime may not live long enough
|
error[E0477]: the type `&'a u32` does not fulfill the required lifetime
|
||||||
--> $DIR/issue-54943.rs:9:13
|
--> $DIR/issue-54943.rs:6:13
|
||||||
|
|
|
|
||||||
LL | fn boo<'a>() {
|
|
||||||
| -- lifetime `'a` defined here
|
|
||||||
...
|
|
||||||
LL | let x = foo::<&'a u32>();
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// General test of maybe_uninits state computed by MIR dataflow.
|
// General test of maybe_uninits state computed by MIR dataflow.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(core_intrinsics, rustc_attrs)]
|
#![feature(core_intrinsics, rustc_attrs)]
|
||||||
|
|
||||||
use std::intrinsics::rustc_peek;
|
use std::intrinsics::rustc_peek;
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
error: rustc_peek: bit not set
|
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); }
|
LL | unsafe { rustc_peek(&ret); }
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
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); }
|
LL | unsafe { rustc_peek(&z); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
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); }
|
LL | unsafe { rustc_peek(&y); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
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); }
|
LL | unsafe { rustc_peek(&x); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// General test of maybe_inits state computed by MIR dataflow.
|
// General test of maybe_inits state computed by MIR dataflow.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(core_intrinsics, rustc_attrs)]
|
#![feature(core_intrinsics, rustc_attrs)]
|
||||||
|
|
||||||
use std::intrinsics::rustc_peek;
|
use std::intrinsics::rustc_peek;
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/inits-1.rs:15:14
|
--> $DIR/inits-1.rs:14:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&ret); }
|
LL | unsafe { rustc_peek(&ret); }
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/inits-1.rs:35:14
|
--> $DIR/inits-1.rs:34:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&y); }
|
LL | unsafe { rustc_peek(&y); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/inits-1.rs:43:14
|
--> $DIR/inits-1.rs:42:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&x); }
|
LL | unsafe { rustc_peek(&x); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// General test of maybe_uninits state computed by MIR dataflow.
|
// General test of maybe_uninits state computed by MIR dataflow.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(core_intrinsics, rustc_attrs)]
|
#![feature(core_intrinsics, rustc_attrs)]
|
||||||
|
|
||||||
use std::intrinsics::rustc_peek;
|
use std::intrinsics::rustc_peek;
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-1.rs:19:14
|
--> $DIR/uninits-1.rs:18:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&x) };
|
LL | unsafe { rustc_peek(&x) };
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-1.rs:20:14
|
--> $DIR/uninits-1.rs:19:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&y) };
|
LL | unsafe { rustc_peek(&y) };
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-1.rs:21:14
|
--> $DIR/uninits-1.rs:20:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&z) };
|
LL | unsafe { rustc_peek(&z) };
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-1.rs:37:14
|
--> $DIR/uninits-1.rs:36:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&x); }
|
LL | unsafe { rustc_peek(&x); }
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-1.rs:45:14
|
--> $DIR/uninits-1.rs:44:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&ret); }
|
LL | unsafe { rustc_peek(&ret); }
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// General test of maybe_uninits state computed by MIR dataflow.
|
// General test of maybe_uninits state computed by MIR dataflow.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(core_intrinsics, rustc_attrs)]
|
#![feature(core_intrinsics, rustc_attrs)]
|
||||||
|
|
||||||
use std::intrinsics::rustc_peek;
|
use std::intrinsics::rustc_peek;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error: rustc_peek: bit not set
|
error: rustc_peek: bit not set
|
||||||
--> $DIR/uninits-2.rs:15:14
|
--> $DIR/uninits-2.rs:14:14
|
||||||
|
|
|
|
||||||
LL | unsafe { rustc_peek(&x) };
|
LL | unsafe { rustc_peek(&x) };
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
|
|
||||||
fn vec() {
|
fn vec() {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
//
|
//
|
||||||
// FIXME(#54366) - We probably shouldn't allow #[thread_local] static mut to get a 'static lifetime.
|
// FIXME(#54366) - We probably shouldn't allow #[thread_local] static mut to get a 'static lifetime.
|
||||||
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(thread_local)]
|
#![feature(thread_local)]
|
||||||
|
|
||||||
#[thread_local]
|
#[thread_local]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn gimme(x: &(u32,)) -> &u32 {
|
fn gimme(x: &(u32,)) -> &u32 {
|
||||||
&x.0
|
&x.0
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0597]: `v` does not live long enough
|
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({
|
LL | let x = gimme({
|
||||||
| ----- borrow later used by call
|
| ----- borrow later used by call
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Regression test for issue #38899
|
// Regression test for issue #38899
|
||||||
|
|
||||||
#![feature(nll)]
|
#![feature(nll)]
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
pub struct Block<'a> {
|
pub struct Block<'a> {
|
||||||
current: &'a u8,
|
current: &'a u8,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable
|
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;
|
LL | let x = &mut block;
|
||||||
| ---------- mutable borrow occurs here
|
| ---------- mutable borrow occurs here
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
|
|
||||||
fn gimme(x: &(u32,)) -> &u32 {
|
fn gimme(x: &(u32,)) -> &u32 {
|
||||||
&x.0
|
&x.0
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0716]: temporary value dropped while borrowed
|
error[E0716]: temporary value dropped while borrowed
|
||||||
--> $DIR/borrowed-temporary-error.rs:10:10
|
--> $DIR/borrowed-temporary-error.rs:8:10
|
||||||
|
|
|
|
||||||
LL | &(v,)
|
LL | &(v,)
|
||||||
| ^^^^ creates a temporary which is freed while still in use
|
| ^^^^ creates a temporary which is freed while still in use
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
|
||||||
|
|
||||||
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
|
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
|
||||||
let v = 22;
|
let v = 22;
|
||||||
&v
|
&v
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0515]: cannot return reference to local variable `v`
|
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
|
LL | &v
|
||||||
| ^^ returns a reference to data owned by the current function
|
| ^^ returns a reference to data owned by the current function
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#![feature(nll)]
|
|
||||||
#![allow(warnings)]
|
|
||||||
|
|
||||||
fn gimme(x: &(u32,)) -> &u32 {
|
fn gimme(x: &(u32,)) -> &u32 {
|
||||||
&x.0
|
&x.0
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue