1
Fork 0

Editon 2021 enables precise capture

This commit is contained in:
Aman Arora 2021-06-27 02:22:46 -04:00
parent 3e9d7ecf78
commit b89ea96660
141 changed files with 462 additions and 1280 deletions

View file

@ -217,6 +217,10 @@ fn to_upvars_resolved_place_builder<'a, 'tcx>(
ty::ClosureKind::FnOnce => {} ty::ClosureKind::FnOnce => {}
} }
// We won't be building MIR if the closure wasn't local
let closure_hir_id = tcx.hir().local_def_id_to_hir_id(closure_def_id.expect_local());
let closure_span = tcx.hir().span(closure_hir_id);
let (capture_index, capture) = if let Some(capture_details) = let (capture_index, capture) = if let Some(capture_details) =
find_capture_matching_projections( find_capture_matching_projections(
typeck_results, typeck_results,
@ -226,7 +230,7 @@ fn to_upvars_resolved_place_builder<'a, 'tcx>(
) { ) {
capture_details capture_details
} else { } else {
if !tcx.features().capture_disjoint_fields { if !enable_precise_capture(tcx, closure_span) {
bug!( bug!(
"No associated capture found for {:?}[{:#?}] even though \ "No associated capture found for {:?}[{:#?}] even though \
capture_disjoint_fields isn't enabled", capture_disjoint_fields isn't enabled",
@ -780,3 +784,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
} }
} }
} }
/// Precise capture is enabled if the feature gate `capture_disjoint_fields` is enabled or if
/// user is using Rust Edition 2021 or higher.
fn enable_precise_capture(tcx: TyCtxt<'_>, closure_span: Span) -> bool {
tcx.features().capture_disjoint_fields || closure_span.rust_2021()
}

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
// Ensure that capture analysis results in arrays being completely captured. // Ensure that capture analysis results in arrays being completely captured.

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/arrays-completely-captured.rs:11:17 --> $DIR/arrays-completely-captured.rs:8:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let mut c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/arrays-completely-captured.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/arrays-completely-captured.rs:14:5 --> $DIR/arrays-completely-captured.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing m[] -> MutBorrow note: Capturing m[] -> MutBorrow
--> $DIR/arrays-completely-captured.rs:17:9 --> $DIR/arrays-completely-captured.rs:14:9
| |
LL | m[0] += 10; LL | m[0] += 10;
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/arrays-completely-captured.rs:14:5 --> $DIR/arrays-completely-captured.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture m[] -> MutBorrow note: Min Capture m[] -> MutBorrow
--> $DIR/arrays-completely-captured.rs:17:9 --> $DIR/arrays-completely-captured.rs:14:9
| |
LL | m[0] += 10; LL | m[0] += 10;
| ^ | ^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,11 +1,7 @@
// edition:2021
// Test that we handle derferences properly when only some of the captures are being moved with // Test that we handle derferences properly when only some of the captures are being moved with
// `capture_disjoint_fields` enabled. // `capture_disjoint_fields` enabled.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#[derive(Debug, Default)] #[derive(Debug, Default)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/by_value.rs:22:13 --> $DIR/by_value.rs:18:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/by_value.rs:5:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/by_value.rs:25:5 --> $DIR/by_value.rs:21:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,23 +20,23 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow
--> $DIR/by_value.rs:28:17 --> $DIR/by_value.rs:24:17
| |
LL | let p = t.0.0; LL | let p = t.0.0;
| ^^^^^ | ^^^^^
note: Capturing t[(0, 0)] -> ByValue note: Capturing t[(0, 0)] -> ByValue
--> $DIR/by_value.rs:28:17 --> $DIR/by_value.rs:24:17
| |
LL | let p = t.0.0; LL | let p = t.0.0;
| ^^^^^ | ^^^^^
note: Capturing t[(1, 0)] -> ImmBorrow note: Capturing t[(1, 0)] -> ImmBorrow
--> $DIR/by_value.rs:32:29 --> $DIR/by_value.rs:28:29
| |
LL | println!("{} {:?}", t.1, p); LL | println!("{} {:?}", t.1, p);
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/by_value.rs:25:5 --> $DIR/by_value.rs:21:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -57,16 +48,16 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0)] -> ByValue note: Min Capture t[(0, 0)] -> ByValue
--> $DIR/by_value.rs:28:17 --> $DIR/by_value.rs:24:17
| |
LL | let p = t.0.0; LL | let p = t.0.0;
| ^^^^^ | ^^^^^
note: Min Capture t[(1, 0)] -> ImmBorrow note: Min Capture t[(1, 0)] -> ImmBorrow
--> $DIR/by_value.rs:32:29 --> $DIR/by_value.rs:28:29
| |
LL | println!("{} {:?}", t.1, p); LL | println!("{} {:?}", t.1, p);
| ^^^ | ^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-analysis-1.rs:17:13 --> $DIR/capture-analysis-1.rs:15:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-analysis-1.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-analysis-1.rs:20:5 --> $DIR/capture-analysis-1.rs:18:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,28 +20,28 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[] -> ImmBorrow note: Capturing p[] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:23:26 --> $DIR/capture-analysis-1.rs:21:26
| |
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ | ^
note: Capturing p[(0, 0)] -> ImmBorrow note: Capturing p[(0, 0)] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:26:26 --> $DIR/capture-analysis-1.rs:24:26
| |
LL | println!("{:?}", p.x); LL | println!("{:?}", p.x);
| ^^^ | ^^^
note: Capturing q[(0, 0)] -> ImmBorrow note: Capturing q[(0, 0)] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:29:26 --> $DIR/capture-analysis-1.rs:27:26
| |
LL | println!("{:?}", q.x); LL | println!("{:?}", q.x);
| ^^^ | ^^^
note: Capturing q[] -> ImmBorrow note: Capturing q[] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:31:26 --> $DIR/capture-analysis-1.rs:29:26
| |
LL | println!("{:?}", q); LL | println!("{:?}", q);
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-analysis-1.rs:20:5 --> $DIR/capture-analysis-1.rs:18:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -62,16 +53,16 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[] -> ImmBorrow note: Min Capture p[] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:23:26 --> $DIR/capture-analysis-1.rs:21:26
| |
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ | ^
note: Min Capture q[] -> ImmBorrow note: Min Capture q[] -> ImmBorrow
--> $DIR/capture-analysis-1.rs:31:26 --> $DIR/capture-analysis-1.rs:29:26
| |
LL | println!("{:?}", q); LL | println!("{:?}", q);
| ^ | ^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-analysis-2.rs:16:13 --> $DIR/capture-analysis-2.rs:14:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-analysis-2.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-analysis-2.rs:19:5 --> $DIR/capture-analysis-2.rs:17:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,18 +20,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[(0, 0)] -> ByValue note: Capturing p[(0, 0)] -> ByValue
--> $DIR/capture-analysis-2.rs:22:18 --> $DIR/capture-analysis-2.rs:20:18
| |
LL | let _x = p.x; LL | let _x = p.x;
| ^^^ | ^^^
note: Capturing p[] -> ImmBorrow note: Capturing p[] -> ImmBorrow
--> $DIR/capture-analysis-2.rs:25:26 --> $DIR/capture-analysis-2.rs:23:26
| |
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-analysis-2.rs:19:5 --> $DIR/capture-analysis-2.rs:17:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -52,7 +43,7 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[] -> ByValue note: Min Capture p[] -> ByValue
--> $DIR/capture-analysis-2.rs:22:18 --> $DIR/capture-analysis-2.rs:20:18
| |
LL | let _x = p.x; LL | let _x = p.x;
| ^^^ p[] captured as ByValue here | ^^^ p[] captured as ByValue here
@ -60,6 +51,6 @@ LL | let _x = p.x;
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ p[] used here | ^ p[] used here
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-analysis-3.rs:21:13 --> $DIR/capture-analysis-3.rs:19:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-analysis-3.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-analysis-3.rs:24:5 --> $DIR/capture-analysis-3.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,18 +20,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing a[(0, 0),(0, 0)] -> ByValue note: Capturing a[(0, 0),(0, 0)] -> ByValue
--> $DIR/capture-analysis-3.rs:27:18 --> $DIR/capture-analysis-3.rs:25:18
| |
LL | let _x = a.b.c; LL | let _x = a.b.c;
| ^^^^^ | ^^^^^
note: Capturing a[(0, 0)] -> ImmBorrow note: Capturing a[(0, 0)] -> ImmBorrow
--> $DIR/capture-analysis-3.rs:30:26 --> $DIR/capture-analysis-3.rs:28:26
| |
LL | println!("{:?}", a.b); LL | println!("{:?}", a.b);
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-analysis-3.rs:24:5 --> $DIR/capture-analysis-3.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -52,7 +43,7 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture a[(0, 0)] -> ByValue note: Min Capture a[(0, 0)] -> ByValue
--> $DIR/capture-analysis-3.rs:27:18 --> $DIR/capture-analysis-3.rs:25:18
| |
LL | let _x = a.b.c; LL | let _x = a.b.c;
| ^^^^^ a[(0, 0)] captured as ByValue here | ^^^^^ a[(0, 0)] captured as ByValue here
@ -60,6 +51,6 @@ LL | let _x = a.b.c;
LL | println!("{:?}", a.b); LL | println!("{:?}", a.b);
| ^^^ a[(0, 0)] used here | ^^^ a[(0, 0)] used here
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-analysis-4.rs:21:13 --> $DIR/capture-analysis-4.rs:19:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-analysis-4.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-analysis-4.rs:24:5 --> $DIR/capture-analysis-4.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,18 +20,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing a[(0, 0)] -> ByValue note: Capturing a[(0, 0)] -> ByValue
--> $DIR/capture-analysis-4.rs:27:18 --> $DIR/capture-analysis-4.rs:25:18
| |
LL | let _x = a.b; LL | let _x = a.b;
| ^^^ | ^^^
note: Capturing a[(0, 0),(0, 0)] -> ImmBorrow note: Capturing a[(0, 0),(0, 0)] -> ImmBorrow
--> $DIR/capture-analysis-4.rs:30:26 --> $DIR/capture-analysis-4.rs:28:26
| |
LL | println!("{:?}", a.b.c); LL | println!("{:?}", a.b.c);
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-analysis-4.rs:24:5 --> $DIR/capture-analysis-4.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -52,11 +43,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture a[(0, 0)] -> ByValue note: Min Capture a[(0, 0)] -> ByValue
--> $DIR/capture-analysis-4.rs:27:18 --> $DIR/capture-analysis-4.rs:25:18
| |
LL | let _x = a.b; LL | let _x = a.b;
| ^^^ | ^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,5 @@
// FIXME(arora-aman) add run-pass once 2229 is implemented // edition:2021
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
struct Point { struct Point {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-disjoint-field-struct.rs:17:13 --> $DIR/capture-disjoint-field-struct.rs:13:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-disjoint-field-struct.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-disjoint-field-struct.rs:20:5 --> $DIR/capture-disjoint-field-struct.rs:16:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[(0, 0)] -> ImmBorrow note: Capturing p[(0, 0)] -> ImmBorrow
--> $DIR/capture-disjoint-field-struct.rs:23:24 --> $DIR/capture-disjoint-field-struct.rs:19:24
| |
LL | println!("{}", p.x); LL | println!("{}", p.x);
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-disjoint-field-struct.rs:20:5 --> $DIR/capture-disjoint-field-struct.rs:16:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[(0, 0)] -> ImmBorrow note: Min Capture p[(0, 0)] -> ImmBorrow
--> $DIR/capture-disjoint-field-struct.rs:23:24 --> $DIR/capture-disjoint-field-struct.rs:19:24
| |
LL | println!("{}", p.x); LL | println!("{}", p.x);
| ^^^ | ^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,5 @@
// FIXME(arora-aman) add run-pass once 2229 is implemented // edition:2021
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-disjoint-field-tuple.rs:12:13 --> $DIR/capture-disjoint-field-tuple.rs:8:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-disjoint-field-tuple.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-disjoint-field-tuple.rs:15:5 --> $DIR/capture-disjoint-field-tuple.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0)] -> ImmBorrow note: Capturing t[(0, 0)] -> ImmBorrow
--> $DIR/capture-disjoint-field-tuple.rs:18:24 --> $DIR/capture-disjoint-field-tuple.rs:14:24
| |
LL | println!("{}", t.0); LL | println!("{}", t.0);
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-disjoint-field-tuple.rs:15:5 --> $DIR/capture-disjoint-field-tuple.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0)] -> ImmBorrow note: Min Capture t[(0, 0)] -> ImmBorrow
--> $DIR/capture-disjoint-field-tuple.rs:18:24 --> $DIR/capture-disjoint-field-tuple.rs:14:24
| |
LL | println!("{}", t.0); LL | println!("{}", t.0);
| ^^^ | ^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
enum Info { enum Info {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-enums.rs:18:13 --> $DIR/capture-enums.rs:16:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/capture-enums.rs:49:13 --> $DIR/capture-enums.rs:47:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -16,17 +16,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-enums.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-enums.rs:21:5 --> $DIR/capture-enums.rs:19:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -38,28 +29,28 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing point[] -> ImmBorrow note: Capturing point[] -> ImmBorrow
--> $DIR/capture-enums.rs:24:41 --> $DIR/capture-enums.rs:22:41
| |
LL | if let Info::Point(_, _, str) = point { LL | if let Info::Point(_, _, str) = point {
| ^^^^^ | ^^^^^
note: Capturing point[(2, 0)] -> ByValue note: Capturing point[(2, 0)] -> ByValue
--> $DIR/capture-enums.rs:24:41 --> $DIR/capture-enums.rs:22:41
| |
LL | if let Info::Point(_, _, str) = point { LL | if let Info::Point(_, _, str) = point {
| ^^^^^ | ^^^^^
note: Capturing meta[] -> ImmBorrow note: Capturing meta[] -> ImmBorrow
--> $DIR/capture-enums.rs:31:35 --> $DIR/capture-enums.rs:29:35
| |
LL | if let Info::Meta(_, v) = meta { LL | if let Info::Meta(_, v) = meta {
| ^^^^ | ^^^^
note: Capturing meta[(1, 1)] -> ByValue note: Capturing meta[(1, 1)] -> ByValue
--> $DIR/capture-enums.rs:31:35 --> $DIR/capture-enums.rs:29:35
| |
LL | if let Info::Meta(_, v) = meta { LL | if let Info::Meta(_, v) = meta {
| ^^^^ | ^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-enums.rs:21:5 --> $DIR/capture-enums.rs:19:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -71,18 +62,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture point[] -> ByValue note: Min Capture point[] -> ByValue
--> $DIR/capture-enums.rs:24:41 --> $DIR/capture-enums.rs:22:41
| |
LL | if let Info::Point(_, _, str) = point { LL | if let Info::Point(_, _, str) = point {
| ^^^^^ | ^^^^^
note: Min Capture meta[] -> ByValue note: Min Capture meta[] -> ByValue
--> $DIR/capture-enums.rs:31:35 --> $DIR/capture-enums.rs:29:35
| |
LL | if let Info::Meta(_, v) = meta { LL | if let Info::Meta(_, v) = meta {
| ^^^^ | ^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/capture-enums.rs:52:5 --> $DIR/capture-enums.rs:50:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -94,13 +85,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing point[(2, 0)] -> ByValue note: Capturing point[(2, 0)] -> ByValue
--> $DIR/capture-enums.rs:55:47 --> $DIR/capture-enums.rs:53:47
| |
LL | let SingleVariant::Point(_, _, str) = point; LL | let SingleVariant::Point(_, _, str) = point;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/capture-enums.rs:52:5 --> $DIR/capture-enums.rs:50:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -112,11 +103,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture point[(2, 0)] -> ByValue note: Min Capture point[(2, 0)] -> ByValue
--> $DIR/capture-enums.rs:55:47 --> $DIR/capture-enums.rs:53:47
| |
LL | let SingleVariant::Point(_, _, str) = point; LL | let SingleVariant::Point(_, _, str) = point;
| ^^^^^ | ^^^^^
error: aborting due to 6 previous errors; 1 warning emitted error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(unused)] #![allow(unused)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/deep-multilevel-struct.rs:36:13 --> $DIR/deep-multilevel-struct.rs:34:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deep-multilevel-struct.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/deep-multilevel-struct.rs:39:5 --> $DIR/deep-multilevel-struct.rs:37:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,23 +20,23 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[(0, 0),(0, 0),(0, 0)] -> ImmBorrow note: Capturing p[(0, 0),(0, 0),(0, 0)] -> ImmBorrow
--> $DIR/deep-multilevel-struct.rs:42:18 --> $DIR/deep-multilevel-struct.rs:40:18
| |
LL | let x = &p.a.p.x; LL | let x = &p.a.p.x;
| ^^^^^^^ | ^^^^^^^
note: Capturing p[(1, 0),(1, 0),(1, 0)] -> MutBorrow note: Capturing p[(1, 0),(1, 0),(1, 0)] -> MutBorrow
--> $DIR/deep-multilevel-struct.rs:44:9 --> $DIR/deep-multilevel-struct.rs:42:9
| |
LL | p.b.q.y = 9; LL | p.b.q.y = 9;
| ^^^^^^^ | ^^^^^^^
note: Capturing p[] -> ImmBorrow note: Capturing p[] -> ImmBorrow
--> $DIR/deep-multilevel-struct.rs:47:26 --> $DIR/deep-multilevel-struct.rs:45:26
| |
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/deep-multilevel-struct.rs:39:5 --> $DIR/deep-multilevel-struct.rs:37:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -57,7 +48,7 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[] -> MutBorrow note: Min Capture p[] -> MutBorrow
--> $DIR/deep-multilevel-struct.rs:44:9 --> $DIR/deep-multilevel-struct.rs:42:9
| |
LL | p.b.q.y = 9; LL | p.b.q.y = 9;
| ^^^^^^^ p[] captured as MutBorrow here | ^^^^^^^ p[] captured as MutBorrow here
@ -65,6 +56,6 @@ LL | p.b.q.y = 9;
LL | println!("{:?}", p); LL | println!("{:?}", p);
| ^ p[] used here | ^ p[] used here
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(unused)] #![allow(unused)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/deep-multilevel-tuple.rs:11:13 --> $DIR/deep-multilevel-tuple.rs:8:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deep-multilevel-tuple.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/deep-multilevel-tuple.rs:14:5 --> $DIR/deep-multilevel-tuple.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,23 +20,23 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),(0, 0),(0, 0)] -> ImmBorrow note: Capturing t[(0, 0),(0, 0),(0, 0)] -> ImmBorrow
--> $DIR/deep-multilevel-tuple.rs:17:18 --> $DIR/deep-multilevel-tuple.rs:14:18
| |
LL | let x = &t.0.0.0; LL | let x = &t.0.0.0;
| ^^^^^^^ | ^^^^^^^
note: Capturing t[(1, 0),(1, 0),(1, 0)] -> MutBorrow note: Capturing t[(1, 0),(1, 0),(1, 0)] -> MutBorrow
--> $DIR/deep-multilevel-tuple.rs:19:9 --> $DIR/deep-multilevel-tuple.rs:16:9
| |
LL | t.1.1.1 = 9; LL | t.1.1.1 = 9;
| ^^^^^^^ | ^^^^^^^
note: Capturing t[] -> ImmBorrow note: Capturing t[] -> ImmBorrow
--> $DIR/deep-multilevel-tuple.rs:22:26 --> $DIR/deep-multilevel-tuple.rs:19:26
| |
LL | println!("{:?}", t); LL | println!("{:?}", t);
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/deep-multilevel-tuple.rs:14:5 --> $DIR/deep-multilevel-tuple.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -57,7 +48,7 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[] -> MutBorrow note: Min Capture t[] -> MutBorrow
--> $DIR/deep-multilevel-tuple.rs:19:9 --> $DIR/deep-multilevel-tuple.rs:16:9
| |
LL | t.1.1.1 = 9; LL | t.1.1.1 = 9;
| ^^^^^^^ t[] captured as MutBorrow here | ^^^^^^^ t[] captured as MutBorrow here
@ -65,6 +56,6 @@ LL | t.1.1.1 = 9;
LL | println!("{:?}", t); LL | println!("{:?}", t);
| ^ t[] used here | ^ t[] used here
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
// Test to ensure Index projections are handled properly during capture analysis // Test to ensure Index projections are handled properly during capture analysis

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/destructure_patterns.rs:12:13 --> $DIR/destructure_patterns.rs:10:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/destructure_patterns.rs:38:13 --> $DIR/destructure_patterns.rs:36:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/destructure_patterns.rs:58:13 --> $DIR/destructure_patterns.rs:56:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -25,17 +25,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/destructure_patterns.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/destructure_patterns.rs:15:5 --> $DIR/destructure_patterns.rs:13:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,13 +38,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing arr[Index] -> ByValue note: Capturing arr[Index] -> ByValue
--> $DIR/destructure_patterns.rs:18:29 --> $DIR/destructure_patterns.rs:16:29
| |
LL | let [a, b, .., e] = arr; LL | let [a, b, .., e] = arr;
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/destructure_patterns.rs:15:5 --> $DIR/destructure_patterns.rs:13:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -65,13 +56,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture arr[] -> ByValue note: Min Capture arr[] -> ByValue
--> $DIR/destructure_patterns.rs:18:29 --> $DIR/destructure_patterns.rs:16:29
| |
LL | let [a, b, .., e] = arr; LL | let [a, b, .., e] = arr;
| ^^^ | ^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/destructure_patterns.rs:41:5 --> $DIR/destructure_patterns.rs:39:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -83,18 +74,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[(0, 0)] -> MutBorrow note: Capturing p[(0, 0)] -> MutBorrow
--> $DIR/destructure_patterns.rs:44:58 --> $DIR/destructure_patterns.rs:42:58
| |
LL | let Point { x: ref mut x, y: _, id: moved_id } = p; LL | let Point { x: ref mut x, y: _, id: moved_id } = p;
| ^ | ^
note: Capturing p[(2, 0)] -> ByValue note: Capturing p[(2, 0)] -> ByValue
--> $DIR/destructure_patterns.rs:44:58 --> $DIR/destructure_patterns.rs:42:58
| |
LL | let Point { x: ref mut x, y: _, id: moved_id } = p; LL | let Point { x: ref mut x, y: _, id: moved_id } = p;
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/destructure_patterns.rs:41:5 --> $DIR/destructure_patterns.rs:39:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -106,18 +97,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[(0, 0)] -> MutBorrow note: Min Capture p[(0, 0)] -> MutBorrow
--> $DIR/destructure_patterns.rs:44:58 --> $DIR/destructure_patterns.rs:42:58
| |
LL | let Point { x: ref mut x, y: _, id: moved_id } = p; LL | let Point { x: ref mut x, y: _, id: moved_id } = p;
| ^ | ^
note: Min Capture p[(2, 0)] -> ByValue note: Min Capture p[(2, 0)] -> ByValue
--> $DIR/destructure_patterns.rs:44:58 --> $DIR/destructure_patterns.rs:42:58
| |
LL | let Point { x: ref mut x, y: _, id: moved_id } = p; LL | let Point { x: ref mut x, y: _, id: moved_id } = p;
| ^ | ^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/destructure_patterns.rs:61:5 --> $DIR/destructure_patterns.rs:59:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -129,23 +120,23 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0)] -> MutBorrow note: Capturing t[(0, 0)] -> MutBorrow
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
note: Capturing t[(1, 0)] -> ImmBorrow note: Capturing t[(1, 0)] -> ImmBorrow
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
note: Capturing t[(2, 0),(0, 0)] -> ByValue note: Capturing t[(2, 0),(0, 0)] -> ByValue
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/destructure_patterns.rs:61:5 --> $DIR/destructure_patterns.rs:59:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -157,21 +148,21 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0)] -> MutBorrow note: Min Capture t[(0, 0)] -> MutBorrow
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
note: Min Capture t[(1, 0)] -> ImmBorrow note: Min Capture t[(1, 0)] -> ImmBorrow
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
note: Min Capture t[(2, 0),(0, 0)] -> ByValue note: Min Capture t[(2, 0),(0, 0)] -> ByValue
--> $DIR/destructure_patterns.rs:64:54 --> $DIR/destructure_patterns.rs:62:54
| |
LL | let (ref mut x, ref ref_str, (moved_s, _)) = t; LL | let (ref mut x, ref ref_str, (moved_s, _)) = t;
| ^ | ^
error: aborting due to 9 previous errors; 1 warning emitted error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,6 @@
// Test that arrays are completely captured by closures by relying on the borrow check diagnostics // edition:2021
#![feature(capture_disjoint_fields)] // Test that arrays are completely captured by closures by relying on the borrow check diagnostics
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
fn arrays_1() { fn arrays_1() {
let mut arr = [1, 2, 3, 4, 5]; let mut arr = [1, 2, 3, 4, 5];

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/arrays.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0503]: cannot use `arr` because it was mutably borrowed error[E0503]: cannot use `arr` because it was mutably borrowed
--> $DIR/arrays.rs:15:5 --> $DIR/arrays.rs:14:5
| |
LL | let mut c = || { LL | let mut c = || {
| -- borrow of `arr` occurs here | -- borrow of `arr` occurs here
@ -22,7 +13,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0503]: cannot use `arr[_]` because it was mutably borrowed error[E0503]: cannot use `arr[_]` because it was mutably borrowed
--> $DIR/arrays.rs:15:5 --> $DIR/arrays.rs:14:5
| |
LL | let mut c = || { LL | let mut c = || {
| -- borrow of `arr` occurs here | -- borrow of `arr` occurs here
@ -36,7 +27,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0506]: cannot assign to `arr[_]` because it is borrowed error[E0506]: cannot assign to `arr[_]` because it is borrowed
--> $DIR/arrays.rs:30:5 --> $DIR/arrays.rs:29:5
| |
LL | let c = || { LL | let c = || {
| -- borrow of `arr[_]` occurs here | -- borrow of `arr[_]` occurs here
@ -50,7 +41,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0506]: cannot assign to `arr[_]` because it is borrowed error[E0506]: cannot assign to `arr[_]` because it is borrowed
--> $DIR/arrays.rs:44:5 --> $DIR/arrays.rs:43:5
| |
LL | let c = || { LL | let c = || {
| -- borrow of `arr[_]` occurs here | -- borrow of `arr[_]` occurs here
@ -64,7 +55,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0503]: cannot use `arr` because it was mutably borrowed error[E0503]: cannot use `arr` because it was mutably borrowed
--> $DIR/arrays.rs:58:20 --> $DIR/arrays.rs:57:20
| |
LL | let mut c = || { LL | let mut c = || {
| -- borrow of `arr` occurs here | -- borrow of `arr` occurs here
@ -78,7 +69,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0502]: cannot borrow `arr[_]` as immutable because it is also borrowed as mutable error[E0502]: cannot borrow `arr[_]` as immutable because it is also borrowed as mutable
--> $DIR/arrays.rs:58:20 --> $DIR/arrays.rs:57:20
| |
LL | let mut c = || { LL | let mut c = || {
| -- mutable borrow occurs here | -- mutable borrow occurs here
@ -92,7 +83,7 @@ LL | c();
| - mutable borrow later used here | - mutable borrow later used here
error[E0502]: cannot borrow `arr` as immutable because it is also borrowed as mutable error[E0502]: cannot borrow `arr` as immutable because it is also borrowed as mutable
--> $DIR/arrays.rs:74:24 --> $DIR/arrays.rs:73:24
| |
LL | let mut c = || { LL | let mut c = || {
| -- mutable borrow occurs here | -- mutable borrow occurs here
@ -105,7 +96,7 @@ LL | println!("{:#?}", &arr[3..2]);
LL | c(); LL | c();
| - mutable borrow later used here | - mutable borrow later used here
error: aborting due to 7 previous errors; 1 warning emitted error: aborting due to 7 previous errors
Some errors have detailed explanations: E0502, E0503, E0506. Some errors have detailed explanations: E0502, E0503, E0506.
For more information about an error, try `rustc --explain E0502`. For more information about an error, try `rustc --explain E0502`.

View file

@ -1,5 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug)] #[derive(Debug)]
struct Point { struct Point {

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/borrowck-1.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0499]: cannot borrow `p` as mutable more than once at a time error[E0499]: cannot borrow `p` as mutable more than once at a time
--> $DIR/borrowck-1.rs:13:17 --> $DIR/borrowck-1.rs:12:17
| |
LL | let y = &mut p.y; LL | let y = &mut p.y;
| -------- first mutable borrow occurs here | -------- first mutable borrow occurs here
@ -23,6 +14,6 @@ LL | println!("{:?}", p);
LL | *y+=1; LL | *y+=1;
| ----- first borrow later used here | ----- first borrow later used here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0499`. For more information about this error, try `rustc --explain E0499`.

View file

@ -1,5 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug)] #[derive(Debug)]
struct Point { struct Point {

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/borrowck-2.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-2.rs:13:17 --> $DIR/borrowck-2.rs:12:17
| |
LL | let y = &p.y; LL | let y = &p.y;
| ---- immutable borrow occurs here | ---- immutable borrow occurs here
@ -23,6 +14,6 @@ LL | let x = &mut p.x;
LL | println!("{}", y); LL | println!("{}", y);
| - immutable borrow later used here | - immutable borrow later used here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0502`. For more information about this error, try `rustc --explain E0502`.

View file

@ -1,5 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug)] #[derive(Debug)]
struct Point { struct Point {

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/borrowck-3.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0597]: `p` does not live long enough error[E0597]: `p` does not live long enough
--> $DIR/borrowck-3.rs:14:29 --> $DIR/borrowck-3.rs:13:29
| |
LL | let mut c = { LL | let mut c = {
| ----- borrow later stored here | ----- borrow later stored here
@ -22,6 +13,6 @@ LL | println!("{:?}", p);
LL | }; LL | };
| - `p` dropped here while still borrowed | - `p` dropped here while still borrowed
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`. For more information about this error, try `rustc --explain E0597`.

View file

@ -1,5 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug)] #[derive(Debug)]
struct Point { struct Point {

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/borrowck-4.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0373]: closure may outlive the current function, but it borrows `p`, which is owned by the current function error[E0373]: closure may outlive the current function, but it borrows `p`, which is owned by the current function
--> $DIR/borrowck-4.rs:11:17 --> $DIR/borrowck-4.rs:10:17
| |
LL | let mut c = || { LL | let mut c = || {
| ^^ may outlive borrowed value `p` | ^^ may outlive borrowed value `p`
@ -17,7 +8,7 @@ LL | println!("{:?}", p);
| - `p` is borrowed here | - `p` is borrowed here
| |
note: closure is returned here note: closure is returned here
--> $DIR/borrowck-4.rs:9:14 --> $DIR/borrowck-4.rs:8:14
| |
LL | fn foo () -> impl FnMut()->() { LL | fn foo () -> impl FnMut()->() {
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
@ -26,6 +17,6 @@ help: to force the closure to take ownership of `p` (and any other referenced va
LL | let mut c = move || { LL | let mut c = move || {
| ^^^^^^^ | ^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0373`. For more information about this error, try `rustc --explain E0373`.

View file

@ -1,8 +1,8 @@
// edition:2021
// Tests that two closures cannot simultaneously have mutable // Tests that two closures cannot simultaneously have mutable
// and immutable access to the variable. Issue #6801. // and immutable access to the variable. Issue #6801.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#![feature(box_syntax)] #![feature(box_syntax)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,12 +1,3 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/borrowck-closures-mut-and-imm.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-mut-and-imm.rs:17:14 --> $DIR/borrowck-closures-mut-and-imm.rs:17:14
| |
@ -25,6 +16,6 @@ LL | };
LL | drop(c2); LL | drop(c2);
| -- immutable borrow later used here | -- immutable borrow later used here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0502`. For more information about this error, try `rustc --explain E0502`.

View file

@ -1,7 +1,6 @@
// Test borrow checker when we precise capture when using boxes // edition:2021
#![feature(capture_disjoint_fields)] // Test borrow checker when we precise capture when using boxes
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
struct MetaData { x: String, name: String } struct MetaData { x: String, name: String }
struct Data { m: MetaData } struct Data { m: MetaData }

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/box.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
--> $DIR/box.rs:22:5 --> $DIR/box.rs:21:5
| |
LL | let mut c = || { LL | let mut c = || {
| -- borrow of `e.0.0.m.x` occurs here | -- borrow of `e.0.0.m.x` occurs here
@ -22,7 +13,7 @@ LL | c();
| - borrow later used here | - borrow later used here
error[E0502]: cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable error[E0502]: cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable
--> $DIR/box.rs:39:20 --> $DIR/box.rs:38:20
| |
LL | let mut c = || { LL | let mut c = || {
| -- mutable borrow occurs here | -- mutable borrow occurs here
@ -36,7 +27,7 @@ LL | c();
| - mutable borrow later used here | - mutable borrow later used here
error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed error[E0506]: cannot assign to `e.0.0.m.x` because it is borrowed
--> $DIR/box.rs:56:5 --> $DIR/box.rs:55:5
| |
LL | let c = || { LL | let c = || {
| -- borrow of `e.0.0.m.x` occurs here | -- borrow of `e.0.0.m.x` occurs here
@ -49,7 +40,7 @@ LL |
LL | c(); LL | c();
| - borrow later used here | - borrow later used here
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
Some errors have detailed explanations: E0502, E0506. Some errors have detailed explanations: E0502, E0506.
For more information about an error, try `rustc --explain E0502`. For more information about an error, try `rustc --explain E0502`.

View file

@ -1,9 +1,8 @@
// edition:2021
// Test that if we deref an immutable borrow to access a Place, // Test that if we deref an immutable borrow to access a Place,
// then we can't mutate the final place. // then we can't mutate the final place.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
fn main() { fn main() {
let mut x = (format!(""), format!("X2")); let mut x = (format!(""), format!("X2"));
let mut y = (&x, "Y"); let mut y = (&x, "Y");

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/cant-mutate-imm-borrow.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0596]: cannot borrow `z.0.0.0` as mutable, as it is behind a `&` reference error[E0596]: cannot borrow `z.0.0.0` as mutable, as it is behind a `&` reference
--> $DIR/cant-mutate-imm-borrow.rs:14:17 --> $DIR/cant-mutate-imm-borrow.rs:13:17
| |
LL | let mut c = || { LL | let mut c = || {
| ^^ cannot borrow as mutable | ^^ cannot borrow as mutable
@ -16,6 +7,6 @@ LL |
LL | z.0.0.0 = format!("X1"); LL | z.0.0.0 = format!("X1");
| ------- mutable borrow occurs due to use of `z.0.0.0` in closure | ------- mutable borrow occurs due to use of `z.0.0.0` in closure
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0596`. For more information about this error, try `rustc --explain E0596`.

View file

@ -1,5 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
// Ensure that diagnostics for mutability error (because the root variable // Ensure that diagnostics for mutability error (because the root variable
// isn't mutable) work with `capture_disjoint_fields` enabled. // isn't mutable) work with `capture_disjoint_fields` enabled.

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/cant-mutate-imm.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0594]: cannot assign to `z.0.0.0`, as it is not declared as mutable error[E0594]: cannot assign to `z.0.0.0`, as it is not declared as mutable
--> $DIR/cant-mutate-imm.rs:13:9 --> $DIR/cant-mutate-imm.rs:12:9
| |
LL | let z = (y, 10); LL | let z = (y, 10);
| - help: consider changing this to be mutable: `mut z` | - help: consider changing this to be mutable: `mut z`
@ -17,7 +8,7 @@ LL | z.0.0.0 = 20;
| ^^^^^^^^^^^^ cannot assign | ^^^^^^^^^^^^ cannot assign
error[E0594]: cannot assign to `*bx.0`, as it is not declared as mutable error[E0594]: cannot assign to `*bx.0`, as it is not declared as mutable
--> $DIR/cant-mutate-imm.rs:25:9 --> $DIR/cant-mutate-imm.rs:24:9
| |
LL | let bx = Box::new(x); LL | let bx = Box::new(x);
| -- help: consider changing this to be mutable: `mut bx` | -- help: consider changing this to be mutable: `mut bx`
@ -25,6 +16,6 @@ LL | let bx = Box::new(x);
LL | bx.0 = 20; LL | bx.0 = 20;
| ^^^^^^^^^ cannot assign | ^^^^^^^^^ cannot assign
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0594`. For more information about this error, try `rustc --explain E0594`.

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
// Test that array access is not stored as part of closure kind origin // Test that array access is not stored as part of closure kind origin

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-array-diagnostics.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
--> $DIR/closure-origin-array-diagnostics.rs:12:13 --> $DIR/closure-origin-array-diagnostics.rs:9:13
| |
LL | let c = || { LL | let c = || {
| ^^ this closure implements `FnOnce`, not `Fn` | ^^ this closure implements `FnOnce`, not `Fn`
@ -18,6 +9,6 @@ LL | };
LL | expect_fn(c); LL | expect_fn(c);
| --------- the requirement to implement `Fn` derives from here | --------- the requirement to implement `Fn` derives from here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0525`. For more information about this error, try `rustc --explain E0525`.

View file

@ -1,11 +1,7 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
// Check that precise paths are being reported back in the error message. // Check that precise paths are being reported back in the error message.
enum MultiVariant { enum MultiVariant {
Point(i32, i32), Point(i32, i32),
Meta(i32) Meta(i32)

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-multi-variant-diagnostics.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0382]: use of moved value: `c` error[E0382]: use of moved value: `c`
--> $DIR/closure-origin-multi-variant-diagnostics.rs:30:13 --> $DIR/closure-origin-multi-variant-diagnostics.rs:26:13
| |
LL | let a = c; LL | let a = c;
| - value moved here | - value moved here
@ -16,11 +7,11 @@ LL | let b = c;
| ^ value used here after move | ^ value used here after move
| |
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `point.0` out of its environment note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `point.0` out of its environment
--> $DIR/closure-origin-multi-variant-diagnostics.rs:20:52 --> $DIR/closure-origin-multi-variant-diagnostics.rs:16:52
| |
LL | if let MultiVariant::Point(ref mut x, _) = point { LL | if let MultiVariant::Point(ref mut x, _) = point {
| ^^^^^ | ^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`. For more information about this error, try `rustc --explain E0382`.

View file

@ -1,9 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
// Check that precise paths are being reported back in the error message.
enum SingleVariant { enum SingleVariant {
Point(i32, i32), Point(i32, i32),

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-single-variant-diagnostics.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0382]: use of moved value: `c` error[E0382]: use of moved value: `c`
--> $DIR/closure-origin-single-variant-diagnostics.rs:21:13 --> $DIR/closure-origin-single-variant-diagnostics.rs:17:13
| |
LL | let b = c; LL | let b = c;
| - value moved here | - value moved here
@ -16,11 +7,11 @@ LL | let a = c;
| ^ value used here after move | ^ value used here after move
| |
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `point.0` out of its environment note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `point.0` out of its environment
--> $DIR/closure-origin-single-variant-diagnostics.rs:16:50 --> $DIR/closure-origin-single-variant-diagnostics.rs:12:50
| |
LL | let SingleVariant::Point(ref mut x, _) = point; LL | let SingleVariant::Point(ref mut x, _) = point;
| ^^^^^ | ^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`. For more information about this error, try `rustc --explain E0382`.

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
// Check that precise paths are being reported back in the error message. // Check that precise paths are being reported back in the error message.

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-struct-diagnostics.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0382]: use of moved value: `hello` error[E0382]: use of moved value: `hello`
--> $DIR/closure-origin-struct-diagnostics.rs:24:13 --> $DIR/closure-origin-struct-diagnostics.rs:21:13
| |
LL | let b = hello; LL | let b = hello;
| ----- value moved here | ----- value moved here
@ -16,11 +7,11 @@ LL | let c = hello;
| ^^^^^ value used here after move | ^^^^^ value used here after move
| |
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `x.y.a` out of its environment note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `x.y.a` out of its environment
--> $DIR/closure-origin-struct-diagnostics.rs:20:9 --> $DIR/closure-origin-struct-diagnostics.rs:17:9
| |
LL | x.y.a += 1; LL | x.y.a += 1;
| ^^^^^ | ^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`. For more information about this error, try `rustc --explain E0382`.

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
// Check that precise paths are being reported back in the error message. // Check that precise paths are being reported back in the error message.

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-tuple-diagnostics-1.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0382]: use of moved value: `hello` error[E0382]: use of moved value: `hello`
--> $DIR/closure-origin-tuple-diagnostics-1.rs:15:13 --> $DIR/closure-origin-tuple-diagnostics-1.rs:12:13
| |
LL | let b = hello; LL | let b = hello;
| ----- value moved here | ----- value moved here
@ -16,11 +7,11 @@ LL | let c = hello;
| ^^^^^ value used here after move | ^^^^^ value used here after move
| |
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `x.0` out of its environment note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `x.0` out of its environment
--> $DIR/closure-origin-tuple-diagnostics-1.rs:11:9 --> $DIR/closure-origin-tuple-diagnostics-1.rs:8:9
| |
LL | x.0 += 1; LL | x.0 += 1;
| ^^^ | ^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0382`. For more information about this error, try `rustc --explain E0382`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
struct S(String, String); struct S(String, String);
fn expect_fn<F: Fn()>(_f: F) {} fn expect_fn<F: Fn()>(_f: F) {}

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closure-origin-tuple-diagnostics.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
--> $DIR/closure-origin-tuple-diagnostics.rs:11:13 --> $DIR/closure-origin-tuple-diagnostics.rs:9:13
| |
LL | let c = || { LL | let c = || {
| ^^ this closure implements `FnOnce`, not `Fn` | ^^ this closure implements `FnOnce`, not `Fn`
@ -18,6 +9,6 @@ LL | };
LL | expect_fn(c); LL | expect_fn(c);
| --------- the requirement to implement `Fn` derives from here | --------- the requirement to implement `Fn` derives from here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0525`. For more information about this error, try `rustc --explain E0525`.

View file

@ -1,6 +1,6 @@
// edition:2021
// check-pass // check-pass
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#![allow(unreachable_code)] #![allow(unreachable_code)]
#![warn(unused)] #![warn(unused)]

View file

@ -1,12 +1,3 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/liveness.rs:2:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: value captured by `a` is never read warning: value captured by `a` is never read
--> $DIR/liveness.rs:23:9 --> $DIR/liveness.rs:23:9
| |
@ -75,5 +66,5 @@ LL | b = Some("e1");
| |
= help: did you mean to capture by reference instead? = help: did you mean to capture by reference instead?
warning: 8 warnings emitted warning: 7 warnings emitted

View file

@ -1,6 +1,6 @@
// edition:2021
// check-pass // check-pass
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#![warn(unused)] #![warn(unused)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -1,12 +1,3 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/liveness_unintentional_copy.rs:2:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: value assigned to `a` is never read warning: value assigned to `a` is never read
--> $DIR/liveness_unintentional_copy.rs:19:9 --> $DIR/liveness_unintentional_copy.rs:19:9
| |
@ -43,5 +34,5 @@ LL | a += x;
| |
= help: did you mean to capture by reference instead? = help: did you mean to capture by reference instead?
warning: 4 warnings emitted warning: 3 warnings emitted

View file

@ -1,8 +1,8 @@
// edition:2021
// Test that when a borrow checker diagnostics are emitted, it's as precise // Test that when a borrow checker diagnostics are emitted, it's as precise
// as the capture by the closure. // as the capture by the closure.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#![allow(unused)] #![allow(unused)]
struct Point { struct Point {

View file

@ -1,12 +1,3 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/multilevel-path.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0499]: cannot borrow `w.p.x` as mutable more than once at a time error[E0499]: cannot borrow `w.p.x` as mutable more than once at a time
--> $DIR/multilevel-path.rs:23:14 --> $DIR/multilevel-path.rs:23:14
| |
@ -21,6 +12,6 @@ LL |
LL | c(); LL | c();
| - first borrow later used here | - first borrow later used here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0499`. For more information about this error, try `rustc --explain E0499`.

View file

@ -1,9 +1,8 @@
// edition:2021
// Test that we can't mutate a place if we need to deref an imm-borrow // Test that we can't mutate a place if we need to deref an imm-borrow
// to reach it. // to reach it.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
fn imm_mut_ref() { fn imm_mut_ref() {
let mut x = String::new(); let mut x = String::new();
let y = String::new(); let y = String::new();

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/mut_ref.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0596]: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference error[E0596]: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference
--> $DIR/mut_ref.rs:13:13 --> $DIR/mut_ref.rs:12:13
| |
LL | let ref_mref_x = &mref_x; LL | let ref_mref_x = &mref_x;
| ------- help: consider changing this to be a mutable reference: `&mut mref_x` | ------- help: consider changing this to be a mutable reference: `&mut mref_x`
@ -20,7 +11,7 @@ LL | **ref_mref_x = y;
| ------------ mutable borrow occurs due to use of `**ref_mref_x` in closure | ------------ mutable borrow occurs due to use of `**ref_mref_x` in closure
error[E0596]: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference error[E0596]: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference
--> $DIR/mut_ref.rs:27:13 --> $DIR/mut_ref.rs:26:13
| |
LL | let c = || { LL | let c = || {
| ^^ cannot borrow as mutable | ^^ cannot borrow as mutable
@ -28,6 +19,6 @@ LL |
LL | **mref_ref_x = y; LL | **mref_ref_x = y;
| ------------ mutable borrow occurs due to use of `**mref_ref_x` in closure | ------------ mutable borrow occurs due to use of `**mref_ref_x` in closure
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0596`. For more information about this error, try `rustc --explain E0596`.

View file

@ -1,7 +1,6 @@
// check-pass // edition:2021
#![feature(capture_disjoint_fields)] // check-pass
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
// Given how the closure desugaring is implemented (at least at the time of writing this test), // Given how the closure desugaring is implemented (at least at the time of writing this test),
// we don't need to truncate the captured path to a reference into a packed-struct if the field // we don't need to truncate the captured path to a reference into a packed-struct if the field

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/repr_packed.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: reference to packed field is unaligned warning: reference to packed field is unaligned
--> $DIR/repr_packed.rs:25:24 --> $DIR/repr_packed.rs:24:24
| |
LL | println!("{}", foo.x); LL | println!("{}", foo.x);
| ^^^^^ | ^^^^^
@ -18,5 +9,5 @@ LL | println!("{}", foo.x);
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
warning: 2 warnings emitted warning: 1 warning emitted

View file

@ -1,9 +1,8 @@
// edition:2021
// Test that borrow checker error is accurate and that min capture pass of the // Test that borrow checker error is accurate and that min capture pass of the
// closure analysis is working as expected. // closure analysis is working as expected.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug)] #[derive(Debug)]
struct Point { struct Point {
x: i32, x: i32,

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/simple-struct-min-capture.rs:4:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
--> $DIR/simple-struct-min-capture.rs:23:22 --> $DIR/simple-struct-min-capture.rs:22:22
| |
LL | let mut c = || { LL | let mut c = || {
| -- mutable borrow occurs here | -- mutable borrow occurs here
@ -23,6 +14,6 @@ LL |
LL | c(); LL | c();
| - mutable borrow later used here | - mutable borrow later used here
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error
For more information about this error, try `rustc --explain E0502`. For more information about this error, try `rustc --explain E0502`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/feature-gate-capture_disjoint_fields.rs:10:13 --> $DIR/feature-gate-capture_disjoint_fields.rs:8:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/feature-gate-capture_disjoint_fields.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/feature-gate-capture_disjoint_fields.rs:13:5 --> $DIR/feature-gate-capture_disjoint_fields.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing s[] -> ImmBorrow note: Capturing s[] -> ImmBorrow
--> $DIR/feature-gate-capture_disjoint_fields.rs:16:69 --> $DIR/feature-gate-capture_disjoint_fields.rs:14:69
| |
LL | println!("This uses new capture analyysis to capture s={}", s); LL | println!("This uses new capture analyysis to capture s={}", s);
| ^ | ^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/feature-gate-capture_disjoint_fields.rs:13:5 --> $DIR/feature-gate-capture_disjoint_fields.rs:11:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture s[] -> ImmBorrow note: Min Capture s[] -> ImmBorrow
--> $DIR/feature-gate-capture_disjoint_fields.rs:16:69 --> $DIR/feature-gate-capture_disjoint_fields.rs:14:69
| |
LL | println!("This uses new capture analyysis to capture s={}", s); LL | println!("This uses new capture analyysis to capture s={}", s);
| ^ | ^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,5 @@
// FIXME(arora-aman) add run-pass once 2229 is implemented // edition:2021
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
struct Filter { struct Filter {

View file

@ -1,35 +1,26 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/filter-on-struct-member.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/filter-on-struct-member.rs:28:13 --> $DIR/filter-on-struct-member.rs:24:13
| |
LL | |v| self.filter.allowed(*v), LL | |v| self.filter.allowed(*v),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: Capturing self[Deref,(0, 0)] -> ImmBorrow note: Capturing self[Deref,(0, 0)] -> ImmBorrow
--> $DIR/filter-on-struct-member.rs:28:17 --> $DIR/filter-on-struct-member.rs:24:17
| |
LL | |v| self.filter.allowed(*v), LL | |v| self.filter.allowed(*v),
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/filter-on-struct-member.rs:28:13 --> $DIR/filter-on-struct-member.rs:24:13
| |
LL | |v| self.filter.allowed(*v), LL | |v| self.filter.allowed(*v),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: Min Capture self[Deref,(0, 0)] -> ImmBorrow note: Min Capture self[Deref,(0, 0)] -> ImmBorrow
--> $DIR/filter-on-struct-member.rs:28:17 --> $DIR/filter-on-struct-member.rs:24:17
| |
LL | |v| self.filter.allowed(*v), LL | |v| self.filter.allowed(*v),
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors

View file

@ -1,9 +1,7 @@
// edition:2021
// Test that move closures drop derefs with `capture_disjoint_fields` enabled. // Test that move closures drop derefs with `capture_disjoint_fields` enabled.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
fn simple_move_closure() { fn simple_move_closure() {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:14:17 --> $DIR/move_closure.rs:12:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:32:17 --> $DIR/move_closure.rs:30:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:53:17 --> $DIR/move_closure.rs:51:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:76:17 --> $DIR/move_closure.rs:74:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -35,7 +35,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:98:17 --> $DIR/move_closure.rs:96:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -44,7 +44,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:120:13 --> $DIR/move_closure.rs:118:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -53,7 +53,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:137:13 --> $DIR/move_closure.rs:135:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -62,7 +62,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/move_closure.rs:154:13 --> $DIR/move_closure.rs:152:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -70,17 +70,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/move_closure.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:17:5 --> $DIR/move_closure.rs:15:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -92,13 +83,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),(0, 0)] -> ByValue note: Capturing t[(0, 0),(0, 0)] -> ByValue
--> $DIR/move_closure.rs:20:9 --> $DIR/move_closure.rs:18:9
| |
LL | t.0.0 = "new S".into(); LL | t.0.0 = "new S".into();
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:17:5 --> $DIR/move_closure.rs:15:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -110,13 +101,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0),(0, 0)] -> ByValue note: Min Capture t[(0, 0),(0, 0)] -> ByValue
--> $DIR/move_closure.rs:20:9 --> $DIR/move_closure.rs:18:9
| |
LL | t.0.0 = "new S".into(); LL | t.0.0 = "new S".into();
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:35:5 --> $DIR/move_closure.rs:33:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -128,13 +119,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing ref_s[Deref] -> UniqueImmBorrow note: Capturing ref_s[Deref] -> UniqueImmBorrow
--> $DIR/move_closure.rs:38:9 --> $DIR/move_closure.rs:36:9
| |
LL | *ref_s += 10; LL | *ref_s += 10;
| ^^^^^^ | ^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:35:5 --> $DIR/move_closure.rs:33:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -146,13 +137,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture ref_s[Deref] -> UniqueImmBorrow note: Min Capture ref_s[Deref] -> UniqueImmBorrow
--> $DIR/move_closure.rs:38:9 --> $DIR/move_closure.rs:36:9
| |
LL | *ref_s += 10; LL | *ref_s += 10;
| ^^^^^^ | ^^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:56:5 --> $DIR/move_closure.rs:54:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -164,13 +155,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow note: Capturing t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
--> $DIR/move_closure.rs:59:9 --> $DIR/move_closure.rs:57:9
| |
LL | t.0.0 = "new s".into(); LL | t.0.0 = "new s".into();
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:56:5 --> $DIR/move_closure.rs:54:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -182,13 +173,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow note: Min Capture t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
--> $DIR/move_closure.rs:59:9 --> $DIR/move_closure.rs:57:9
| |
LL | t.0.0 = "new s".into(); LL | t.0.0 = "new s".into();
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:79:5 --> $DIR/move_closure.rs:77:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -200,13 +191,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow
--> $DIR/move_closure.rs:82:18 --> $DIR/move_closure.rs:80:18
| |
LL | let _t = t.0.0; LL | let _t = t.0.0;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:79:5 --> $DIR/move_closure.rs:77:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -218,13 +209,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0),Deref,(0, 0)] -> ImmBorrow note: Min Capture t[(0, 0),Deref,(0, 0)] -> ImmBorrow
--> $DIR/move_closure.rs:82:18 --> $DIR/move_closure.rs:80:18
| |
LL | let _t = t.0.0; LL | let _t = t.0.0;
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:101:5 --> $DIR/move_closure.rs:99:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -236,18 +227,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow
--> $DIR/move_closure.rs:104:18 --> $DIR/move_closure.rs:102:18
| |
LL | let _t = t.0.0; LL | let _t = t.0.0;
| ^^^^^ | ^^^^^
note: Capturing t[(0, 0)] -> ByValue note: Capturing t[(0, 0)] -> ByValue
--> $DIR/move_closure.rs:104:18 --> $DIR/move_closure.rs:102:18
| |
LL | let _t = t.0.0; LL | let _t = t.0.0;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:101:5 --> $DIR/move_closure.rs:99:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -259,13 +250,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(0, 0)] -> ByValue note: Min Capture t[(0, 0)] -> ByValue
--> $DIR/move_closure.rs:104:18 --> $DIR/move_closure.rs:102:18
| |
LL | let _t = t.0.0; LL | let _t = t.0.0;
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:123:5 --> $DIR/move_closure.rs:121:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -277,18 +268,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing b[Deref,(0, 0)] -> ByValue note: Capturing b[Deref,(0, 0)] -> ByValue
--> $DIR/move_closure.rs:126:18 --> $DIR/move_closure.rs:124:18
| |
LL | let _t = b.0; LL | let _t = b.0;
| ^^^ | ^^^
note: Capturing b[] -> ByValue note: Capturing b[] -> ByValue
--> $DIR/move_closure.rs:126:18 --> $DIR/move_closure.rs:124:18
| |
LL | let _t = b.0; LL | let _t = b.0;
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:123:5 --> $DIR/move_closure.rs:121:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -300,13 +291,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture b[] -> ByValue note: Min Capture b[] -> ByValue
--> $DIR/move_closure.rs:126:18 --> $DIR/move_closure.rs:124:18
| |
LL | let _t = b.0; LL | let _t = b.0;
| ^^^ | ^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:140:5 --> $DIR/move_closure.rs:138:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -318,13 +309,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing b[Deref,(0, 0)] -> ByValue note: Capturing b[Deref,(0, 0)] -> ByValue
--> $DIR/move_closure.rs:143:24 --> $DIR/move_closure.rs:141:24
| |
LL | println!("{}", b.0); LL | println!("{}", b.0);
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:140:5 --> $DIR/move_closure.rs:138:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -336,13 +327,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture b[] -> ByValue note: Min Capture b[] -> ByValue
--> $DIR/move_closure.rs:143:24 --> $DIR/move_closure.rs:141:24
| |
LL | println!("{}", b.0); LL | println!("{}", b.0);
| ^^^ | ^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/move_closure.rs:157:5 --> $DIR/move_closure.rs:155:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -354,13 +345,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing t[(1, 0),Deref,(0, 0)] -> ByValue note: Capturing t[(1, 0),Deref,(0, 0)] -> ByValue
--> $DIR/move_closure.rs:160:24 --> $DIR/move_closure.rs:158:24
| |
LL | println!("{}", t.1.0); LL | println!("{}", t.1.0);
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/move_closure.rs:157:5 --> $DIR/move_closure.rs:155:5
| |
LL | / move || { LL | / move || {
LL | | LL | |
@ -372,11 +363,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture t[(1, 0)] -> ByValue note: Min Capture t[(1, 0)] -> ByValue
--> $DIR/move_closure.rs:160:24 --> $DIR/move_closure.rs:158:24
| |
LL | println!("{}", t.1.0); LL | println!("{}", t.1.0);
| ^^^^^ | ^^^^^
error: aborting due to 24 previous errors; 1 warning emitted error: aborting due to 24 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(unused)] #![allow(unused)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/multilevel-path-1.rs:24:13 --> $DIR/multilevel-path-1.rs:22:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/multilevel-path-1.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/multilevel-path-1.rs:27:5 --> $DIR/multilevel-path-1.rs:25:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing w[(0, 0)] -> ImmBorrow note: Capturing w[(0, 0)] -> ImmBorrow
--> $DIR/multilevel-path-1.rs:30:19 --> $DIR/multilevel-path-1.rs:28:19
| |
LL | let wp = &w.p; LL | let wp = &w.p;
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/multilevel-path-1.rs:27:5 --> $DIR/multilevel-path-1.rs:25:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture w[(0, 0)] -> ImmBorrow note: Min Capture w[(0, 0)] -> ImmBorrow
--> $DIR/multilevel-path-1.rs:30:19 --> $DIR/multilevel-path-1.rs:28:19
| |
LL | let wp = &w.p; LL | let wp = &w.p;
| ^^^ | ^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,5 @@
// FIXME(arora-aman) add run-pass once 2229 is implemented // edition:2021
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(unused)] #![allow(unused)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/multilevel-path-2.rs:21:13 --> $DIR/multilevel-path-2.rs:17:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/multilevel-path-2.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/multilevel-path-2.rs:24:5 --> $DIR/multilevel-path-2.rs:20:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing w[(0, 0),(0, 0)] -> ImmBorrow note: Capturing w[(0, 0),(0, 0)] -> ImmBorrow
--> $DIR/multilevel-path-2.rs:27:24 --> $DIR/multilevel-path-2.rs:23:24
| |
LL | println!("{}", w.p.x); LL | println!("{}", w.p.x);
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/multilevel-path-2.rs:24:5 --> $DIR/multilevel-path-2.rs:20:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture w[(0, 0),(0, 0)] -> ImmBorrow note: Min Capture w[(0, 0),(0, 0)] -> ImmBorrow
--> $DIR/multilevel-path-2.rs:27:24 --> $DIR/multilevel-path-2.rs:23:24
| |
LL | println!("{}", w.p.x); LL | println!("{}", w.p.x);
| ^^^^^ | ^^^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,5 @@
// FIXME(arora-aman) add run-pass once 2229 is implemented // edition:2021
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
struct Point { struct Point {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/nested-closure.rs:23:18 --> $DIR/nested-closure.rs:19:18
| |
LL | let mut c1 = #[rustc_capture_analysis] LL | let mut c1 = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let mut c1 = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/nested-closure.rs:33:22 --> $DIR/nested-closure.rs:29:22
| |
LL | let mut c2 = #[rustc_capture_analysis] LL | let mut c2 = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -16,51 +16,42 @@ LL | let mut c2 = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/nested-closure.rs:3:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/nested-closure.rs:36:9 --> $DIR/nested-closure.rs:32:9
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
note: Capturing p[(1, 0)] -> MutBorrow note: Capturing p[(1, 0)] -> MutBorrow
--> $DIR/nested-closure.rs:36:12 --> $DIR/nested-closure.rs:32:12
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^ | ^^^
note: Capturing incr[] -> ImmBorrow note: Capturing incr[] -> ImmBorrow
--> $DIR/nested-closure.rs:36:19 --> $DIR/nested-closure.rs:32:19
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^^ | ^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/nested-closure.rs:36:9 --> $DIR/nested-closure.rs:32:9
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
note: Min Capture p[(1, 0)] -> MutBorrow note: Min Capture p[(1, 0)] -> MutBorrow
--> $DIR/nested-closure.rs:36:12 --> $DIR/nested-closure.rs:32:12
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^ | ^^^
note: Min Capture incr[] -> ImmBorrow note: Min Capture incr[] -> ImmBorrow
--> $DIR/nested-closure.rs:36:19 --> $DIR/nested-closure.rs:32:19
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^^ | ^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/nested-closure.rs:26:5 --> $DIR/nested-closure.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -72,18 +63,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing p[(0, 0)] -> ImmBorrow note: Capturing p[(0, 0)] -> ImmBorrow
--> $DIR/nested-closure.rs:29:24 --> $DIR/nested-closure.rs:25:24
| |
LL | println!("{}", p.x); LL | println!("{}", p.x);
| ^^^ | ^^^
note: Capturing p[(1, 0)] -> MutBorrow note: Capturing p[(1, 0)] -> MutBorrow
--> $DIR/nested-closure.rs:36:12 --> $DIR/nested-closure.rs:32:12
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^ | ^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/nested-closure.rs:26:5 --> $DIR/nested-closure.rs:22:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -95,16 +86,16 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture p[(0, 0)] -> ImmBorrow note: Min Capture p[(0, 0)] -> ImmBorrow
--> $DIR/nested-closure.rs:29:24 --> $DIR/nested-closure.rs:25:24
| |
LL | println!("{}", p.x); LL | println!("{}", p.x);
| ^^^ | ^^^
note: Min Capture p[(1, 0)] -> MutBorrow note: Min Capture p[(1, 0)] -> MutBorrow
--> $DIR/nested-closure.rs:36:12 --> $DIR/nested-closure.rs:32:12
| |
LL | || p.y += incr; LL | || p.y += incr;
| ^^^ | ^^^
error: aborting due to 6 previous errors; 1 warning emitted error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
struct Point { struct Point {

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/path-with-array-access.rs:25:13 --> $DIR/path-with-array-access.rs:23:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/path-with-array-access.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/path-with-array-access.rs:28:5 --> $DIR/path-with-array-access.rs:26:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -29,13 +20,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing pent[(0, 0)] -> ImmBorrow note: Capturing pent[(0, 0)] -> ImmBorrow
--> $DIR/path-with-array-access.rs:31:24 --> $DIR/path-with-array-access.rs:29:24
| |
LL | println!("{}", pent.points[5].x); LL | println!("{}", pent.points[5].x);
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/path-with-array-access.rs:28:5 --> $DIR/path-with-array-access.rs:26:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,11 +38,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture pent[(0, 0)] -> ImmBorrow note: Min Capture pent[(0, 0)] -> ImmBorrow
--> $DIR/path-with-array-access.rs:31:24 --> $DIR/path-with-array-access.rs:29:24
| |
LL | println!("{}", pent.points[5].x); LL | println!("{}", pent.points[5].x);
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(never_type)] #![feature(never_type)]
// Should fake read the discriminant and throw an error // Should fake read the discriminant and throw an error

View file

@ -1,14 +1,5 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/pattern-matching-should-fail.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error[E0004]: non-exhaustive patterns: type `u8` is non-empty error[E0004]: non-exhaustive patterns: type `u8` is non-empty
--> $DIR/pattern-matching-should-fail.rs:72:23 --> $DIR/pattern-matching-should-fail.rs:70:23
| |
LL | let c1 = || match x { }; LL | let c1 = || match x { };
| ^ | ^
@ -17,13 +8,13 @@ LL | let c1 = || match x { };
= note: the matched value is of type `u8` = note: the matched value is of type `u8`
error[E0381]: use of possibly-uninitialized variable: `x` error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/pattern-matching-should-fail.rs:10:23 --> $DIR/pattern-matching-should-fail.rs:8:23
| |
LL | let c1 = || match x { }; LL | let c1 = || match x { };
| ^ use of possibly-uninitialized `x` | ^ use of possibly-uninitialized `x`
error[E0381]: borrow of possibly-uninitialized variable: `x` error[E0381]: borrow of possibly-uninitialized variable: `x`
--> $DIR/pattern-matching-should-fail.rs:17:14 --> $DIR/pattern-matching-should-fail.rs:15:14
| |
LL | let c2 = || match x { _ => () }; LL | let c2 = || match x { _ => () };
| ^^ - borrow occurs due to use in closure | ^^ - borrow occurs due to use in closure
@ -31,7 +22,7 @@ LL | let c2 = || match x { _ => () };
| use of possibly-uninitialized `x` | use of possibly-uninitialized `x`
error[E0381]: borrow of possibly-uninitialized variable: `variant` error[E0381]: borrow of possibly-uninitialized variable: `variant`
--> $DIR/pattern-matching-should-fail.rs:29:13 --> $DIR/pattern-matching-should-fail.rs:27:13
| |
LL | let c = || { LL | let c = || {
| ^^ use of possibly-uninitialized `variant` | ^^ use of possibly-uninitialized `variant`
@ -40,7 +31,7 @@ LL | match variant {
| ------- borrow occurs due to use in closure | ------- borrow occurs due to use in closure
error[E0381]: borrow of possibly-uninitialized variable: `variant` error[E0381]: borrow of possibly-uninitialized variable: `variant`
--> $DIR/pattern-matching-should-fail.rs:41:13 --> $DIR/pattern-matching-should-fail.rs:39:13
| |
LL | let c = || { LL | let c = || {
| ^^ use of possibly-uninitialized `variant` | ^^ use of possibly-uninitialized `variant`
@ -49,24 +40,24 @@ LL | match variant {
| ------- borrow occurs due to use in closure | ------- borrow occurs due to use in closure
error[E0381]: use of possibly-uninitialized variable: `g` error[E0381]: use of possibly-uninitialized variable: `g`
--> $DIR/pattern-matching-should-fail.rs:57:15 --> $DIR/pattern-matching-should-fail.rs:55:15
| |
LL | match g { }; LL | match g { };
| ^ use of possibly-uninitialized `g` | ^ use of possibly-uninitialized `g`
error[E0381]: use of possibly-uninitialized variable: `t` error[E0381]: use of possibly-uninitialized variable: `t`
--> $DIR/pattern-matching-should-fail.rs:60:19 --> $DIR/pattern-matching-should-fail.rs:58:19
| |
LL | match t { }; LL | match t { };
| ^ use of possibly-uninitialized `t` | ^ use of possibly-uninitialized `t`
error[E0381]: use of possibly-uninitialized variable: `x` error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/pattern-matching-should-fail.rs:72:23 --> $DIR/pattern-matching-should-fail.rs:70:23
| |
LL | let c1 = || match x { }; LL | let c1 = || match x { };
| ^ use of possibly-uninitialized `x` | ^ use of possibly-uninitialized `x`
error: aborting due to 8 previous errors; 1 warning emitted error: aborting due to 8 previous errors
Some errors have detailed explanations: E0004, E0381. Some errors have detailed explanations: E0004, E0381.
For more information about an error, try `rustc --explain E0004`. For more information about an error, try `rustc --explain E0004`.

View file

@ -1,7 +1,5 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
// Should capture the discriminant since a variant of a multivariant enum is // Should capture the discriminant since a variant of a multivariant enum is

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:12:14 --> $DIR/patterns-capture-analysis.rs:10:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:33:14 --> $DIR/patterns-capture-analysis.rs:31:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:54:14 --> $DIR/patterns-capture-analysis.rs:52:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:70:14 --> $DIR/patterns-capture-analysis.rs:68:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -35,7 +35,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:92:14 --> $DIR/patterns-capture-analysis.rs:90:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -44,7 +44,7 @@ LL | let c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/patterns-capture-analysis.rs:116:14 --> $DIR/patterns-capture-analysis.rs:114:14
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -52,17 +52,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/patterns-capture-analysis.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:16:5 --> $DIR/patterns-capture-analysis.rs:14:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -74,13 +65,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing variant[] -> ImmBorrow note: Capturing variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:19:15 --> $DIR/patterns-capture-analysis.rs:17:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/patterns-capture-analysis.rs:16:5 --> $DIR/patterns-capture-analysis.rs:14:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -92,13 +83,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture variant[] -> ImmBorrow note: Min Capture variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:19:15 --> $DIR/patterns-capture-analysis.rs:17:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:36:5 --> $DIR/patterns-capture-analysis.rs:34:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -109,7 +100,7 @@ LL | | };
| |_____^ | |_____^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:57:5 --> $DIR/patterns-capture-analysis.rs:55:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -120,7 +111,7 @@ LL | | };
| |_____^ | |_____^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:73:5 --> $DIR/patterns-capture-analysis.rs:71:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -132,18 +123,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing variant[] -> ImmBorrow note: Capturing variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:76:15 --> $DIR/patterns-capture-analysis.rs:74:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
note: Capturing variant[(0, 0)] -> ImmBorrow note: Capturing variant[(0, 0)] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:76:15 --> $DIR/patterns-capture-analysis.rs:74:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/patterns-capture-analysis.rs:73:5 --> $DIR/patterns-capture-analysis.rs:71:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -155,13 +146,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture variant[] -> ImmBorrow note: Min Capture variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:76:15 --> $DIR/patterns-capture-analysis.rs:74:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:95:5 --> $DIR/patterns-capture-analysis.rs:93:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -172,7 +163,7 @@ LL | | };
| |_____^ | |_____^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/patterns-capture-analysis.rs:119:5 --> $DIR/patterns-capture-analysis.rs:117:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -184,13 +175,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing variant[] -> ImmBorrow note: Capturing variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:122:15 --> $DIR/patterns-capture-analysis.rs:120:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/patterns-capture-analysis.rs:119:5 --> $DIR/patterns-capture-analysis.rs:117:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -202,11 +193,11 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture variant[] -> ImmBorrow note: Min Capture variant[] -> ImmBorrow
--> $DIR/patterns-capture-analysis.rs:122:15 --> $DIR/patterns-capture-analysis.rs:120:15
| |
LL | match variant { LL | match variant {
| ^^^^^^^ | ^^^^^^^
error: aborting due to 15 previous errors; 1 warning emitted error: aborting due to 15 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,4 @@
#![feature(capture_disjoint_fields)] // edition:2021
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| `#[warn(incomplete_features)]` on by default
//~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]

View file

@ -1,5 +1,5 @@
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/repr_packed.rs:16:17 --> $DIR/repr_packed.rs:13:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/repr_packed.rs:47:17 --> $DIR/repr_packed.rs:44:17
| |
LL | let mut c = #[rustc_capture_analysis] LL | let mut c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | let mut c = #[rustc_capture_analysis]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error[E0658]: attributes on expressions are experimental error[E0658]: attributes on expressions are experimental
--> $DIR/repr_packed.rs:81:13 --> $DIR/repr_packed.rs:78:13
| |
LL | let c = #[rustc_capture_analysis] LL | let c = #[rustc_capture_analysis]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -25,17 +25,8 @@ LL | let c = #[rustc_capture_analysis]
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/repr_packed.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/repr_packed.rs:19:5 --> $DIR/repr_packed.rs:16:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -47,18 +38,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing foo[(0, 0)] -> ImmBorrow note: Capturing foo[(0, 0)] -> ImmBorrow
--> $DIR/repr_packed.rs:22:24 --> $DIR/repr_packed.rs:19:24
| |
LL | let z1: &u8 = &foo.x; LL | let z1: &u8 = &foo.x;
| ^^^^^ | ^^^^^
note: Capturing foo[(1, 0)] -> MutBorrow note: Capturing foo[(1, 0)] -> MutBorrow
--> $DIR/repr_packed.rs:25:32 --> $DIR/repr_packed.rs:22:32
| |
LL | let z2: &mut u8 = &mut foo.y; LL | let z2: &mut u8 = &mut foo.y;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/repr_packed.rs:19:5 --> $DIR/repr_packed.rs:16:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -70,18 +61,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture foo[(0, 0)] -> ImmBorrow note: Min Capture foo[(0, 0)] -> ImmBorrow
--> $DIR/repr_packed.rs:22:24 --> $DIR/repr_packed.rs:19:24
| |
LL | let z1: &u8 = &foo.x; LL | let z1: &u8 = &foo.x;
| ^^^^^ | ^^^^^
note: Min Capture foo[(1, 0)] -> MutBorrow note: Min Capture foo[(1, 0)] -> MutBorrow
--> $DIR/repr_packed.rs:25:32 --> $DIR/repr_packed.rs:22:32
| |
LL | let z2: &mut u8 = &mut foo.y; LL | let z2: &mut u8 = &mut foo.y;
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/repr_packed.rs:50:5 --> $DIR/repr_packed.rs:47:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -93,13 +84,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing foo[] -> MutBorrow note: Capturing foo[] -> MutBorrow
--> $DIR/repr_packed.rs:54:33 --> $DIR/repr_packed.rs:51:33
| |
LL | let z2: &mut u16 = &mut foo.y; LL | let z2: &mut u16 = &mut foo.y;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/repr_packed.rs:50:5 --> $DIR/repr_packed.rs:47:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -111,13 +102,13 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture foo[] -> MutBorrow note: Min Capture foo[] -> MutBorrow
--> $DIR/repr_packed.rs:54:33 --> $DIR/repr_packed.rs:51:33
| |
LL | let z2: &mut u16 = &mut foo.y; LL | let z2: &mut u16 = &mut foo.y;
| ^^^^^ | ^^^^^
error: First Pass analysis includes: error: First Pass analysis includes:
--> $DIR/repr_packed.rs:84:5 --> $DIR/repr_packed.rs:81:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -129,18 +120,18 @@ LL | | };
| |_____^ | |_____^
| |
note: Capturing foo[] -> ImmBorrow note: Capturing foo[] -> ImmBorrow
--> $DIR/repr_packed.rs:87:24 --> $DIR/repr_packed.rs:84:24
| |
LL | println!("{}", foo.x); LL | println!("{}", foo.x);
| ^^^^^ | ^^^^^
note: Capturing foo[(0, 0)] -> ByValue note: Capturing foo[(0, 0)] -> ByValue
--> $DIR/repr_packed.rs:91:18 --> $DIR/repr_packed.rs:88:18
| |
LL | let _z = foo.x; LL | let _z = foo.x;
| ^^^^^ | ^^^^^
error: Min Capture analysis includes: error: Min Capture analysis includes:
--> $DIR/repr_packed.rs:84:5 --> $DIR/repr_packed.rs:81:5
| |
LL | / || { LL | / || {
LL | | LL | |
@ -152,7 +143,7 @@ LL | | };
| |_____^ | |_____^
| |
note: Min Capture foo[] -> ByValue note: Min Capture foo[] -> ByValue
--> $DIR/repr_packed.rs:87:24 --> $DIR/repr_packed.rs:84:24
| |
LL | println!("{}", foo.x); LL | println!("{}", foo.x);
| ^^^^^ foo[] used here | ^^^^^ foo[] used here
@ -160,6 +151,6 @@ LL | println!("{}", foo.x);
LL | let _z = foo.x; LL | let _z = foo.x;
| ^^^^^ foo[] captured as ByValue here | ^^^^^ foo[] captured as ByValue here
error: aborting due to 9 previous errors; 1 warning emitted error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,13 +1,8 @@
// edition:2021
// run-pass // run-pass
// Test precise capture when using boxes // Test precise capture when using boxes
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
struct MetaData { x: String, name: String } struct MetaData { x: String, name: String }
struct Data { m: MetaData } struct Data { m: MetaData }
struct BoxedData(Box<Data>); struct BoxedData(Box<Data>);

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/box.rs:5:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,11 +1,9 @@
// edition:2021
// run-pass // run-pass
// Test that ByValue captures compile sucessefully especially when the captures are // Test that ByValue captures compile sucessefully especially when the captures are
// derefenced within the closure. // derefenced within the closure.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#[derive(Debug, Default)] #[derive(Debug, Default)]
struct SomeLargeType; struct SomeLargeType;
struct MuchLargerType([SomeLargeType; 32]); struct MuchLargerType([SomeLargeType; 32]);

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/by_value.rs:6:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,13 +1,9 @@
// edition:2021
// run-pass // run-pass
// Test that we can immutably borrow field of an instance of a structure from within a closure, // Test that we can immutably borrow field of an instance of a structure from within a closure,
// while having a mutable borrow to another field of the same instance outside the closure. // while having a mutable borrow to another field of the same instance outside the closure.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
struct Point { struct Point {
x: i32, x: i32,
y: i32, y: i32,

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-disjoint-field-struct.rs:6:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,12 +1,9 @@
// edition:2021
// run-pass // run-pass
// Test that we can mutate an element of a tuple from within a closure // Test that we can mutate an element of a tuple from within a closure
// while immutably borrowing another element of the same tuple outside the closure. // while immutably borrowing another element of the same tuple outside the closure.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
fn main() { fn main() {

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-disjoint-field-tuple-mut.rs:6:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,12 +1,9 @@
// edition:2021
// run-pass // run-pass
// Test that we can immutably borrow an element of a tuple from within a closure, // Test that we can immutably borrow an element of a tuple from within a closure,
// while having a mutable borrow to another element of the same tuple outside the closure. // while having a mutable borrow to another element of the same tuple outside the closure.
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
//~| NOTE: `#[warn(incomplete_features)]` on by default
//~| NOTE: see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
fn main() { fn main() {

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-disjoint-field-tuple.rs:6:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,6 +1,5 @@
// edition:2021
//check-pass //check-pass
#![feature(capture_disjoint_fields)]
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
fn test1() { fn test1() {
let foo : [Vec<u8>; 3] = ["String".into(), "String".into(), "String".into()]; let foo : [Vec<u8>; 3] = ["String".into(), "String".into(), "String".into()];

View file

@ -1,11 +0,0 @@
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture_with_wildcard_match.rs:2:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
warning: 1 warning emitted

View file

@ -1,6 +1,5 @@
//check-pass // edition:2021
#![feature(capture_disjoint_fields)] // check-pass
//~^ WARNING: the feature `capture_disjoint_fields` is incomplete
#![warn(unused)] #![warn(unused)]
fn main() { fn main() {

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