Gate 2018 UI tests

This commit is contained in:
Christian Poveda 2025-09-05 14:54:43 -05:00
parent b2ab7cf980
commit 7ae2823bc6
No known key found for this signature in database
GPG key ID: 3B422F347D81A9E8
252 changed files with 965 additions and 797 deletions

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn empty() {}
fn one_arg<T>(_a: T) {}
fn two_arg_same(_a: i32, _b: i32) {}

View file

@ -1,11 +1,11 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/extra_arguments.rs:19:3
--> $DIR/extra_arguments.rs:20:3
|
LL | empty("");
| ^^^^^ -- unexpected argument of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
@ -16,7 +16,7 @@ LL + empty();
|
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:20:3
--> $DIR/extra_arguments.rs:21:3
|
LL | empty(1, 1);
| ^^^^^ - - unexpected argument #2 of type `{integer}`
@ -24,7 +24,7 @@ LL | empty(1, 1);
| unexpected argument #1 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
@ -35,13 +35,13 @@ LL + empty();
|
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:22:3
--> $DIR/extra_arguments.rs:23:3
|
LL | one_arg(1, 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -52,13 +52,13 @@ LL + one_arg(1);
|
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:23:3
--> $DIR/extra_arguments.rs:24:3
|
LL | one_arg(1, "");
| ^^^^^^^ -- unexpected argument #2 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -69,7 +69,7 @@ LL + one_arg(1);
|
error[E0061]: this function takes 1 argument but 3 arguments were supplied
--> $DIR/extra_arguments.rs:24:3
--> $DIR/extra_arguments.rs:25:3
|
LL | one_arg(1, "", 1.0);
| ^^^^^^^ -- --- unexpected argument #3 of type `{float}`
@ -77,7 +77,7 @@ LL | one_arg(1, "", 1.0);
| unexpected argument #2 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -88,13 +88,13 @@ LL + one_arg(1);
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:26:3
--> $DIR/extra_arguments.rs:27:3
|
LL | two_arg_same(1, 1, 1);
| ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
@ -105,13 +105,13 @@ LL + two_arg_same(1, 1);
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:27:3
--> $DIR/extra_arguments.rs:28:3
|
LL | two_arg_same(1, 1, 1.0);
| ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
@ -122,13 +122,13 @@ LL + two_arg_same(1, 1);
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:29:3
--> $DIR/extra_arguments.rs:30:3
|
LL | two_arg_diff(1, 1, "");
| ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -139,13 +139,13 @@ LL + two_arg_diff(1, "");
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:30:3
--> $DIR/extra_arguments.rs:31:3
|
LL | two_arg_diff(1, "", "");
| ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -156,7 +156,7 @@ LL + two_arg_diff(1, "");
|
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:31:3
--> $DIR/extra_arguments.rs:32:3
|
LL | two_arg_diff(1, 1, "", "");
| ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str`
@ -164,7 +164,7 @@ LL | two_arg_diff(1, 1, "", "");
| unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -175,7 +175,7 @@ LL + two_arg_diff(1, "");
|
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:32:3
--> $DIR/extra_arguments.rs:33:3
|
LL | two_arg_diff(1, "", 1, "");
| ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str`
@ -183,7 +183,7 @@ LL | two_arg_diff(1, "", 1, "");
| unexpected argument #3 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -194,13 +194,13 @@ LL + two_arg_diff(1, "");
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:35:3
--> $DIR/extra_arguments.rs:36:3
|
LL | two_arg_same(1, 1, "");
| ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
@ -211,13 +211,13 @@ LL + two_arg_same(1, 1);
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:36:3
--> $DIR/extra_arguments.rs:37:3
|
LL | two_arg_diff(1, 1, "");
| ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -228,7 +228,7 @@ LL + two_arg_diff(1, "");
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:37:3
--> $DIR/extra_arguments.rs:38:3
|
LL | two_arg_same(
| ^^^^^^^^^^^^
@ -237,7 +237,7 @@ LL | ""
| -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
@ -249,7 +249,7 @@ LL + 1
|
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:43:3
--> $DIR/extra_arguments.rs:44:3
|
LL | two_arg_diff(
| ^^^^^^^^^^^^
@ -258,7 +258,7 @@ LL | 1,
| - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
@ -268,7 +268,7 @@ LL - 1,
|
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:8:9
--> $DIR/extra_arguments.rs:9:9
|
LL | empty($x, 1);
| ^^^^^ - unexpected argument #2 of type `{integer}`
@ -280,14 +280,14 @@ LL | foo!(1, ~);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:14:9
--> $DIR/extra_arguments.rs:15:9
|
LL | empty(1, $y);
| ^^^^^ - unexpected argument #1 of type `{integer}`
@ -299,14 +299,14 @@ LL | foo!(~, 1);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:11:9
--> $DIR/extra_arguments.rs:12:9
|
LL | empty($x, $y);
| ^^^^^
@ -319,20 +319,20 @@ LL | foo!(1, 1);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:53:3
--> $DIR/extra_arguments.rs:54:3
|
LL | one_arg(1, panic!());
| ^^^^^^^ -------- unexpected argument #2
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -343,13 +343,13 @@ LL + one_arg(1);
|
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:54:3
--> $DIR/extra_arguments.rs:55:3
|
LL | one_arg(panic!(), 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -360,13 +360,13 @@ LL + one_arg(panic!());
|
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:55:3
--> $DIR/extra_arguments.rs:56:3
|
LL | one_arg(stringify!($e), 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
@ -377,13 +377,13 @@ LL + one_arg(stringify!($e));
|
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:60:3
--> $DIR/extra_arguments.rs:61:3
|
LL | one_arg(for _ in 1.. {}, 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-pass
#![allow(dead_code, unreachable_patterns)]
#![allow(ellipsis_inclusive_range_patterns)]

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![allow(bare_trait_objects)]
trait Item {
type Core;

View file

@ -1,5 +1,5 @@
error[E0191]: the value of the associated types `Item` and `IntoIter` in `IntoIterator` must be specified
--> $DIR/overlaping-bound-suggestion.rs:6:13
--> $DIR/overlaping-bound-suggestion.rs:7:13
|
LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated types: `IntoIterator<Item: IntoIterator<Item: >, Item = Type, IntoIter = Type>`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![feature(associated_type_defaults)]
// This used to cause an ICE because assoc. type defaults weren't properly

View file

@ -1,17 +1,17 @@
error[E0277]: the trait bound `(dyn ToString + 'static): Default` is not satisfied
--> $DIR/issue-43924.rs:7:45
--> $DIR/issue-43924.rs:8:45
|
LL | type Out: Default + ToString + ?Sized = dyn ToString;
| ^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)`
|
note: required by a bound in `Foo::Out`
--> $DIR/issue-43924.rs:7:15
--> $DIR/issue-43924.rs:8:15
|
LL | type Out: Default + ToString + ?Sized = dyn ToString;
| ^^^^^^^ required by this bound in `Foo::Out`
error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
--> $DIR/issue-43924.rs:14:39
--> $DIR/issue-43924.rs:15:39
|
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
| ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn main() { //~ NOTE expected `()` because of default return type
&panic!()
//~^ ERROR mismatched types

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-5500.rs:2:5
--> $DIR/issue-5500.rs:3:5
|
LL | fn main() {
| - expected `()` because of default return type

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that two closures cannot simultaneously have mutable
// and immutable access to the variable. Issue #6801.

View file

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-closures-mut-and-imm.rs:17:14
--> $DIR/borrowck-closures-mut-and-imm.rs:18:14
|
LL | let c1 = || x = 4;
| -- - first borrow occurs due to use of `x` in closure
@ -14,7 +14,7 @@ LL | drop(c1);
| -- mutable borrow later used here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-closures-mut-and-imm.rs:25:14
--> $DIR/borrowck-closures-mut-and-imm.rs:26:14
|
LL | let c1 = || set(&mut x);
| -- - first borrow occurs due to use of `x` in closure
@ -29,7 +29,7 @@ LL | drop(c1);
| -- mutable borrow later used here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-closures-mut-and-imm.rs:33:14
--> $DIR/borrowck-closures-mut-and-imm.rs:34:14
|
LL | let c1 = || set(&mut x);
| -- - first borrow occurs due to use of `x` in closure
@ -44,7 +44,7 @@ LL | drop(c1);
| -- mutable borrow later used here
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/borrowck-closures-mut-and-imm.rs:41:5
--> $DIR/borrowck-closures-mut-and-imm.rs:42:5
|
LL | let c2 = || x * 5;
| -- - borrow occurs due to use in closure
@ -57,7 +57,7 @@ LL | drop(c2);
| -- borrow later used here
error[E0506]: cannot assign to `x` because it is borrowed
--> $DIR/borrowck-closures-mut-and-imm.rs:49:5
--> $DIR/borrowck-closures-mut-and-imm.rs:50:5
|
LL | let c1 = || get(&x);
| -- - borrow occurs due to use in closure
@ -70,7 +70,7 @@ LL | drop(c1);
| -- borrow later used here
error[E0506]: cannot assign to `*x` because it is borrowed
--> $DIR/borrowck-closures-mut-and-imm.rs:57:5
--> $DIR/borrowck-closures-mut-and-imm.rs:58:5
|
LL | let c1 = || get(&*x);
| -- -- borrow occurs due to use in closure
@ -83,7 +83,7 @@ LL | drop(c1);
| -- borrow later used here
error[E0506]: cannot assign to `*x.f` because it is borrowed
--> $DIR/borrowck-closures-mut-and-imm.rs:69:5
--> $DIR/borrowck-closures-mut-and-imm.rs:70:5
|
LL | let c1 = || get(&*x.f);
| -- ---- borrow occurs due to use in closure
@ -96,7 +96,7 @@ LL | drop(c1);
| -- borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-mut-and-imm.rs:81:14
--> $DIR/borrowck-closures-mut-and-imm.rs:82:14
|
LL | let c1 = || get(&*x.f);
| -- ---- first borrow occurs due to use of `x` in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that two closures cannot simultaneously have mutable
// and immutable access to the variable. Issue #6801.

View file

@ -1,17 +1,17 @@
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-closures-mut-of-imm.rs:9:25
--> $DIR/borrowck-closures-mut-of-imm.rs:10:25
|
LL | let mut c1 = || set(&mut *x);
| ^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-closures-mut-of-imm.rs:11:25
--> $DIR/borrowck-closures-mut-of-imm.rs:12:25
|
LL | let mut c2 = || set(&mut *x);
| ^^^^^^^ cannot borrow as mutable
error[E0524]: two closures require unique access to `x` at the same time
--> $DIR/borrowck-closures-mut-of-imm.rs:11:18
--> $DIR/borrowck-closures-mut-of-imm.rs:12:18
|
LL | let mut c1 = || set(&mut *x);
| -- -- first borrow occurs due to use of `x` in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that two closures cannot simultaneously both have mutable
// access to the variable. Related to issue #6801.

View file

@ -1,5 +1,5 @@
error[E0524]: two closures require unique access to `x` at the same time
--> $DIR/borrowck-closures-mut-of-mut.rs:14:18
--> $DIR/borrowck-closures-mut-of-mut.rs:15:18
|
LL | let mut c1 = || set(&mut *x);
| -- -- first borrow occurs due to use of `x` in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Check that closure captures for slice patterns are inferred correctly
fn arr_by_ref(mut x: [String; 3]) {

View file

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:7:13
--> $DIR/borrowck-closures-slice-patterns.rs:8:13
|
LL | let f = || {
| -- immutable borrow occurs here
@ -13,7 +13,7 @@ LL | f();
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-closures-slice-patterns.rs:16:13
--> $DIR/borrowck-closures-slice-patterns.rs:17:13
|
LL | let mut f = || {
| -- mutable borrow occurs here
@ -27,7 +27,7 @@ LL | f();
| - mutable borrow later used here
error[E0382]: borrow of moved value: `x`
--> $DIR/borrowck-closures-slice-patterns.rs:25:5
--> $DIR/borrowck-closures-slice-patterns.rs:26:5
|
LL | fn arr_by_move(x: [String; 3]) {
| - move occurs because `x` has type `[String; 3]`, which does not implement the `Copy` trait
@ -45,7 +45,7 @@ LL | let [y, z @ ..] = x.clone();
| ++++++++
error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:33:13
--> $DIR/borrowck-closures-slice-patterns.rs:34:13
|
LL | let f = || {
| -- immutable borrow occurs here
@ -59,7 +59,7 @@ LL | f();
| - immutable borrow later used here
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
--> $DIR/borrowck-closures-slice-patterns.rs:42:13
--> $DIR/borrowck-closures-slice-patterns.rs:43:13
|
LL | let mut f = || {
| -- closure construction occurs here
@ -73,7 +73,7 @@ LL | f();
| - first borrow later used here
error[E0382]: borrow of moved value: `x`
--> $DIR/borrowck-closures-slice-patterns.rs:51:5
--> $DIR/borrowck-closures-slice-patterns.rs:52:5
|
LL | fn arr_box_by_move(x: Box<[String; 3]>) {
| - move occurs because `x` has type `Box<[String; 3]>`, which does not implement the `Copy` trait
@ -92,7 +92,7 @@ LL + let [y, z @ ..] = x.clone();
|
error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:59:13
--> $DIR/borrowck-closures-slice-patterns.rs:60:13
|
LL | let f = || {
| -- immutable borrow occurs here
@ -106,7 +106,7 @@ LL | f();
| - immutable borrow later used here
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
--> $DIR/borrowck-closures-slice-patterns.rs:68:13
--> $DIR/borrowck-closures-slice-patterns.rs:69:13
|
LL | let mut f = || {
| -- closure construction occurs here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that two closures cannot simultaneously have mutable
// access to the variable, whether that mutable access be used
// for direct assignment or for taking mutable ref. Issue #6801.

View file

@ -1,5 +1,5 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut-fail.rs:16:24
--> $DIR/borrowck-closures-two-mut-fail.rs:17:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - first borrow occurs due to use of `x` in closure
@ -13,7 +13,7 @@ LL | c1;
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut-fail.rs:27:24
--> $DIR/borrowck-closures-two-mut-fail.rs:28:24
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - first borrow occurs due to use of `x` in closure
@ -27,7 +27,7 @@ LL | c1;
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut-fail.rs:34:24
--> $DIR/borrowck-closures-two-mut-fail.rs:35:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
@ -41,7 +41,7 @@ LL | c1;
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut-fail.rs:41:24
--> $DIR/borrowck-closures-two-mut-fail.rs:42:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
@ -56,7 +56,7 @@ LL | c1;
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut-fail.rs:53:24
--> $DIR/borrowck-closures-two-mut-fail.rs:54:24
|
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- ---- first borrow occurs due to use of `x` in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that two closures cannot simultaneously have mutable
// access to the variable, whether that mutable access be used
// for direct assignment or for taking mutable ref. Issue #6801.

View file

@ -1,5 +1,5 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:12:24
--> $DIR/borrowck-closures-two-mut.rs:13:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - first borrow occurs due to use of `x` in closure
@ -13,7 +13,7 @@ LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:23:24
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - first borrow occurs due to use of `x` in closure
@ -27,7 +27,7 @@ LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:30:24
--> $DIR/borrowck-closures-two-mut.rs:31:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
@ -41,7 +41,7 @@ LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:37:24
--> $DIR/borrowck-closures-two-mut.rs:38:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - first borrow occurs due to use of `x` in closure
@ -56,7 +56,7 @@ LL | drop((c1, c2));
| -- first borrow later used here
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-closures-two-mut.rs:49:24
--> $DIR/borrowck-closures-two-mut.rs:50:24
|
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- ---- first borrow occurs due to use of `x` in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
struct Foo {
x: isize,
}

View file

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `this.x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-unique-imm.rs:11:9
--> $DIR/borrowck-closures-unique-imm.rs:12:9
|
LL | let p = &this.x;
| ------- immutable borrow occurs here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that a closure which requires mutable access to the referent
// of an `&mut` requires a "unique" borrow -- that is, the variable to
// be borrowed (here, `x`) will not be borrowed *mutably*, but

View file

@ -1,5 +1,5 @@
error[E0500]: closure requires unique access to `x` but it is already borrowed
--> $DIR/borrowck-closures-unique.rs:26:14
--> $DIR/borrowck-closures-unique.rs:27:14
|
LL | let c1 = || get(x);
| -- - first borrow occurs due to use of `x` in closure
@ -13,7 +13,7 @@ LL | c1;
| -- first borrow later used here
error[E0500]: closure requires unique access to `x` but it is already borrowed
--> $DIR/borrowck-closures-unique.rs:32:14
--> $DIR/borrowck-closures-unique.rs:33:14
|
LL | let c1 = || get(x);
| -- - first borrow occurs due to use of `x` in closure
@ -27,7 +27,7 @@ LL | c1;
| -- first borrow later used here
error[E0524]: two closures require unique access to `x` at the same time
--> $DIR/borrowck-closures-unique.rs:38:14
--> $DIR/borrowck-closures-unique.rs:39:14
|
LL | let c1 = || set(x);
| -- - first borrow occurs due to use of `x` in closure
@ -41,7 +41,7 @@ LL | c1;
| -- first borrow later used here
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/borrowck-closures-unique.rs:43:38
--> $DIR/borrowck-closures-unique.rs:44:38
|
LL | let c1 = |y: &'static mut isize| x = y;
| ^^^^^ cannot assign

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
use std::collections::HashSet;
struct Foo {

View file

@ -1,5 +1,5 @@
error[E0501]: cannot borrow `*f` as mutable because previous closure requires unique access
--> $DIR/borrowck-insert-during-each.rs:16:5
--> $DIR/borrowck-insert-during-each.rs:17:5
|
LL | f.foo(
| ^ --- first borrow later used by call
@ -14,7 +14,7 @@ LL | | })
| |__________^ second borrow occurs here
error[E0500]: closure requires unique access to `f` but it is already borrowed
--> $DIR/borrowck-insert-during-each.rs:18:9
--> $DIR/borrowck-insert-during-each.rs:19:9
|
LL | f.foo(
| - --- first borrow later used by call

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
struct Point { x: isize, y: isize }
trait Methods {

View file

@ -1,5 +1,5 @@
error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-loan-rcvr.rs:23:14
--> $DIR/borrowck-loan-rcvr.rs:24:14
|
LL | p.blockm(|| {
| - ------ ^^ mutable borrow occurs here
@ -10,7 +10,7 @@ LL | p.x = 10;
| --- second borrow occurs due to use of `p` in closure
error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-loan-rcvr.rs:34:5
--> $DIR/borrowck-loan-rcvr.rs:35:5
|
LL | let l = &mut p;
| ------ mutable borrow occurs here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// rust-lang/rust#55492: errors detected during MIR-borrowck's
// analysis of a closure body may only be caught when AST-borrowck
// looks at some parent.

View file

@ -1,5 +1,5 @@
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:10:46
|
LL | let mut c1 = |y: &'static mut isize| x = y;
| ^^^^^ cannot assign
@ -10,7 +10,7 @@ LL | pub fn e(mut x: &'static mut isize) {
| +++
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:21:50
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:22:50
|
LL | let mut c2 = |y: &'static mut isize| x = y;
| ^^^^^ cannot assign
@ -21,7 +21,7 @@ LL | pub fn ee(mut x: &'static mut isize) {
| +++
error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:35:13
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:36:13
|
LL | x = (1,);
| ^^^^^^^^ cannot assign
@ -32,7 +32,7 @@ LL | pub fn capture_assign_whole(mut x: (i32,)) {
| +++
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:41:13
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:42:13
|
LL | x.0 = 1;
| ^^^^^^^ cannot assign
@ -43,7 +43,7 @@ LL | pub fn capture_assign_part(mut x: (i32,)) {
| +++
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:47:13
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:48:13
|
LL | &mut x;
| ^^^^^^ cannot borrow as mutable
@ -54,7 +54,7 @@ LL | pub fn capture_reborrow_whole(mut x: (i32,)) {
| +++
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:53:13
--> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:54:13
|
LL | &mut x.0;
| ^^^^^^^^ cannot borrow as mutable

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
type Lazy<T> = Box<dyn Fn() -> T + 'static>;
fn test(x: &i32) -> Lazy<i32> {

View file

@ -1,5 +1,5 @@
error: lifetime may not live long enough
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:5
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:5
|
LL | fn test(x: &i32) -> Lazy<i32> {
| - let's call the lifetime of this reference `'1`
@ -17,7 +17,7 @@ LL + type Lazy<'a, T> = Box<dyn Fn() -> T + 'a>;
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:14
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:14
|
LL | Box::new(|| {
| ^^ may outlive borrowed value `x`
@ -26,7 +26,7 @@ LL | *x
| -- `x` is borrowed here
|
note: closure is returned here
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:4:5
--> $DIR/suggest-lt-on-ty-alias-w-generics.rs:5:5
|
LL | / Box::new(|| {
LL | |

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/issue-90465.rs:17:14
--> $DIR/issue-90465.rs:18:14
|
LL | let c0 = move || {
| ^^^^^^^
@ -12,7 +12,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/issue-90465.rs:3:9
--> $DIR/issue-90465.rs:4:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/auto_traits.rs:22:19
--> $DIR/auto_traits.rs:23:19
|
LL | thread::spawn(move || unsafe {
| ^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send`
@ -9,7 +9,7 @@ LL | *fptr.0 = 20;
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/auto_traits.rs:2:9
--> $DIR/auto_traits.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL ~ } }).join().unwrap();
|
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/auto_traits.rs:42:19
--> $DIR/auto_traits.rs:43:19
|
LL | thread::spawn(move || unsafe {
| ^^^^^^^
@ -45,7 +45,7 @@ LL ~ } }).join().unwrap();
|
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/auto_traits.rs:67:13
--> $DIR/auto_traits.rs:68:13
|
LL | let c = || {
| ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f` is not fully captured and `f.1` does not implement `Clone`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/insignificant_drop_attr_migrations.rs:39:13
--> $DIR/insignificant_drop_attr_migrations.rs:40:13
|
LL | let c = || {
| ^^
@ -12,7 +12,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/insignificant_drop_attr_migrations.rs:3:9
--> $DIR/insignificant_drop_attr_migrations.rs:4:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/insignificant_drop_attr_migrations.rs:59:13
--> $DIR/insignificant_drop_attr_migrations.rs:60:13
|
LL | let c = move || {
| ^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
// See https://github.com/rust-lang/rust/issues/87955

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
// See https://github.com/rust-lang/rust/issues/87955

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/macro.rs:19:13
--> $DIR/macro.rs:20:13
|
LL | let _ = || dbg!(a.0);
| ^^ --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
@ -9,7 +9,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/macro.rs:5:9
--> $DIR/macro.rs:6:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/migrations_rustfix.rs:19:13
--> $DIR/migrations_rustfix.rs:20:13
|
LL | let c = || {
| ^^
@ -12,7 +12,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/migrations_rustfix.rs:2:9
--> $DIR/migrations_rustfix.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/migrations_rustfix.rs:33:13
--> $DIR/migrations_rustfix.rs:34:13
|
LL | let c = || t.0;
| ^^ --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
//@ needs-unwind

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
//@ needs-unwind

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/mir_calls_to_shims.rs:20:38
--> $DIR/mir_calls_to_shims.rs:21:38
|
LL | let result = panic::catch_unwind(move || {
| ^^^^^^^
@ -12,7 +12,7 @@ LL | f.0()
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/mir_calls_to_shims.rs:4:9
--> $DIR/mir_calls_to_shims.rs:5:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/multi_diagnostics.rs:37:13
--> $DIR/multi_diagnostics.rs:38:13
|
LL | let c = || {
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
@ -15,7 +15,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/multi_diagnostics.rs:2:9
--> $DIR/multi_diagnostics.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL + let _ = (&f1, &f2);
|
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:56:13
--> $DIR/multi_diagnostics.rs:57:13
|
LL | let c = || {
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
@ -42,7 +42,7 @@ LL + let _ = &f1;
|
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:81:13
--> $DIR/multi_diagnostics.rs:82:13
|
LL | let c = || {
| ^^
@ -64,7 +64,7 @@ LL + let _ = &f1;
|
error: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements
--> $DIR/multi_diagnostics.rs:100:13
--> $DIR/multi_diagnostics.rs:101:13
|
LL | let c = || {
| ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` because `f1` is not fully captured and `f1.0` does not implement `Clone`
@ -89,7 +89,7 @@ LL + let _ = &f1;
|
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/multi_diagnostics.rs:133:19
--> $DIR/multi_diagnostics.rs:134:19
|
LL | thread::spawn(move || unsafe {
| ^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/precise.rs:20:13
--> $DIR/precise.rs:21:13
|
LL | let c = || {
| ^^
@ -12,7 +12,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/precise.rs:3:9
--> $DIR/precise.rs:4:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/precise.rs:45:13
--> $DIR/precise.rs:46:13
|
LL | let c = || {
| ^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here

View file

@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:25:13
--> $DIR/significant_drop.rs:26:13
|
LL | let c = || {
| ^^
@ -22,7 +22,7 @@ LL | }
|
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/significant_drop.rs:2:9
--> $DIR/significant_drop.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -33,7 +33,7 @@ LL + let _ = (&t, &t1, &t2);
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:50:13
--> $DIR/significant_drop.rs:51:13
|
LL | let c = || {
| ^^
@ -58,7 +58,7 @@ LL + let _ = (&t, &t1);
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:71:13
--> $DIR/significant_drop.rs:72:13
|
LL | let c = || {
| ^^
@ -77,7 +77,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:91:13
--> $DIR/significant_drop.rs:92:13
|
LL | let c = || {
| ^^
@ -96,7 +96,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:109:13
--> $DIR/significant_drop.rs:110:13
|
LL | let c = || {
| ^^
@ -115,7 +115,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:125:13
--> $DIR/significant_drop.rs:126:13
|
LL | let c = || {
| ^^
@ -134,7 +134,7 @@ LL + let _ = &t;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:143:13
--> $DIR/significant_drop.rs:144:13
|
LL | let c = move || {
| ^^^^^^^
@ -158,7 +158,7 @@ LL + let _ = (&t1, &t);
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:163:21
--> $DIR/significant_drop.rs:164:21
|
LL | let c = || {
| ^^
@ -177,7 +177,7 @@ LL + let _ = &tuple;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:181:17
--> $DIR/significant_drop.rs:182:17
|
LL | let c = || {
| ^^
@ -196,7 +196,7 @@ LL + let _ = &tuple;
|
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:201:18
--> $DIR/significant_drop.rs:202:18
|
LL | let _c = || tup.0;
| ^^ ----- in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn bar<F>(blk: F) where F: FnOnce() + 'static {
}

View file

@ -1,5 +1,5 @@
error[E0521]: borrowed data escapes outside of function
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:5
|
LL | fn foo(x: &()) {
| - - let's call the lifetime of this reference `'1`
@ -16,7 +16,7 @@ LL | | })
| argument requires that `'1` must outlive `'static`
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:9
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:9
|
LL | bar(|| {
| ^^ may outlive borrowed value `x`
@ -25,7 +25,7 @@ LL | let _ = x;
| - `x` is borrowed here
|
note: function requires argument type to outlive `'static`
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5
--> $DIR/closure-bounds-static-cant-capture-borrowed.rs:6:5
|
LL | / bar(|| {
LL | |

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//! Test that closures only implement `Clone` if all captured values implement `Clone`.
//!
//! When a closure captures variables from its environment, it can only be cloned

View file

@ -1,14 +1,14 @@
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`
--> $DIR/closure-clone-requires-captured-clone.rs:17:13
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}`
--> $DIR/closure-clone-requires-captured-clone.rs:18:13
|
LL | let closure = move || {
| ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`
| ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}`
...
LL | closure.clone();
| ^^^^^ within `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`, the trait `Clone` is not implemented for `NonClone`
| ^^^^^ within `{closure@$DIR/closure-clone-requires-captured-clone.rs:14:19: 14:26}`, the trait `Clone` is not implemented for `NonClone`
|
note: required because it's used within this closure
--> $DIR/closure-clone-requires-captured-clone.rs:13:19
--> $DIR/closure-clone-requires-captured-clone.rs:14:19
|
LL | let closure = move || {
| ^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Regression test for #25954: detect and reject a closure type that
// references itself.

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/closure-referencing-itself-issue-25954.rs:15:13
--> $DIR/closure-referencing-itself-issue-25954.rs:16:13
|
LL | let q = || p.b.set(5i32);
| ^^^^^^^^^^^^^^^^ cyclic type of infinite size

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Creating a stack closure which references a box and then
// transferring ownership of the box before invoking the stack
// closure results in a crash.

View file

@ -1,5 +1,5 @@
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/issue-6801.rs:19:13
--> $DIR/issue-6801.rs:20:13
|
LL | let sq = || { *x * *x };
| -- -- borrow occurs due to use in closure

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn foo(x: &mut u32) {
let bar = || { foo(x); };
bar(); //~ ERROR cannot borrow

View file

@ -1,5 +1,5 @@
error[E0596]: cannot borrow `bar` as mutable, as it is not declared as mutable
--> $DIR/issue-81700-mut-borrow.rs:3:5
--> $DIR/issue-81700-mut-borrow.rs:4:5
|
LL | let bar = || { foo(x); };
| - calling `bar` requires mutable binding due to mutable borrow of `x`

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn to_fn_once<F: FnOnce()>(f: F) -> F {
f
}

View file

@ -1,8 +1,8 @@
error[E0382]: use of moved value: `c`
--> $DIR/closure-print-generic-1.rs:17:5
--> $DIR/closure-print-generic-1.rs:18:5
|
LL | let c = to_fn_once(move || {
| - move occurs because `c` has type `{closure@$DIR/closure-print-generic-1.rs:12:24: 12:31}`, which does not implement the `Copy` trait
| - move occurs because `c` has type `{closure@$DIR/closure-print-generic-1.rs:13:24: 13:31}`, which does not implement the `Copy` trait
...
LL | c();
| --- `c` moved due to this call
@ -10,7 +10,7 @@ LL | c();
| ^ value used here after move
|
note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/closure-print-generic-1.rs:16:5
--> $DIR/closure-print-generic-1.rs:17:5
|
LL | c();
| ^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ compile-flags: -Zverbose-internals
fn to_fn_once<F:FnOnce()>(f: F) -> F { f }

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `c`
--> $DIR/closure-print-generic-verbose-1.rs:17:5
--> $DIR/closure-print-generic-verbose-1.rs:18:5
|
LL | let c = to_fn_once(move|| {
| - move occurs because `c` has type `{f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)}`, which does not implement the `Copy` trait
@ -10,7 +10,7 @@ LL | c();
| ^ value used here after move
|
note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/closure-print-generic-verbose-1.rs:16:5
--> $DIR/closure-print-generic-verbose-1.rs:17:5
|
LL | c();
| ^

View file

@ -1,5 +1,6 @@
// Regression test for issue #89358.
//@ edition: 2015..2021
//@ compile-flags: --cfg a"
//~? RAW unterminated double quote string

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![allow(non_fmt_panics)]
#![crate_type = "lib"]

View file

@ -1,23 +1,23 @@
error[E0080]: evaluation panicked: cheese
--> $DIR/const_panic.rs:6:15
--> $DIR/const_panic.rs:7:15
|
LL | const Z: () = std::panic!("cheese");
| ^^^^^^^^^^^^^^^^^^^^^ evaluation of `Z` failed here
error[E0080]: evaluation panicked: explicit panic
--> $DIR/const_panic.rs:9:16
--> $DIR/const_panic.rs:10:16
|
LL | const Z2: () = std::panic!();
| ^^^^^^^^^^^^^ evaluation of `Z2` failed here
error[E0080]: evaluation panicked: internal error: entered unreachable code
--> $DIR/const_panic.rs:12:15
--> $DIR/const_panic.rs:13:15
|
LL | const Y: () = std::unreachable!();
| ^^^^^^^^^^^^^^^^^^^ evaluation of `Y` failed here
error[E0080]: evaluation panicked: not implemented
--> $DIR/const_panic.rs:15:15
--> $DIR/const_panic.rs:16:15
|
LL | const X: () = std::unimplemented!();
| ^^^^^^^^^^^^^^^^^^^^^ evaluation of `X` failed here
@ -25,37 +25,37 @@ LL | const X: () = std::unimplemented!();
= note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation panicked: hello
--> $DIR/const_panic.rs:18:15
--> $DIR/const_panic.rs:19:15
|
LL | const W: () = std::panic!(MSG);
| ^^^^^^^^^^^^^^^^ evaluation of `W` failed here
error[E0080]: evaluation panicked: hello
--> $DIR/const_panic.rs:21:16
--> $DIR/const_panic.rs:22:16
|
LL | const W2: () = std::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `W2` failed here
error[E0080]: evaluation panicked: cheese
--> $DIR/const_panic.rs:24:20
--> $DIR/const_panic.rs:25:20
|
LL | const Z_CORE: () = core::panic!("cheese");
| ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `Z_CORE` failed here
error[E0080]: evaluation panicked: explicit panic
--> $DIR/const_panic.rs:27:21
--> $DIR/const_panic.rs:28:21
|
LL | const Z2_CORE: () = core::panic!();
| ^^^^^^^^^^^^^^ evaluation of `Z2_CORE` failed here
error[E0080]: evaluation panicked: internal error: entered unreachable code
--> $DIR/const_panic.rs:30:20
--> $DIR/const_panic.rs:31:20
|
LL | const Y_CORE: () = core::unreachable!();
| ^^^^^^^^^^^^^^^^^^^^ evaluation of `Y_CORE` failed here
error[E0080]: evaluation panicked: not implemented
--> $DIR/const_panic.rs:33:20
--> $DIR/const_panic.rs:34:20
|
LL | const X_CORE: () = core::unimplemented!();
| ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `X_CORE` failed here
@ -63,13 +63,13 @@ LL | const X_CORE: () = core::unimplemented!();
= note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: evaluation panicked: hello
--> $DIR/const_panic.rs:36:20
--> $DIR/const_panic.rs:37:20
|
LL | const W_CORE: () = core::panic!(MSG);
| ^^^^^^^^^^^^^^^^^ evaluation of `W_CORE` failed here
error[E0080]: evaluation panicked: hello
--> $DIR/const_panic.rs:39:21
--> $DIR/const_panic.rs:40:21
|
LL | const W2_CORE: () = core::panic!("{}", MSG);
| ^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `W2_CORE` failed here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
const fn hey() -> usize {
panic!(123); //~ ERROR argument to `panic!()` in a const context must have type `&str`
}

View file

@ -1,5 +1,5 @@
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-85907.rs:2:5
--> $DIR/issue-85907.rs:3:5
|
LL | panic!(123);
| ^^^^^^^^^^^

View file

@ -1,5 +1,5 @@
error[E0080]: constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
--> $DIR/ub-upvars.rs:6:1
--> $DIR/ub-upvars.rs:7:1
|
LL | const BAD_UPVAR: &dyn FnOnce() = &{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value

View file

@ -1,5 +1,5 @@
error[E0080]: constructing invalid value at .<deref>.<dyn-downcast>.<captured-var(bad_ref)>: encountered a null reference
--> $DIR/ub-upvars.rs:6:1
--> $DIR/ub-upvars.rs:7:1
|
LL | const BAD_UPVAR: &dyn FnOnce() = &{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ stderr-per-bitwidth
#![allow(invalid_value)] // make sure we cannot allow away the errors tested here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// This is a separate test from `issue-66693.rs` because array lengths are evaluated
// in a separate stage before `const`s and `statics` and so the error below is hit and
// the compiler exits before generating errors for the others.

View file

@ -1,11 +1,11 @@
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693-panic-in-array-len.rs:6:20
--> $DIR/issue-66693-panic-in-array-len.rs:7:20
|
LL | let _ = [0i32; panic!(2f32)];
| ^^^^^^^^^^^^
error[E0080]: evaluation panicked: explicit panic
--> $DIR/issue-66693-panic-in-array-len.rs:10:21
--> $DIR/issue-66693-panic-in-array-len.rs:11:21
|
LL | let _ = [false; panic!()];
| ^^^^^^^^ evaluation of `main::{constant#1}` failed here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
// Tests that the compiler does not ICE when const-evaluating a `panic!()` invocation with a
// non-`&str` argument.

View file

@ -1,29 +1,29 @@
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:4:15
--> $DIR/issue-66693.rs:5:15
|
LL | const _: () = panic!(1);
| ^^^^^^^^^
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:7:19
--> $DIR/issue-66693.rs:8:19
|
LL | static _FOO: () = panic!(true);
| ^^^^^^^^^^^^
error[E0080]: evaluation panicked: explicit panic
--> $DIR/issue-66693.rs:16:15
--> $DIR/issue-66693.rs:17:15
|
LL | const _: () = panic!();
| ^^^^^^^^ evaluation of `_` failed here
error[E0080]: evaluation panicked: panic in static
--> $DIR/issue-66693.rs:18:19
--> $DIR/issue-66693.rs:19:19
|
LL | static _BAR: () = panic!("panic in static");
| ^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_BAR` failed here
error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:11:5
--> $DIR/issue-66693.rs:12:5
|
LL | panic!(&1);
| ^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ compile-flags: -Zcontract-checks=yes
#![feature(contracts)]

View file

@ -1,5 +1,5 @@
warning: the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/contract-captures-via-closure-noncopy.rs:3:12
--> $DIR/contract-captures-via-closure-noncopy.rs:4:12
|
LL | #![feature(contracts)]
| ^^^^^^^^^
@ -7,20 +7,20 @@ LL | #![feature(contracts)]
= note: see issue #128044 <https://github.com/rust-lang/rust/issues/128044> for more information
= note: `#[warn(incomplete_features)]` on by default
error[E0277]: the trait bound `Baz: std::marker::Copy` is not satisfied in `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`
--> $DIR/contract-captures-via-closure-noncopy.rs:12:1
error[E0277]: the trait bound `Baz: std::marker::Copy` is not satisfied in `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}`
--> $DIR/contract-captures-via-closure-noncopy.rs:13:1
|
LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------------------------------------^^^^
| | |
| | within this `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`
| | this tail expression is of type `{closure@contract-captures-via-closure-noncopy.rs:12:42}`
| | within this `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}`
| | this tail expression is of type `{closure@contract-captures-via-closure-noncopy.rs:13:42}`
| unsatisfied trait bound
| required by a bound introduced by this call
|
= help: within `{closure@$DIR/contract-captures-via-closure-noncopy.rs:12:42: 12:57}`, the trait `std::marker::Copy` is not implemented for `Baz`
= help: within `{closure@$DIR/contract-captures-via-closure-noncopy.rs:13:42: 13:57}`, the trait `std::marker::Copy` is not implemented for `Baz`
note: required because it's used within this closure
--> $DIR/contract-captures-via-closure-noncopy.rs:12:42
--> $DIR/contract-captures-via-closure-noncopy.rs:13:42
|
LL | #[core::contracts::ensures({let old = x; move |ret:&Baz| ret.baz == old.baz*2 })]
| ^^^^^^^^^^^^^^^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::cell::RefCell;

View file

@ -1,5 +1,5 @@
error[E0597]: `*cell` does not live long enough
--> $DIR/dropck.rs:10:40
--> $DIR/dropck.rs:11:40
|
LL | let (mut gen, cell);
| ---- binding `cell` declared here
@ -16,7 +16,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are defined
error[E0597]: `ref_` does not live long enough
--> $DIR/dropck.rs:16:18
--> $DIR/dropck.rs:17:18
|
LL | let ref_ = Box::leak(Box::new(Some(cell.borrow_mut())));
| ---- binding `ref_` declared here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::cell::Cell;

View file

@ -1,5 +1,5 @@
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
--> $DIR/yield-while-ref-reborrowed.rs:39:20
--> $DIR/yield-while-ref-reborrowed.rs:40:20
|
LL | || {
| -- coroutine construction occurs here

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
macro_rules! construct { ($x:ident) => { $x"str" } }
//~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
//~| NOTE expected one of 8 possible tokens

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
--> $DIR/edition-cstr-2015-2018.rs:27:6
--> $DIR/edition-cstr-2015-2018.rs:28:6
|
LL | c"str";
| ^^^^^ expected one of 8 possible tokens
@ -10,7 +10,7 @@ LL | c"str";
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
--> $DIR/edition-cstr-2015-2018.rs:37:7
--> $DIR/edition-cstr-2015-2018.rs:38:7
|
LL | cr"str";
| ^^^^^ expected one of 8 possible tokens
@ -21,7 +21,7 @@ LL | cr"str";
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `#`
--> $DIR/edition-cstr-2015-2018.rs:47:7
--> $DIR/edition-cstr-2015-2018.rs:48:7
|
LL | cr##"str"##;
| ^ expected one of 8 possible tokens
@ -32,13 +32,13 @@ LL | cr##"str"##;
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
--> $DIR/edition-cstr-2015-2018.rs:57:7
--> $DIR/edition-cstr-2015-2018.rs:58:7
|
LL | c "str";
| ^^^^^ expected one of 8 possible tokens
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
--> $DIR/edition-cstr-2015-2018.rs:1:44
--> $DIR/edition-cstr-2015-2018.rs:2:44
|
LL | macro_rules! construct { ($x:ident) => { $x"str" } }
| ^^^^^ expected one of 8 possible tokens
@ -49,7 +49,7 @@ LL | construct!(c);
= note: this error originates in the macro `construct` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"str"`
--> $DIR/edition-cstr-2015-2018.rs:5:33
--> $DIR/edition-cstr-2015-2018.rs:6:33
|
LL | macro_rules! contain { () => { c"str" } }
| ^^^^^ expected one of 8 possible tokens

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
//@ compile-flags: -Zverbose-internals
#![feature(ergonomic_clones)]

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `c`
--> $DIR/print-verbose.rs:22:5
--> $DIR/print-verbose.rs:23:5
|
LL | let c = to_fn_once(use || {
| - move occurs because `c` has type `{f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)}`, which does not implement the `Copy` trait
@ -10,7 +10,7 @@ LL | c();
| ^ value used here after move
|
note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/print-verbose.rs:21:5
--> $DIR/print-verbose.rs:22:5
|
LL | c();
| ^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
#![feature(ergonomic_clones)]
#![allow(incomplete_features)]

View file

@ -1,8 +1,8 @@
error[E0382]: use of moved value: `c`
--> $DIR/print.rs:20:5
--> $DIR/print.rs:21:5
|
LL | let c = to_fn_once(use || {
| - move occurs because `c` has type `{closure@$DIR/print.rs:15:24: 15:30}`, which does not implement the `Copy` trait
| - move occurs because `c` has type `{closure@$DIR/print.rs:16:24: 16:30}`, which does not implement the `Copy` trait
...
LL | c();
| --- `c` moved due to this call
@ -10,7 +10,7 @@ LL | c();
| ^ value used here after move
|
note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/print.rs:19:5
--> $DIR/print.rs:20:5
|
LL | c();
| ^

View file

@ -1,3 +1,4 @@
//@ edition:2015..2021
fn inside_closure(x: &mut i32) {
}

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