Indroduce feature flag for RFC-2229

Signed-off-by: Aman Arora <me@aman-arora.com>
This commit is contained in:
Aman Arora 2020-10-11 00:14:11 -04:00
parent 127a6ede1d
commit 88310cc0eb
7 changed files with 66 additions and 16 deletions

View file

@ -0,0 +1,12 @@
#![feature(capture_disjoint_fields)]
//~^ WARNING the feature `capture_disjoint_fields` is incomplete
#![feature(rustc_attrs)]
fn main() {
let s = format!("s");
let c = #[rustc_capture_analysis] || {
//~^ ERROR: attributes on expressions are experimental
println!("This uses new capture analyysis to capture s={}", s);
};
}

View file

@ -0,0 +1,21 @@
error[E0658]: attributes on expressions are experimental
--> $DIR/feature-gate-capture_disjoint_fields.rs:8:13
|
LL | let c = #[rustc_capture_analysis] || {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/feature-gate-capture_disjoint_fields.rs:1:12
|
LL | #![feature(capture_disjoint_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0658`.

View file

@ -0,0 +1 @@
For closure=DefId(0:4 ~ feature_gate_capture_disjoint_fields[317d]::main::{closure#0}): Using new-style capture analysis