diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs index 5511cd4c73b..bedb8b1c58b 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs @@ -217,6 +217,10 @@ fn to_upvars_resolved_place_builder<'a, 'tcx>( 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) = find_capture_matching_projections( typeck_results, @@ -226,7 +230,7 @@ fn to_upvars_resolved_place_builder<'a, 'tcx>( ) { capture_details } else { - if !tcx.features().capture_disjoint_fields { + if !enable_precise_capture(tcx, closure_span) { bug!( "No associated capture found for {:?}[{:#?}] even though \ capture_disjoint_fields isn't enabled", @@ -242,8 +246,7 @@ fn to_upvars_resolved_place_builder<'a, 'tcx>( return Err(from_builder); }; - let closure_ty = typeck_results - .node_type(tcx.hir().local_def_id_to_hir_id(closure_def_id.expect_local())); + let closure_ty = typeck_results.node_type(closure_hir_id); let substs = match closure_ty.kind() { ty::Closure(_, substs) => ty::UpvarSubsts::Closure(substs), @@ -780,3 +783,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() +} diff --git a/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.rs b/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.rs index 131af6a10c8..7a4b21f0223 100644 --- a/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.rs +++ b/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 #![feature(rustc_attrs)] // Ensure that capture analysis results in arrays being completely captured. diff --git a/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.stderr b/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.stderr index 2a350f30331..69ec53447b8 100644 --- a/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.stderr +++ b/src/test/ui/closures/2229_closure_analysis/arrays-completely-captured.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let mut c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/arrays-completely-captured.rs:14:5 + --> $DIR/arrays-completely-captured.rs:11:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | note: Capturing m[] -> MutBorrow - --> $DIR/arrays-completely-captured.rs:17:9 + --> $DIR/arrays-completely-captured.rs:14:9 | LL | m[0] += 10; | ^ error: Min Capture analysis includes: - --> $DIR/arrays-completely-captured.rs:14:5 + --> $DIR/arrays-completely-captured.rs:11:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | note: Min Capture m[] -> MutBorrow - --> $DIR/arrays-completely-captured.rs:17:9 + --> $DIR/arrays-completely-captured.rs:14:9 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/by_value.rs b/src/test/ui/closures/2229_closure_analysis/by_value.rs index 27c8fb1363f..02a243e0506 100644 --- a/src/test/ui/closures/2229_closure_analysis/by_value.rs +++ b/src/test/ui/closures/2229_closure_analysis/by_value.rs @@ -1,11 +1,7 @@ +// edition:2021 + // Test that we handle derferences properly when only some of the captures are being moved 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 #![feature(rustc_attrs)] #[derive(Debug, Default)] diff --git a/src/test/ui/closures/2229_closure_analysis/by_value.stderr b/src/test/ui/closures/2229_closure_analysis/by_value.stderr index 944e4c40a78..7014ae6a5e6 100644 --- a/src/test/ui/closures/2229_closure_analysis/by_value.stderr +++ b/src/test/ui/closures/2229_closure_analysis/by_value.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/by_value.rs:25:5 + --> $DIR/by_value.rs:21:5 | LL | / || { LL | | @@ -29,23 +20,23 @@ LL | | }; | |_____^ | 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; | ^^^^^ note: Capturing t[(0, 0)] -> ByValue - --> $DIR/by_value.rs:28:17 + --> $DIR/by_value.rs:24:17 | LL | let p = t.0.0; | ^^^^^ note: Capturing t[(1, 0)] -> ImmBorrow - --> $DIR/by_value.rs:32:29 + --> $DIR/by_value.rs:28:29 | LL | println!("{} {:?}", t.1, p); | ^^^ error: Min Capture analysis includes: - --> $DIR/by_value.rs:25:5 + --> $DIR/by_value.rs:21:5 | LL | / || { LL | | @@ -57,16 +48,16 @@ LL | | }; | |_____^ | 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; | ^^^^^ note: Min Capture t[(1, 0)] -> ImmBorrow - --> $DIR/by_value.rs:32:29 + --> $DIR/by_value.rs:28:29 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs b/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs index 4368c830e1c..dc53b31768e 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.stderr b/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.stderr index 09255343af0..fceafb9c84e 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-1.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-analysis-1.rs:20:5 + --> $DIR/capture-analysis-1.rs:18:5 | LL | / || { LL | | @@ -29,28 +20,28 @@ LL | | }; | |_____^ | note: Capturing p[] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:23:26 + --> $DIR/capture-analysis-1.rs:21:26 | LL | println!("{:?}", p); | ^ note: Capturing p[(0, 0)] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:26:26 + --> $DIR/capture-analysis-1.rs:24:26 | LL | println!("{:?}", p.x); | ^^^ note: Capturing q[(0, 0)] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:29:26 + --> $DIR/capture-analysis-1.rs:27:26 | LL | println!("{:?}", q.x); | ^^^ note: Capturing q[] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:31:26 + --> $DIR/capture-analysis-1.rs:29:26 | LL | println!("{:?}", q); | ^ error: Min Capture analysis includes: - --> $DIR/capture-analysis-1.rs:20:5 + --> $DIR/capture-analysis-1.rs:18:5 | LL | / || { LL | | @@ -62,16 +53,16 @@ LL | | }; | |_____^ | note: Min Capture p[] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:23:26 + --> $DIR/capture-analysis-1.rs:21:26 | LL | println!("{:?}", p); | ^ note: Min Capture q[] -> ImmBorrow - --> $DIR/capture-analysis-1.rs:31:26 + --> $DIR/capture-analysis-1.rs:29:26 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs b/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs index ab7fce6a430..99d12f8d8f1 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.stderr b/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.stderr index 0e48d6b300b..cb44ca26652 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-2.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-analysis-2.rs:19:5 + --> $DIR/capture-analysis-2.rs:17:5 | LL | / || { LL | | @@ -29,18 +20,18 @@ LL | | }; | |_____^ | 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; | ^^^ note: Capturing p[] -> ImmBorrow - --> $DIR/capture-analysis-2.rs:25:26 + --> $DIR/capture-analysis-2.rs:23:26 | LL | println!("{:?}", p); | ^ error: Min Capture analysis includes: - --> $DIR/capture-analysis-2.rs:19:5 + --> $DIR/capture-analysis-2.rs:17:5 | LL | / || { LL | | @@ -52,7 +43,7 @@ LL | | }; | |_____^ | note: Min Capture p[] -> ByValue - --> $DIR/capture-analysis-2.rs:22:18 + --> $DIR/capture-analysis-2.rs:20:18 | LL | let _x = p.x; | ^^^ p[] captured as ByValue here @@ -60,6 +51,6 @@ LL | let _x = p.x; LL | println!("{:?}", p); | ^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.rs b/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.rs index 817ade899e2..3f337097dbd 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.stderr b/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.stderr index 263e9ca56eb..71e7bdc354f 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-3.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-analysis-3.rs:24:5 + --> $DIR/capture-analysis-3.rs:22:5 | LL | / || { LL | | @@ -29,18 +20,18 @@ LL | | }; | |_____^ | 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; | ^^^^^ note: Capturing a[(0, 0)] -> ImmBorrow - --> $DIR/capture-analysis-3.rs:30:26 + --> $DIR/capture-analysis-3.rs:28:26 | LL | println!("{:?}", a.b); | ^^^ error: Min Capture analysis includes: - --> $DIR/capture-analysis-3.rs:24:5 + --> $DIR/capture-analysis-3.rs:22:5 | LL | / || { LL | | @@ -52,7 +43,7 @@ LL | | }; | |_____^ | 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; | ^^^^^ a[(0, 0)] captured as ByValue here @@ -60,6 +51,6 @@ LL | let _x = a.b.c; LL | println!("{:?}", a.b); | ^^^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.rs b/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.rs index e8401299b30..bc46ec99736 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.stderr b/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.stderr index f4605c1d51b..7e6e625bc7d 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-analysis-4.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-analysis-4.rs:24:5 + --> $DIR/capture-analysis-4.rs:22:5 | LL | / || { LL | | @@ -29,18 +20,18 @@ LL | | }; | |_____^ | 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; | ^^^ 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); | ^^^^^ error: Min Capture analysis includes: - --> $DIR/capture-analysis-4.rs:24:5 + --> $DIR/capture-analysis-4.rs:22:5 | LL | / || { LL | | @@ -52,11 +43,11 @@ LL | | }; | |_____^ | 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; | ^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs index ba495508537..6fd15155331 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs @@ -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 #![feature(rustc_attrs)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.stderr b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.stderr index 5fac6963afd..0f64ecf3a0c 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-disjoint-field-struct.rs:20:5 + --> $DIR/capture-disjoint-field-struct.rs:16:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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); | ^^^ error: Min Capture analysis includes: - --> $DIR/capture-disjoint-field-struct.rs:20:5 + --> $DIR/capture-disjoint-field-struct.rs:16:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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); | ^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs index c1693fbad79..8d3bb3262fb 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs @@ -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 #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.stderr b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.stderr index 1bfd63f2ace..a8ca9622a6a 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-disjoint-field-tuple.rs:15:5 + --> $DIR/capture-disjoint-field-tuple.rs:11:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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); | ^^^ error: Min Capture analysis includes: - --> $DIR/capture-disjoint-field-tuple.rs:15:5 + --> $DIR/capture-disjoint-field-tuple.rs:11:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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); | ^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/capture-enums.rs b/src/test/ui/closures/2229_closure_analysis/capture-enums.rs index 8fb2f7f16d6..322ae99b861 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-enums.rs +++ b/src/test/ui/closures/2229_closure_analysis/capture-enums.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] enum Info { diff --git a/src/test/ui/closures/2229_closure_analysis/capture-enums.stderr b/src/test/ui/closures/2229_closure_analysis/capture-enums.stderr index ebe1dcb9884..8a6ba8444a8 100644 --- a/src/test/ui/closures/2229_closure_analysis/capture-enums.stderr +++ b/src/test/ui/closures/2229_closure_analysis/capture-enums.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,17 +16,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/capture-enums.rs:21:5 + --> $DIR/capture-enums.rs:19:5 | LL | / || { LL | | @@ -38,28 +29,28 @@ LL | | }; | |_____^ | note: Capturing point[] -> ImmBorrow - --> $DIR/capture-enums.rs:24:41 + --> $DIR/capture-enums.rs:22:41 | LL | if let Info::Point(_, _, str) = point { | ^^^^^ 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 { | ^^^^^ note: Capturing meta[] -> ImmBorrow - --> $DIR/capture-enums.rs:31:35 + --> $DIR/capture-enums.rs:29:35 | LL | if let Info::Meta(_, v) = meta { | ^^^^ 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 { | ^^^^ error: Min Capture analysis includes: - --> $DIR/capture-enums.rs:21:5 + --> $DIR/capture-enums.rs:19:5 | LL | / || { LL | | @@ -71,18 +62,18 @@ LL | | }; | |_____^ | note: Min Capture point[] -> ByValue - --> $DIR/capture-enums.rs:24:41 + --> $DIR/capture-enums.rs:22:41 | LL | if let Info::Point(_, _, str) = point { | ^^^^^ note: Min Capture meta[] -> ByValue - --> $DIR/capture-enums.rs:31:35 + --> $DIR/capture-enums.rs:29:35 | LL | if let Info::Meta(_, v) = meta { | ^^^^ error: First Pass analysis includes: - --> $DIR/capture-enums.rs:52:5 + --> $DIR/capture-enums.rs:50:5 | LL | / || { LL | | @@ -94,13 +85,13 @@ LL | | }; | |_____^ | note: Capturing point[(2, 0)] -> ByValue - --> $DIR/capture-enums.rs:55:47 + --> $DIR/capture-enums.rs:53:47 | LL | let SingleVariant::Point(_, _, str) = point; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/capture-enums.rs:52:5 + --> $DIR/capture-enums.rs:50:5 | LL | / || { LL | | @@ -112,11 +103,11 @@ LL | | }; | |_____^ | 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; | ^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs index f81866bb7e0..3341166e22b 100644 --- a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs +++ b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #![allow(unused)] diff --git a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.stderr b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.stderr index 863f1009131..29e1af0431e 100644 --- a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.stderr +++ b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-struct.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/deep-multilevel-struct.rs:39:5 + --> $DIR/deep-multilevel-struct.rs:37:5 | LL | / || { LL | | @@ -29,23 +20,23 @@ LL | | }; | |_____^ | 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; | ^^^^^^^ 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; | ^^^^^^^ note: Capturing p[] -> ImmBorrow - --> $DIR/deep-multilevel-struct.rs:47:26 + --> $DIR/deep-multilevel-struct.rs:45:26 | LL | println!("{:?}", p); | ^ error: Min Capture analysis includes: - --> $DIR/deep-multilevel-struct.rs:39:5 + --> $DIR/deep-multilevel-struct.rs:37:5 | LL | / || { LL | | @@ -57,7 +48,7 @@ LL | | }; | |_____^ | 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; | ^^^^^^^ p[] captured as MutBorrow here @@ -65,6 +56,6 @@ LL | p.b.q.y = 9; LL | println!("{:?}", p); | ^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs index fb03a02efa0..34b0132f3cb 100644 --- a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs +++ b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 #![feature(rustc_attrs)] #![allow(unused)] diff --git a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.stderr b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.stderr index 252db444732..e917516765c 100644 --- a/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.stderr +++ b/src/test/ui/closures/2229_closure_analysis/deep-multilevel-tuple.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/deep-multilevel-tuple.rs:14:5 + --> $DIR/deep-multilevel-tuple.rs:11:5 | LL | / || { LL | | @@ -29,23 +20,23 @@ LL | | }; | |_____^ | 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; | ^^^^^^^ 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; | ^^^^^^^ note: Capturing t[] -> ImmBorrow - --> $DIR/deep-multilevel-tuple.rs:22:26 + --> $DIR/deep-multilevel-tuple.rs:19:26 | LL | println!("{:?}", t); | ^ error: Min Capture analysis includes: - --> $DIR/deep-multilevel-tuple.rs:14:5 + --> $DIR/deep-multilevel-tuple.rs:11:5 | LL | / || { LL | | @@ -57,7 +48,7 @@ LL | | }; | |_____^ | 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; | ^^^^^^^ t[] captured as MutBorrow here @@ -65,6 +56,6 @@ LL | t.1.1.1 = 9; LL | println!("{:?}", t); | ^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/destructure_patterns.rs b/src/test/ui/closures/2229_closure_analysis/destructure_patterns.rs index 080ca0405b4..9918802334e 100644 --- a/src/test/ui/closures/2229_closure_analysis/destructure_patterns.rs +++ b/src/test/ui/closures/2229_closure_analysis/destructure_patterns.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] // Test to ensure Index projections are handled properly during capture analysis diff --git a/src/test/ui/closures/2229_closure_analysis/destructure_patterns.stderr b/src/test/ui/closures/2229_closure_analysis/destructure_patterns.stderr index 06ccc2d7a88..b53adb52481 100644 --- a/src/test/ui/closures/2229_closure_analysis/destructure_patterns.stderr +++ b/src/test/ui/closures/2229_closure_analysis/destructure_patterns.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,17 +25,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/destructure_patterns.rs:15:5 + --> $DIR/destructure_patterns.rs:13:5 | LL | / || { LL | | @@ -47,13 +38,13 @@ LL | | }; | |_____^ | note: Capturing arr[Index] -> ByValue - --> $DIR/destructure_patterns.rs:18:29 + --> $DIR/destructure_patterns.rs:16:29 | LL | let [a, b, .., e] = arr; | ^^^ error: Min Capture analysis includes: - --> $DIR/destructure_patterns.rs:15:5 + --> $DIR/destructure_patterns.rs:13:5 | LL | / || { LL | | @@ -65,13 +56,13 @@ LL | | }; | |_____^ | note: Min Capture arr[] -> ByValue - --> $DIR/destructure_patterns.rs:18:29 + --> $DIR/destructure_patterns.rs:16:29 | LL | let [a, b, .., e] = arr; | ^^^ error: First Pass analysis includes: - --> $DIR/destructure_patterns.rs:41:5 + --> $DIR/destructure_patterns.rs:39:5 | LL | / || { LL | | @@ -83,18 +74,18 @@ LL | | }; | |_____^ | 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; | ^ 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; | ^ error: Min Capture analysis includes: - --> $DIR/destructure_patterns.rs:41:5 + --> $DIR/destructure_patterns.rs:39:5 | LL | / || { LL | | @@ -106,18 +97,18 @@ LL | | }; | |_____^ | 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; | ^ 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; | ^ error: First Pass analysis includes: - --> $DIR/destructure_patterns.rs:61:5 + --> $DIR/destructure_patterns.rs:59:5 | LL | / || { LL | | @@ -129,23 +120,23 @@ LL | | }; | |_____^ | 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; | ^ 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; | ^ 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; | ^ error: Min Capture analysis includes: - --> $DIR/destructure_patterns.rs:61:5 + --> $DIR/destructure_patterns.rs:59:5 | LL | / || { LL | | @@ -157,21 +148,21 @@ LL | | }; | |_____^ | 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; | ^ 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; | ^ 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; | ^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs index 0b94317fd71..93131b2ac4e 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs @@ -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)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// Test that arrays are completely captured by closures by relying on the borrow check diagnostics fn arrays_1() { let mut arr = [1, 2, 3, 4, 5]; diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.stderr index 77e3e71bc61..a3f2f25e447 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.stderr @@ -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 for more information - error[E0503]: cannot use `arr` because it was mutably borrowed - --> $DIR/arrays.rs:15:5 + --> $DIR/arrays.rs:14:5 | LL | let mut c = || { | -- borrow of `arr` occurs here @@ -22,7 +13,7 @@ LL | c(); | - borrow later used here error[E0503]: cannot use `arr[_]` because it was mutably borrowed - --> $DIR/arrays.rs:15:5 + --> $DIR/arrays.rs:14:5 | LL | let mut c = || { | -- borrow of `arr` occurs here @@ -36,7 +27,7 @@ LL | c(); | - borrow later used here error[E0506]: cannot assign to `arr[_]` because it is borrowed - --> $DIR/arrays.rs:30:5 + --> $DIR/arrays.rs:29:5 | LL | let c = || { | -- borrow of `arr[_]` occurs here @@ -50,7 +41,7 @@ LL | c(); | - borrow later used here error[E0506]: cannot assign to `arr[_]` because it is borrowed - --> $DIR/arrays.rs:44:5 + --> $DIR/arrays.rs:43:5 | LL | let c = || { | -- borrow of `arr[_]` occurs here @@ -64,7 +55,7 @@ LL | c(); | - borrow later used here error[E0503]: cannot use `arr` because it was mutably borrowed - --> $DIR/arrays.rs:58:20 + --> $DIR/arrays.rs:57:20 | LL | let mut c = || { | -- borrow of `arr` occurs here @@ -78,7 +69,7 @@ LL | c(); | - borrow later used here 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 = || { | -- mutable borrow occurs here @@ -92,7 +83,7 @@ LL | c(); | - mutable borrow later used here 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 = || { | -- mutable borrow occurs here @@ -105,7 +96,7 @@ LL | println!("{:#?}", &arr[3..2]); LL | c(); | - 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. For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.rs index 2f3358dcd8d..3664d76c203 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.rs @@ -1,5 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 #[derive(Debug)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.stderr index e15067b264d..341d2bc6563 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.stderr @@ -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 for more information - 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; | -------- first mutable borrow occurs here @@ -23,6 +14,6 @@ LL | println!("{:?}", p); LL | *y+=1; | ----- 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.rs index 06c6a87eb10..ae416bab65e 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.rs @@ -1,5 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 #[derive(Debug)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.stderr index a195b981eaa..584bb862b2c 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-2.stderr @@ -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 for more information - 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; | ---- immutable borrow occurs here @@ -23,6 +14,6 @@ LL | let x = &mut p.x; LL | println!("{}", y); | - 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.rs index ba998f78c87..bdd6cb79b60 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.rs @@ -1,5 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 #[derive(Debug)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.stderr index b54c729a307..dab1809a381 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.stderr @@ -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 for more information - error[E0597]: `p` does not live long enough - --> $DIR/borrowck-3.rs:14:29 + --> $DIR/borrowck-3.rs:13:29 | LL | let mut c = { | ----- borrow later stored here @@ -22,6 +13,6 @@ LL | println!("{:?}", p); LL | }; | - `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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.rs index 4fab0189c27..a2290d85020 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.rs @@ -1,5 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 #[derive(Debug)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr index 905fa3475ed..29bd4b27d6b 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr @@ -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 for more information - 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 = || { | ^^ may outlive borrowed value `p` @@ -17,7 +8,7 @@ LL | println!("{:?}", p); | - `p` is borrowed here | note: closure is returned here - --> $DIR/borrowck-4.rs:9:14 + --> $DIR/borrowck-4.rs:8:14 | 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 || { | ^^^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.rs index b23947ad5d1..6a8c9664051 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.rs @@ -1,8 +1,8 @@ +// edition:2021 + // Tests that two closures cannot simultaneously have mutable // and immutable access to the variable. Issue #6801. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![feature(box_syntax)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.stderr index 58975c6f46f..5f1dae2972f 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-closures-mut-and-imm.stderr @@ -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 for more information - error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable --> $DIR/borrowck-closures-mut-and-imm.rs:17:14 | @@ -25,6 +16,6 @@ LL | }; LL | drop(c2); | -- 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/box.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/box.rs index 15be1d8c722..a110fa4e2cb 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/box.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/box.rs @@ -1,7 +1,6 @@ -// Test borrow checker when we precise capture when using boxes +// edition:2021 -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// Test borrow checker when we precise capture when using boxes struct MetaData { x: String, name: String } struct Data { m: MetaData } diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/box.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/box.stderr index 174faa33c49..2badf051418 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/box.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/box.stderr @@ -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 for more information - 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 = || { | -- borrow of `e.0.0.m.x` occurs here @@ -22,7 +13,7 @@ LL | c(); | - borrow later used here 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 = || { | -- mutable borrow occurs here @@ -36,7 +27,7 @@ LL | c(); | - mutable borrow later used here 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 = || { | -- borrow of `e.0.0.m.x` occurs here @@ -49,7 +40,7 @@ LL | LL | c(); | - 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. For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs index 1ea38e260b6..a5b4a19d8c3 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs @@ -1,9 +1,8 @@ +// edition:2021 + // Test that if we deref an immutable borrow to access a Place, // then we can't mutate the final place. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - fn main() { let mut x = (format!(""), format!("X2")); let mut y = (&x, "Y"); diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.stderr index 39a11fb3327..cfe531e17d3 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.stderr @@ -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 for more information - 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 = || { | ^^ cannot borrow as mutable @@ -16,6 +7,6 @@ LL | LL | z.0.0.0 = format!("X1"); | ------- 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs index 928c866726f..25ee9a1490e 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs @@ -1,5 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 // Ensure that diagnostics for mutability error (because the root variable // isn't mutable) work with `capture_disjoint_fields` enabled. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr index 9fb8dd4a1c3..98414fa8a3d 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr @@ -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 for more information - 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); | - help: consider changing this to be mutable: `mut z` @@ -17,7 +8,7 @@ LL | z.0.0.0 = 20; | ^^^^^^^^^^^^ cannot assign 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); | -- help: consider changing this to be mutable: `mut bx` @@ -25,6 +16,6 @@ LL | let bx = Box::new(x); LL | bx.0 = 20; | ^^^^^^^^^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs index cd7c25620a7..f3be542e40d 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 // Test that array access is not stored as part of closure kind origin diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr index bd9428771f4..bcde35983fc 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr @@ -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 for more information - 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 = || { | ^^ this closure implements `FnOnce`, not `Fn` @@ -18,6 +9,6 @@ LL | }; LL | expect_fn(c); | --------- 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.rs index 2916d8c794f..aa85b55b15c 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.rs @@ -1,11 +1,7 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 // Check that precise paths are being reported back in the error message. - enum MultiVariant { Point(i32, i32), Meta(i32) diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.stderr index de0bfe3bd76..066c000c832 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-multi-variant-diagnostics.stderr @@ -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 for more information - 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; | - value moved here @@ -16,11 +7,11 @@ LL | let b = c; | ^ 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 - --> $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 { | ^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.rs index 2ed0149b9db..bedb103cc4c 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.rs @@ -1,9 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 -// Check that precise paths are being reported back in the error message. enum SingleVariant { Point(i32, i32), diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.stderr index 402f5e4f33e..2a6e00850fa 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-single-variant-diagnostics.stderr @@ -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 for more information - 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; | - value moved here @@ -16,11 +7,11 @@ LL | let a = c; | ^ 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 - --> $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; | ^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.rs index 103890f1f35..3277a83c4e1 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 // Check that precise paths are being reported back in the error message. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.stderr index 474d77b7cd2..d7fc51c55ea 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-struct-diagnostics.stderr @@ -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 for more information - 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; | ----- value moved here @@ -16,11 +7,11 @@ LL | let c = hello; | ^^^^^ 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 - --> $DIR/closure-origin-struct-diagnostics.rs:20:9 + --> $DIR/closure-origin-struct-diagnostics.rs:17:9 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.rs index 6b078d2329c..dc3a57ae793 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 // Check that precise paths are being reported back in the error message. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.stderr index 716728e96ec..63e2d300eb0 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics-1.stderr @@ -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 for more information - 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; | ----- value moved here @@ -16,11 +7,11 @@ LL | let c = hello; | ^^^^^ 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 - --> $DIR/closure-origin-tuple-diagnostics-1.rs:11:9 + --> $DIR/closure-origin-tuple-diagnostics-1.rs:8:9 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.rs index 0638db60769..fa1328013db 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 + struct S(String, String); fn expect_fn(_f: F) {} diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr index 77eb2a94ffb..df33c4f1fd6 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr @@ -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 for more information - 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 = || { | ^^ this closure implements `FnOnce`, not `Fn` @@ -18,6 +9,6 @@ LL | }; LL | expect_fn(c); | --------- 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.rs index 09491f296f6..1cc22fac352 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.rs @@ -1,6 +1,6 @@ +// edition:2021 + // check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![allow(unreachable_code)] #![warn(unused)] diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr index 81bbc4e1dc0..4eac5a2d282 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr @@ -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 for more information - warning: value captured by `a` is never read --> $DIR/liveness.rs:23:9 | @@ -75,5 +66,5 @@ LL | b = Some("e1"); | = help: did you mean to capture by reference instead? -warning: 8 warnings emitted +warning: 7 warnings emitted diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.rs index e2035464dfa..10a7d07a1df 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.rs @@ -1,6 +1,6 @@ +// edition:2021 + // check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![warn(unused)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr index 35b0c22fc4f..f74303e3dd6 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr @@ -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 for more information - warning: value assigned to `a` is never read --> $DIR/liveness_unintentional_copy.rs:19:9 | @@ -43,5 +34,5 @@ LL | a += x; | = help: did you mean to capture by reference instead? -warning: 4 warnings emitted +warning: 3 warnings emitted diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs index 39b04c833e3..fa73ff23f9c 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs @@ -1,8 +1,8 @@ +// edition:2021 + // Test that when a borrow checker diagnostics are emitted, it's as precise // as the capture by the closure. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![allow(unused)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.stderr index a3d1f550557..ac4c9c93769 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.stderr @@ -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 for more information - error[E0499]: cannot borrow `w.p.x` as mutable more than once at a time --> $DIR/multilevel-path.rs:23:14 | @@ -21,6 +12,6 @@ LL | LL | c(); | - 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs index 676fde558df..3d5a31e8b8e 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs @@ -1,9 +1,8 @@ +// edition:2021 + // Test that we can't mutate a place if we need to deref an imm-borrow // to reach it. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - fn imm_mut_ref() { let mut x = String::new(); let y = String::new(); diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr index 831e486db82..dbf8523a3ba 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/mut_ref.stderr @@ -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 for more information - 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; | ------- 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 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 = || { | ^^ cannot borrow as mutable @@ -28,6 +19,6 @@ LL | LL | **mref_ref_x = y; | ------------ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs index 82ec60a2e79..4799f488d7d 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs @@ -1,7 +1,6 @@ -// check-pass +// edition:2021 -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// check-pass // 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 diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr index e8cc164be87..d2466681a08 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr @@ -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 for more information - warning: reference to packed field is unaligned - --> $DIR/repr_packed.rs:25:24 + --> $DIR/repr_packed.rs:24:24 | LL | println!("{}", foo.x); | ^^^^^ @@ -18,5 +9,5 @@ LL | println!("{}", foo.x); = note: for more information, see issue #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) -warning: 2 warnings emitted +warning: 1 warning emitted diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs index e78d8715e48..ed2d9a3de00 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs @@ -1,9 +1,8 @@ +// edition:2021 + // Test that borrow checker error is accurate and that min capture pass of the // closure analysis is working as expected. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - #[derive(Debug)] struct Point { x: i32, diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.stderr index f1748fda151..32705af3d01 100644 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.stderr +++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.stderr @@ -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 for more information - 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 = || { | -- mutable borrow occurs here @@ -23,6 +14,6 @@ LL | LL | c(); | - 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs b/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs index a3222635b62..269cf76e673 100644 --- a/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs +++ b/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stderr b/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stderr index a031360ed34..b936c5ee35a 100644 --- a/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stderr +++ b/src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - 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 | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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); | ^ 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 | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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); | ^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.rs b/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.rs index 9466e103897..bfa3ebcd6d2 100644 --- a/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.rs +++ b/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.rs @@ -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 #![feature(rustc_attrs)] struct Filter { diff --git a/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.stderr b/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.stderr index e9420fe5a0c..10e0d076b42 100644 --- a/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.stderr +++ b/src/test/ui/closures/2229_closure_analysis/filter-on-struct-member.stderr @@ -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 for more information - 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), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 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), | ^^^^^^^^^^^ 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), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 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), | ^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/src/test/ui/closures/2229_closure_analysis/move_closure.rs b/src/test/ui/closures/2229_closure_analysis/move_closure.rs index f96370eb203..06db19974eb 100644 --- a/src/test/ui/closures/2229_closure_analysis/move_closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/move_closure.rs @@ -1,9 +1,7 @@ +// edition:2021 + // 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 #![feature(rustc_attrs)] fn simple_move_closure() { diff --git a/src/test/ui/closures/2229_closure_analysis/move_closure.stderr b/src/test/ui/closures/2229_closure_analysis/move_closure.stderr index 82aa7ab8912..013cacfb9f2 100644 --- a/src/test/ui/closures/2229_closure_analysis/move_closure.stderr +++ b/src/test/ui/closures/2229_closure_analysis/move_closure.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -62,7 +62,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -70,17 +70,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/move_closure.rs:17:5 + --> $DIR/move_closure.rs:15:5 | LL | / move || { LL | | @@ -92,13 +83,13 @@ LL | | }; | |_____^ | 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(); | ^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:17:5 + --> $DIR/move_closure.rs:15:5 | LL | / move || { LL | | @@ -110,13 +101,13 @@ LL | | }; | |_____^ | 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(); | ^^^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:35:5 + --> $DIR/move_closure.rs:33:5 | LL | / move || { LL | | @@ -128,13 +119,13 @@ LL | | }; | |_____^ | note: Capturing ref_s[Deref] -> UniqueImmBorrow - --> $DIR/move_closure.rs:38:9 + --> $DIR/move_closure.rs:36:9 | LL | *ref_s += 10; | ^^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:35:5 + --> $DIR/move_closure.rs:33:5 | LL | / move || { LL | | @@ -146,13 +137,13 @@ LL | | }; | |_____^ | note: Min Capture ref_s[Deref] -> UniqueImmBorrow - --> $DIR/move_closure.rs:38:9 + --> $DIR/move_closure.rs:36:9 | LL | *ref_s += 10; | ^^^^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:56:5 + --> $DIR/move_closure.rs:54:5 | LL | / move || { LL | | @@ -164,13 +155,13 @@ LL | | }; | |_____^ | 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(); | ^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:56:5 + --> $DIR/move_closure.rs:54:5 | LL | / move || { LL | | @@ -182,13 +173,13 @@ LL | | }; | |_____^ | 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(); | ^^^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:79:5 + --> $DIR/move_closure.rs:77:5 | LL | / move || { LL | | @@ -200,13 +191,13 @@ LL | | }; | |_____^ | 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; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:79:5 + --> $DIR/move_closure.rs:77:5 | LL | / move || { LL | | @@ -218,13 +209,13 @@ LL | | }; | |_____^ | 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; | ^^^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:101:5 + --> $DIR/move_closure.rs:99:5 | LL | / move || { LL | | @@ -236,18 +227,18 @@ LL | | }; | |_____^ | 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; | ^^^^^ note: Capturing t[(0, 0)] -> ByValue - --> $DIR/move_closure.rs:104:18 + --> $DIR/move_closure.rs:102:18 | LL | let _t = t.0.0; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:101:5 + --> $DIR/move_closure.rs:99:5 | LL | / move || { LL | | @@ -259,13 +250,13 @@ LL | | }; | |_____^ | 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; | ^^^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:123:5 + --> $DIR/move_closure.rs:121:5 | LL | / move || { LL | | @@ -277,18 +268,18 @@ LL | | }; | |_____^ | note: Capturing b[Deref,(0, 0)] -> ByValue - --> $DIR/move_closure.rs:126:18 + --> $DIR/move_closure.rs:124:18 | LL | let _t = b.0; | ^^^ note: Capturing b[] -> ByValue - --> $DIR/move_closure.rs:126:18 + --> $DIR/move_closure.rs:124:18 | LL | let _t = b.0; | ^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:123:5 + --> $DIR/move_closure.rs:121:5 | LL | / move || { LL | | @@ -300,13 +291,13 @@ LL | | }; | |_____^ | note: Min Capture b[] -> ByValue - --> $DIR/move_closure.rs:126:18 + --> $DIR/move_closure.rs:124:18 | LL | let _t = b.0; | ^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:140:5 + --> $DIR/move_closure.rs:138:5 | LL | / move || { LL | | @@ -318,13 +309,13 @@ LL | | }; | |_____^ | note: Capturing b[Deref,(0, 0)] -> ByValue - --> $DIR/move_closure.rs:143:24 + --> $DIR/move_closure.rs:141:24 | LL | println!("{}", b.0); | ^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:140:5 + --> $DIR/move_closure.rs:138:5 | LL | / move || { LL | | @@ -336,13 +327,13 @@ LL | | }; | |_____^ | note: Min Capture b[] -> ByValue - --> $DIR/move_closure.rs:143:24 + --> $DIR/move_closure.rs:141:24 | LL | println!("{}", b.0); | ^^^ error: First Pass analysis includes: - --> $DIR/move_closure.rs:157:5 + --> $DIR/move_closure.rs:155:5 | LL | / move || { LL | | @@ -354,13 +345,13 @@ LL | | }; | |_____^ | 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); | ^^^^^ error: Min Capture analysis includes: - --> $DIR/move_closure.rs:157:5 + --> $DIR/move_closure.rs:155:5 | LL | / move || { LL | | @@ -372,11 +363,11 @@ LL | | }; | |_____^ | note: Min Capture t[(1, 0)] -> ByValue - --> $DIR/move_closure.rs:160:24 + --> $DIR/move_closure.rs:158:24 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.rs b/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.rs index 7d2d4c104d4..a8a2acfa78d 100644 --- a/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.rs +++ b/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] #![allow(unused)] diff --git a/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.stderr b/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.stderr index 1c8db7952af..29ad1c59198 100644 --- a/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.stderr +++ b/src/test/ui/closures/2229_closure_analysis/multilevel-path-1.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/multilevel-path-1.rs:27:5 + --> $DIR/multilevel-path-1.rs:25:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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; | ^^^ error: Min Capture analysis includes: - --> $DIR/multilevel-path-1.rs:27:5 + --> $DIR/multilevel-path-1.rs:25:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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; | ^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.rs b/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.rs index 540e70138e5..e21fe318cd1 100644 --- a/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.rs +++ b/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.rs @@ -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 #![feature(rustc_attrs)] #![allow(unused)] diff --git a/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.stderr b/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.stderr index 37287f6b3bc..929cba11314 100644 --- a/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.stderr +++ b/src/test/ui/closures/2229_closure_analysis/multilevel-path-2.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/multilevel-path-2.rs:24:5 + --> $DIR/multilevel-path-2.rs:20:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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); | ^^^^^ error: Min Capture analysis includes: - --> $DIR/multilevel-path-2.rs:24:5 + --> $DIR/multilevel-path-2.rs:20:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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); | ^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/nested-closure.rs b/src/test/ui/closures/2229_closure_analysis/nested-closure.rs index 88620550f2e..f6775b3a3a5 100644 --- a/src/test/ui/closures/2229_closure_analysis/nested-closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/nested-closure.rs @@ -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 #![feature(rustc_attrs)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/nested-closure.stderr b/src/test/ui/closures/2229_closure_analysis/nested-closure.stderr index 21147be3f1d..013bc74e67e 100644 --- a/src/test/ui/closures/2229_closure_analysis/nested-closure.stderr +++ b/src/test/ui/closures/2229_closure_analysis/nested-closure.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let mut c1 = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,51 +16,42 @@ LL | let mut c2 = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/nested-closure.rs:36:9 + --> $DIR/nested-closure.rs:32:9 | LL | || p.y += incr; | ^^^^^^^^^^^^^^ | note: Capturing p[(1, 0)] -> MutBorrow - --> $DIR/nested-closure.rs:36:12 + --> $DIR/nested-closure.rs:32:12 | LL | || p.y += incr; | ^^^ note: Capturing incr[] -> ImmBorrow - --> $DIR/nested-closure.rs:36:19 + --> $DIR/nested-closure.rs:32:19 | LL | || p.y += incr; | ^^^^ error: Min Capture analysis includes: - --> $DIR/nested-closure.rs:36:9 + --> $DIR/nested-closure.rs:32:9 | LL | || p.y += incr; | ^^^^^^^^^^^^^^ | note: Min Capture p[(1, 0)] -> MutBorrow - --> $DIR/nested-closure.rs:36:12 + --> $DIR/nested-closure.rs:32:12 | LL | || p.y += incr; | ^^^ note: Min Capture incr[] -> ImmBorrow - --> $DIR/nested-closure.rs:36:19 + --> $DIR/nested-closure.rs:32:19 | LL | || p.y += incr; | ^^^^ error: First Pass analysis includes: - --> $DIR/nested-closure.rs:26:5 + --> $DIR/nested-closure.rs:22:5 | LL | / || { LL | | @@ -72,18 +63,18 @@ LL | | }; | |_____^ | note: Capturing p[(0, 0)] -> ImmBorrow - --> $DIR/nested-closure.rs:29:24 + --> $DIR/nested-closure.rs:25:24 | LL | println!("{}", p.x); | ^^^ note: Capturing p[(1, 0)] -> MutBorrow - --> $DIR/nested-closure.rs:36:12 + --> $DIR/nested-closure.rs:32:12 | LL | || p.y += incr; | ^^^ error: Min Capture analysis includes: - --> $DIR/nested-closure.rs:26:5 + --> $DIR/nested-closure.rs:22:5 | LL | / || { LL | | @@ -95,16 +86,16 @@ LL | | }; | |_____^ | note: Min Capture p[(0, 0)] -> ImmBorrow - --> $DIR/nested-closure.rs:29:24 + --> $DIR/nested-closure.rs:25:24 | LL | println!("{}", p.x); | ^^^ note: Min Capture p[(1, 0)] -> MutBorrow - --> $DIR/nested-closure.rs:36:12 + --> $DIR/nested-closure.rs:32:12 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/path-with-array-access.rs b/src/test/ui/closures/2229_closure_analysis/path-with-array-access.rs index 16acd2f3206..0c10319314a 100644 --- a/src/test/ui/closures/2229_closure_analysis/path-with-array-access.rs +++ b/src/test/ui/closures/2229_closure_analysis/path-with-array-access.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/path-with-array-access.stderr b/src/test/ui/closures/2229_closure_analysis/path-with-array-access.stderr index 3c8d07ed9ba..124b7bf6fe2 100644 --- a/src/test/ui/closures/2229_closure_analysis/path-with-array-access.stderr +++ b/src/test/ui/closures/2229_closure_analysis/path-with-array-access.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/path-with-array-access.rs:28:5 + --> $DIR/path-with-array-access.rs:26:5 | LL | / || { LL | | @@ -29,13 +20,13 @@ LL | | }; | |_____^ | 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); | ^^^^^^^^^^^ error: Min Capture analysis includes: - --> $DIR/path-with-array-access.rs:28:5 + --> $DIR/path-with-array-access.rs:26:5 | LL | / || { LL | | @@ -47,11 +38,11 @@ LL | | }; | |_____^ | 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); | ^^^^^^^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs b/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs index 609a11a578a..0f288ffa95a 100644 --- a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs +++ b/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 + #![feature(never_type)] // Should fake read the discriminant and throw an error diff --git a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr b/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr index c225abb58b7..45641ea3de3 100644 --- a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr +++ b/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr @@ -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 for more information - 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 { }; | ^ @@ -17,13 +8,13 @@ LL | let c1 = || match x { }; = note: the matched value is of type `u8` 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 { }; | ^ use of possibly-uninitialized `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 { _ => () }; | ^^ - borrow occurs due to use in closure @@ -31,7 +22,7 @@ LL | let c2 = || match x { _ => () }; | use of possibly-uninitialized `x` 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 = || { | ^^ use of possibly-uninitialized `variant` @@ -40,7 +31,7 @@ LL | match variant { | ------- borrow occurs due to use in closure 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 = || { | ^^ use of possibly-uninitialized `variant` @@ -49,24 +40,24 @@ LL | match variant { | ------- borrow occurs due to use in closure 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 { }; | ^ use of possibly-uninitialized `g` 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 { }; | ^ use of possibly-uninitialized `t` 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 { }; | ^ 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. For more information about an error, try `rustc --explain E0004`. diff --git a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs b/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs index 0a877dd366c..56f5ac44db0 100644 --- a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs +++ b/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] // Should capture the discriminant since a variant of a multivariant enum is diff --git a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr b/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr index ad3e96a5753..46081333395 100644 --- a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr +++ b/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ LL | let c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,17 +52,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:16:5 + --> $DIR/patterns-capture-analysis.rs:14:5 | LL | / || { LL | | @@ -74,13 +65,13 @@ LL | | }; | |_____^ | note: Capturing variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:19:15 + --> $DIR/patterns-capture-analysis.rs:17:15 | LL | match variant { | ^^^^^^^ error: Min Capture analysis includes: - --> $DIR/patterns-capture-analysis.rs:16:5 + --> $DIR/patterns-capture-analysis.rs:14:5 | LL | / || { LL | | @@ -92,13 +83,13 @@ LL | | }; | |_____^ | note: Min Capture variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:19:15 + --> $DIR/patterns-capture-analysis.rs:17:15 | LL | match variant { | ^^^^^^^ error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:36:5 + --> $DIR/patterns-capture-analysis.rs:34:5 | LL | / || { LL | | @@ -109,7 +100,7 @@ LL | | }; | |_____^ error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:57:5 + --> $DIR/patterns-capture-analysis.rs:55:5 | LL | / || { LL | | @@ -120,7 +111,7 @@ LL | | }; | |_____^ error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:73:5 + --> $DIR/patterns-capture-analysis.rs:71:5 | LL | / || { LL | | @@ -132,18 +123,18 @@ LL | | }; | |_____^ | note: Capturing variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:76:15 + --> $DIR/patterns-capture-analysis.rs:74:15 | LL | match variant { | ^^^^^^^ note: Capturing variant[(0, 0)] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:76:15 + --> $DIR/patterns-capture-analysis.rs:74:15 | LL | match variant { | ^^^^^^^ error: Min Capture analysis includes: - --> $DIR/patterns-capture-analysis.rs:73:5 + --> $DIR/patterns-capture-analysis.rs:71:5 | LL | / || { LL | | @@ -155,13 +146,13 @@ LL | | }; | |_____^ | note: Min Capture variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:76:15 + --> $DIR/patterns-capture-analysis.rs:74:15 | LL | match variant { | ^^^^^^^ error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:95:5 + --> $DIR/patterns-capture-analysis.rs:93:5 | LL | / || { LL | | @@ -172,7 +163,7 @@ LL | | }; | |_____^ error: First Pass analysis includes: - --> $DIR/patterns-capture-analysis.rs:119:5 + --> $DIR/patterns-capture-analysis.rs:117:5 | LL | / || { LL | | @@ -184,13 +175,13 @@ LL | | }; | |_____^ | note: Capturing variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:122:15 + --> $DIR/patterns-capture-analysis.rs:120:15 | LL | match variant { | ^^^^^^^ error: Min Capture analysis includes: - --> $DIR/patterns-capture-analysis.rs:119:5 + --> $DIR/patterns-capture-analysis.rs:117:5 | LL | / || { LL | | @@ -202,11 +193,11 @@ LL | | }; | |_____^ | note: Min Capture variant[] -> ImmBorrow - --> $DIR/patterns-capture-analysis.rs:122:15 + --> $DIR/patterns-capture-analysis.rs:120:15 | 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs index 2b9ef2a76bb..7d472ad020f 100644 --- a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs +++ b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs @@ -1,7 +1,4 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 +// edition:2021 #![feature(rustc_attrs)] diff --git a/src/test/ui/closures/2229_closure_analysis/repr_packed.stderr b/src/test/ui/closures/2229_closure_analysis/repr_packed.stderr index 0517dd04b6f..405f66210aa 100644 --- a/src/test/ui/closures/2229_closure_analysis/repr_packed.stderr +++ b/src/test/ui/closures/2229_closure_analysis/repr_packed.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | let mut c = #[rustc_capture_analysis] = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable 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] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,17 +25,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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 for more information - error: First Pass analysis includes: - --> $DIR/repr_packed.rs:19:5 + --> $DIR/repr_packed.rs:16:5 | LL | / || { LL | | @@ -47,18 +38,18 @@ LL | | }; | |_____^ | note: Capturing foo[(0, 0)] -> ImmBorrow - --> $DIR/repr_packed.rs:22:24 + --> $DIR/repr_packed.rs:19:24 | LL | let z1: &u8 = &foo.x; | ^^^^^ 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; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/repr_packed.rs:19:5 + --> $DIR/repr_packed.rs:16:5 | LL | / || { LL | | @@ -70,18 +61,18 @@ LL | | }; | |_____^ | 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; | ^^^^^ 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; | ^^^^^ error: First Pass analysis includes: - --> $DIR/repr_packed.rs:50:5 + --> $DIR/repr_packed.rs:47:5 | LL | / || { LL | | @@ -93,13 +84,13 @@ LL | | }; | |_____^ | note: Capturing foo[] -> MutBorrow - --> $DIR/repr_packed.rs:54:33 + --> $DIR/repr_packed.rs:51:33 | LL | let z2: &mut u16 = &mut foo.y; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/repr_packed.rs:50:5 + --> $DIR/repr_packed.rs:47:5 | LL | / || { LL | | @@ -111,13 +102,13 @@ LL | | }; | |_____^ | 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; | ^^^^^ error: First Pass analysis includes: - --> $DIR/repr_packed.rs:84:5 + --> $DIR/repr_packed.rs:81:5 | LL | / || { LL | | @@ -129,18 +120,18 @@ LL | | }; | |_____^ | note: Capturing foo[] -> ImmBorrow - --> $DIR/repr_packed.rs:87:24 + --> $DIR/repr_packed.rs:84:24 | LL | println!("{}", foo.x); | ^^^^^ note: Capturing foo[(0, 0)] -> ByValue - --> $DIR/repr_packed.rs:91:18 + --> $DIR/repr_packed.rs:88:18 | LL | let _z = foo.x; | ^^^^^ error: Min Capture analysis includes: - --> $DIR/repr_packed.rs:84:5 + --> $DIR/repr_packed.rs:81:5 | LL | / || { LL | | @@ -152,7 +143,7 @@ LL | | }; | |_____^ | note: Min Capture foo[] -> ByValue - --> $DIR/repr_packed.rs:87:24 + --> $DIR/repr_packed.rs:84:24 | LL | println!("{}", foo.x); | ^^^^^ foo[] used here @@ -160,6 +151,6 @@ LL | println!("{}", foo.x); LL | let _z = foo.x; | ^^^^^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/box.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/box.rs index 3a66399d028..73aca288faa 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/box.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/box.rs @@ -1,13 +1,8 @@ +// edition:2021 // run-pass // 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 - - struct MetaData { x: String, name: String } struct Data { m: MetaData } struct BoxedData(Box); diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/box.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/box.stderr deleted file mode 100644 index 9883c01b946..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/box.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs index 9a93e6cf1e1..2c828aed528 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs @@ -1,11 +1,9 @@ +// edition:2021 // run-pass // Test that ByValue captures compile sucessefully especially when the captures are // derefenced within the closure. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - #[derive(Debug, Default)] struct SomeLargeType; struct MuchLargerType([SomeLargeType; 32]); diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.stderr deleted file mode 100644 index 98715c6b943..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.rs index 2c359519b76..3cb1eb32952 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.rs @@ -1,13 +1,9 @@ +// edition:2021 // run-pass // 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. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 - struct Point { x: i32, y: i32, diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.stderr deleted file mode 100644 index 9b0dea770fb..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-struct.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.rs index 2c6679feabe..0f79b7ae7b8 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.rs @@ -1,12 +1,9 @@ +// edition:2021 // run-pass // 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. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.stderr deleted file mode 100644 index 28d09153952..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple-mut.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.rs index 52f5cef9f01..81f0328b9ba 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.rs @@ -1,12 +1,9 @@ +// edition:2021 // run-pass // 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. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.stderr deleted file mode 100644 index 4fb37f85f88..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture-disjoint-field-tuple.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.rs index eaea0dbfb5e..cea02fbe15d 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.rs @@ -1,6 +1,5 @@ +// edition:2021 //check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete fn test1() { let foo : [Vec; 3] = ["String".into(), "String".into(), "String".into()]; diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.stderr deleted file mode 100644 index 2c17a189afb..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/capture_with_wildcard_match.stderr +++ /dev/null @@ -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 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs index 3ad083a92d5..5c278bff90b 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.rs @@ -1,6 +1,5 @@ -//check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 +// check-pass #![warn(unused)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr index c4abf934123..40274c88318 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr @@ -1,30 +1,21 @@ -warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/destructure-pattern-closure-within-closure.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - warning: unused variable: `t2` - --> $DIR/destructure-pattern-closure-within-closure.rs:14:21 + --> $DIR/destructure-pattern-closure-within-closure.rs:13:21 | LL | let (_, t2) = t; | ^^ help: if this is intentional, prefix it with an underscore: `_t2` | note: the lint level is defined here - --> $DIR/destructure-pattern-closure-within-closure.rs:4:9 + --> $DIR/destructure-pattern-closure-within-closure.rs:3:9 | LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` warning: unused variable: `g2` - --> $DIR/destructure-pattern-closure-within-closure.rs:11:17 + --> $DIR/destructure-pattern-closure-within-closure.rs:10:17 | LL | let (_, g2) = g; | ^^ help: if this is intentional, prefix it with an underscore: `_g2` -warning: 3 warnings emitted +warning: 2 warnings emitted diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs index 65527648b2c..07adbee03f9 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs @@ -1,6 +1,5 @@ -//check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 +// check-pass #![warn(unused)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr index fcfe9ee95f1..6523f2b34d5 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr @@ -1,66 +1,57 @@ -warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/destructure_patterns.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - warning: unused variable: `t1` - --> $DIR/destructure_patterns.rs:15:14 + --> $DIR/destructure_patterns.rs:14:14 | LL | let (t1, t2) = t; | ^^ help: if this is intentional, prefix it with an underscore: `_t1` | note: the lint level is defined here - --> $DIR/destructure_patterns.rs:4:9 + --> $DIR/destructure_patterns.rs:3:9 | LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` warning: unused variable: `t2` - --> $DIR/destructure_patterns.rs:15:18 + --> $DIR/destructure_patterns.rs:14:18 | LL | let (t1, t2) = t; | ^^ help: if this is intentional, prefix it with an underscore: `_t2` warning: unused variable: `t1` - --> $DIR/destructure_patterns.rs:27:14 + --> $DIR/destructure_patterns.rs:26:14 | LL | let (t1, _) = t; | ^^ help: if this is intentional, prefix it with an underscore: `_t1` warning: unused variable: `t2` - --> $DIR/destructure_patterns.rs:38:17 + --> $DIR/destructure_patterns.rs:37:17 | LL | let (_, t2) = t; | ^^ help: if this is intentional, prefix it with an underscore: `_t2` warning: unused variable: `t` - --> $DIR/destructure_patterns.rs:46:9 + --> $DIR/destructure_patterns.rs:45:9 | LL | let t = (String::from("Hello"), String::from("World")); | ^ help: if this is intentional, prefix it with an underscore: `_t` warning: unused variable: `x` - --> $DIR/destructure_patterns.rs:92:21 + --> $DIR/destructure_patterns.rs:91:21 | LL | let Point { x, y } = p; | ^ help: try ignoring the field: `x: _` warning: unused variable: `x` - --> $DIR/destructure_patterns.rs:84:9 + --> $DIR/destructure_patterns.rs:83:9 | LL | let x = 0; | ^ help: if this is intentional, prefix it with an underscore: `_x` warning: unused variable: `tup` - --> $DIR/destructure_patterns.rs:86:9 + --> $DIR/destructure_patterns.rs:85:9 | LL | let tup = (1, 2); | ^^^ help: if this is intentional, prefix it with an underscore: `_tup` -warning: 9 warnings emitted +warning: 8 warnings emitted diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs index 3f8e197b783..88a9816a052 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs @@ -1,10 +1,6 @@ +// edition:2021 // run-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 - // Tests that if a closure uses indivual fields of the same object // then that case is handled properly. diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.stderr deleted file mode 100644 index bba90f8917a..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.stderr +++ /dev/null @@ -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/disjoint-capture-in-same-closure.rs:3:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.rs index dae50854d82..477fdd613f5 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.rs @@ -1,6 +1,5 @@ -//check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete +// edition:2021 +// check-pass #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.stderr deleted file mode 100644 index 7f811875d13..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.stderr +++ /dev/null @@ -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/drop_then_use_fake_reads.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.rs index 8c12593430e..e19f5ff1bae 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.rs @@ -1,12 +1,8 @@ +// edition:2021 // run-pass // Test disjoint capture within an impl block -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 - struct Filter { div: i32, } diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.stderr deleted file mode 100644 index 6930e18992a..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/filter-on-struct-member.stderr +++ /dev/null @@ -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/filter-on-struct-member.rs:5:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs index e89cf4550c1..1286613cb13 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs @@ -1,13 +1,9 @@ +// edition:2021 // run-pass // Test that functional record update/struct update syntax works inside // a closure when the feature `capture_disjoint_fields` is enabled. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 - #[derive(Clone)] struct S { a: String, diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.stderr deleted file mode 100644 index 7ed73abba86..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.stderr +++ /dev/null @@ -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/fru_syntax.rs:6:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs index 9c086fe4bdf..d2375aa69ec 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs @@ -1,6 +1,5 @@ +// edition:2021 //check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![warn(unused)] #![feature(rustc_attrs)] #![feature(btree_drain_filter)] diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.stderr deleted file mode 100644 index bc046ecad68..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.stderr +++ /dev/null @@ -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/lit-pattern-matching-with-methods.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs index afaafbda018..65c8a5a7850 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs @@ -1,10 +1,8 @@ +// edition:2021 // run-pass // Test that move closures compile properly with `capture_disjoint_fields` enabled. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - fn simple_ref() { let mut s = 10; let ref_s = &mut s; diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.stderr deleted file mode 100644 index c1d8ba575d6..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.stderr +++ /dev/null @@ -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/move_closure.rs:5:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs index 142c156bd56..b8e46403181 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs @@ -1,3 +1,4 @@ +// edition:2021 // run-pass // Test that closures can catpure paths that are more precise than just one level @@ -7,10 +8,6 @@ // while being able to mutate another path outside the closure, where the two paths are disjoint // after applying two projections on the root variable. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 #![allow(unused)] struct Point { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.stderr deleted file mode 100644 index 94b877522f4..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.stderr +++ /dev/null @@ -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/multilevel-path-1.rs:10:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs index d8f7d55d5aa..11a324d8a34 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs @@ -1,9 +1,6 @@ +// edition:2021 // run-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 #![allow(unused)] // If the closures can handle such precison we should be able to read one path in the closure diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.stderr deleted file mode 100644 index 100a0e167c5..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.stderr +++ /dev/null @@ -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/multilevel-path-2.rs:3:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.rs index fc3d48ec458..8fc0efb60b7 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.rs @@ -1,9 +1,6 @@ +// edition:2021 // run-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 #![allow(unused)] // Test that when `capture_disjoint_fields` is enabled we can read a path diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.stderr deleted file mode 100644 index cf5be6a00e9..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-3.stderr +++ /dev/null @@ -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/multilevel-path-3.rs:3:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.rs index 315622443c3..9f0c4d96aa5 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.rs @@ -1,11 +1,9 @@ +// edition:2021 // run-pass // Test that we can mutate a place through a mut-borrow // that is captured by the closure -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - // Check that we can mutate when one deref is required fn mut_ref_1() { let mut x = String::new(); diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.stderr deleted file mode 100644 index 4b37a0b405f..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref.stderr +++ /dev/null @@ -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/mut_ref.rs:6:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs index 2dba923647a..bb784774b8c 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs @@ -1,3 +1,4 @@ +// edition:2021 // run-pass // Test that we can mutate a place through a mut-borrow @@ -6,9 +7,6 @@ // More specifically we test that the if the mutable reference isn't root variable of a capture // but rather accessed while acessing the precise capture. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - fn mut_tuple() { let mut t = (10, 10); diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.stderr deleted file mode 100644 index 418ab29098b..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.stderr +++ /dev/null @@ -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/mut_ref_struct_mem.rs:9:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.rs index 238580929ef..a80b40bb469 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.rs @@ -1,12 +1,8 @@ +// edition:2021 // run-pass // Test whether if we can do precise capture when using nested clsoure. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 - struct Point { x: i32, y: i32, diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.stderr deleted file mode 100644 index 293aa82ce9f..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/nested-closure.stderr +++ /dev/null @@ -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/nested-closure.rs:5:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.rs index d260a448926..045fe78040a 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.rs @@ -1,6 +1,5 @@ +// edition:2021 //check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![warn(unused)] #![feature(rustc_attrs)] diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.stderr deleted file mode 100644 index 3e4303a3710..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/struct-pattern-matching-with-methods.stderr +++ /dev/null @@ -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/struct-pattern-matching-with-methods.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.rs index b3bee79254e..f3f44433ccf 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.rs @@ -1,6 +1,5 @@ +// edition:2021 //check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #[derive(Copy, Clone)] enum PointType { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.stderr deleted file mode 100644 index ded0e37b0f3..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/tuple-struct-pattern-matching-with-methods.stderr +++ /dev/null @@ -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/tuple-struct-pattern-matching-with-methods.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.rs index f6e9862b26c..8e4f91c27e2 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.rs @@ -1,10 +1,8 @@ +// edition:2021 // run-pass // Test that we can use raw ptrs when using `capture_disjoint_fields`. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete - #[derive(Debug)] struct S { s: String, diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.stderr deleted file mode 100644 index c64c8b72e81..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/unsafe_ptr.stderr +++ /dev/null @@ -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/unsafe_ptr.rs:5:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs index 0e6da8f4f18..0206927cc59 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.rs @@ -1,6 +1,5 @@ +// edition:2021 //check-pass -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete #![feature(rustc_attrs)] fn main() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.stderr deleted file mode 100644 index 7d16d77bf73..00000000000 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/use_of_mutable_borrow_and_fake_reads.stderr +++ /dev/null @@ -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/use_of_mutable_borrow_and_fake_reads.rs:2:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs b/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs index a6b5e12d2ed..563095d440d 100644 --- a/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs +++ b/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs @@ -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 #![feature(rustc_attrs)] // Test to ensure that min analysis meets capture kind for all paths captured. diff --git a/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.stderr b/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.stderr index cbbc8792199..05d79797ab3 100644 --- a/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.stderr +++ b/src/test/ui/closures/2229_closure_analysis/simple-struct-min-capture.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/simple-struct-min-capture.rs:27:17 + --> $DIR/simple-struct-min-capture.rs:23:17 | LL | let mut c = #[rustc_capture_analysis] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,17 +7,8 @@ LL | let mut c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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/simple-struct-min-capture.rs:3:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - error: First Pass analysis includes: - --> $DIR/simple-struct-min-capture.rs:30:5 + --> $DIR/simple-struct-min-capture.rs:26:5 | LL | / || { LL | | @@ -29,18 +20,18 @@ LL | | }; | |_____^ | note: Capturing p[(0, 0)] -> MutBorrow - --> $DIR/simple-struct-min-capture.rs:33:9 + --> $DIR/simple-struct-min-capture.rs:29:9 | LL | p.x += 10; | ^^^ note: Capturing p[] -> ImmBorrow - --> $DIR/simple-struct-min-capture.rs:36:26 + --> $DIR/simple-struct-min-capture.rs:32:26 | LL | println!("{:?}", p); | ^ error: Min Capture analysis includes: - --> $DIR/simple-struct-min-capture.rs:30:5 + --> $DIR/simple-struct-min-capture.rs:26:5 | LL | / || { LL | | @@ -52,7 +43,7 @@ LL | | }; | |_____^ | note: Min Capture p[] -> MutBorrow - --> $DIR/simple-struct-min-capture.rs:33:9 + --> $DIR/simple-struct-min-capture.rs:29:9 | LL | p.x += 10; | ^^^ p[] captured as MutBorrow here @@ -60,6 +51,6 @@ LL | p.x += 10; LL | println!("{:?}", p); | ^ 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`. diff --git a/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.rs b/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.rs index 79d3ecc2d2b..eab9f9d08a9 100644 --- a/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.rs +++ b/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.rs @@ -1,10 +1,9 @@ +// edition:2021 + // Test that we restrict precision of a capture when we access a raw ptr, // i.e. the capture doesn't deref the raw ptr. -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| `#[warn(incomplete_features)]` on by default -//~| see issue #53488 + #![feature(rustc_attrs)] #[derive(Debug)] diff --git a/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.stderr b/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.stderr index 4508b2426e8..e740a4d2d6b 100644 --- a/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.stderr +++ b/src/test/ui/closures/2229_closure_analysis/unsafe_ptr.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/unsafe_ptr.rs:26:13 + --> $DIR/unsafe_ptr.rs:25:13 | 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 error[E0658]: attributes on expressions are experimental - --> $DIR/unsafe_ptr.rs:46:13 + --> $DIR/unsafe_ptr.rs:45:13 | LL | let c = #[rustc_capture_analysis] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,17 +16,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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/unsafe_ptr.rs:4:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - error: First Pass analysis includes: - --> $DIR/unsafe_ptr.rs:29:6 + --> $DIR/unsafe_ptr.rs:28:6 | LL | / || unsafe { LL | | @@ -38,13 +29,13 @@ LL | | }; | |_____^ | note: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow - --> $DIR/unsafe_ptr.rs:32:26 + --> $DIR/unsafe_ptr.rs:31:26 | LL | println!("{:?}", (*t.0).s); | ^^^^^^^^ error: Min Capture analysis includes: - --> $DIR/unsafe_ptr.rs:29:6 + --> $DIR/unsafe_ptr.rs:28:6 | LL | / || unsafe { LL | | @@ -56,13 +47,13 @@ LL | | }; | |_____^ | note: Min Capture t[(0, 0)] -> ImmBorrow - --> $DIR/unsafe_ptr.rs:32:26 + --> $DIR/unsafe_ptr.rs:31:26 | LL | println!("{:?}", (*t.0).s); | ^^^^^^^^ error: First Pass analysis includes: - --> $DIR/unsafe_ptr.rs:49:5 + --> $DIR/unsafe_ptr.rs:48:5 | LL | / || { LL | | @@ -74,13 +65,13 @@ LL | | }; | |_____^ | note: Capturing p[Deref,(0, 0)] -> ImmBorrow - --> $DIR/unsafe_ptr.rs:52:31 + --> $DIR/unsafe_ptr.rs:51:31 | LL | let x = unsafe { &mut (*p).s }; | ^^^^^^ error: Min Capture analysis includes: - --> $DIR/unsafe_ptr.rs:49:5 + --> $DIR/unsafe_ptr.rs:48:5 | LL | / || { LL | | @@ -92,11 +83,11 @@ LL | | }; | |_____^ | note: Min Capture p[] -> ImmBorrow - --> $DIR/unsafe_ptr.rs:52:31 + --> $DIR/unsafe_ptr.rs:51:31 | LL | let x = unsafe { &mut (*p).s }; | ^^^^^^ -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`. diff --git a/src/test/ui/closures/2229_closure_analysis/wild_patterns.rs b/src/test/ui/closures/2229_closure_analysis/wild_patterns.rs index 90b8033d074..7843c251666 100644 --- a/src/test/ui/closures/2229_closure_analysis/wild_patterns.rs +++ b/src/test/ui/closures/2229_closure_analysis/wild_patterns.rs @@ -1,7 +1,5 @@ -#![feature(capture_disjoint_fields)] -//~^ WARNING: the feature `capture_disjoint_fields` is incomplete -//~| NOTE: `#[warn(incomplete_features)]` on by default -//~| NOTE: see issue #53488 +// edition:2021 + #![feature(rustc_attrs)] // Test to ensure that we can handle cases where diff --git a/src/test/ui/closures/2229_closure_analysis/wild_patterns.stderr b/src/test/ui/closures/2229_closure_analysis/wild_patterns.stderr index 36be8431be5..c64378091e6 100644 --- a/src/test/ui/closures/2229_closure_analysis/wild_patterns.stderr +++ b/src/test/ui/closures/2229_closure_analysis/wild_patterns.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/wild_patterns.rs:24:13 + --> $DIR/wild_patterns.rs:22:13 | 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 error[E0658]: attributes on expressions are experimental - --> $DIR/wild_patterns.rs:42:13 + --> $DIR/wild_patterns.rs:40:13 | 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 error[E0658]: attributes on expressions are experimental - --> $DIR/wild_patterns.rs:60:13 + --> $DIR/wild_patterns.rs:58:13 | LL | let c = #[rustc_capture_analysis] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,17 +25,8 @@ LL | let c = #[rustc_capture_analysis] = note: see issue #15701 for more information = 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/wild_patterns.rs:1:12 - | -LL | #![feature(capture_disjoint_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #53488 for more information - error: First Pass analysis includes: - --> $DIR/wild_patterns.rs:27:5 + --> $DIR/wild_patterns.rs:25:5 | LL | / || { LL | | @@ -47,13 +38,13 @@ LL | | }; | |_____^ | note: Capturing p[(0, 0)] -> ImmBorrow - --> $DIR/wild_patterns.rs:31:37 + --> $DIR/wild_patterns.rs:29:37 | LL | let Point { x: _x, y: _ } = p; | ^ error: Min Capture analysis includes: - --> $DIR/wild_patterns.rs:27:5 + --> $DIR/wild_patterns.rs:25:5 | LL | / || { LL | | @@ -65,13 +56,13 @@ LL | | }; | |_____^ | note: Min Capture p[(0, 0)] -> ImmBorrow - --> $DIR/wild_patterns.rs:31:37 + --> $DIR/wild_patterns.rs:29:37 | LL | let Point { x: _x, y: _ } = p; | ^ error: First Pass analysis includes: - --> $DIR/wild_patterns.rs:45:5 + --> $DIR/wild_patterns.rs:43:5 | LL | / || { LL | | @@ -83,13 +74,13 @@ LL | | }; | |_____^ | note: Capturing t[(0, 0)] -> ByValue - --> $DIR/wild_patterns.rs:49:23 + --> $DIR/wild_patterns.rs:47:23 | LL | let (_x, _) = t; | ^ error: Min Capture analysis includes: - --> $DIR/wild_patterns.rs:45:5 + --> $DIR/wild_patterns.rs:43:5 | LL | / || { LL | | @@ -101,13 +92,13 @@ LL | | }; | |_____^ | note: Min Capture t[(0, 0)] -> ByValue - --> $DIR/wild_patterns.rs:49:23 + --> $DIR/wild_patterns.rs:47:23 | LL | let (_x, _) = t; | ^ error: First Pass analysis includes: - --> $DIR/wild_patterns.rs:63:5 + --> $DIR/wild_patterns.rs:61:5 | LL | / || { LL | | @@ -119,13 +110,13 @@ LL | | }; | |_____^ | note: Capturing arr[Index] -> ByValue - --> $DIR/wild_patterns.rs:67:23 + --> $DIR/wild_patterns.rs:65:23 | LL | let [_x, _] = arr; | ^^^ error: Min Capture analysis includes: - --> $DIR/wild_patterns.rs:63:5 + --> $DIR/wild_patterns.rs:61:5 | LL | / || { LL | | @@ -137,11 +128,11 @@ LL | | }; | |_____^ | note: Min Capture arr[] -> ByValue - --> $DIR/wild_patterns.rs:67:23 + --> $DIR/wild_patterns.rs:65:23 | LL | let [_x, _] = arr; | ^^^ -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`.