forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aman Arora <me@aman-arora.com>
- Loading branch information
1 parent
16bef5c
commit 08b85c8
Showing
7 changed files
with
66 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
1 change: 1 addition & 0 deletions
1
src/test/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
For closure=DefId(0:4 ~ feature_gate_capture_disjoint_fields[317d]::main::{closure#0}): Using new-style capture analysis |