forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#105464 - nbdd0121:hir, r=compiler-errors
Support #[track_caller] on async closures Follow up on rust-lang#105180 r? ```@compiler-errors``` cc ```@cjgillot```
- Loading branch information
Showing
10 changed files
with
124 additions
and
49 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// edition:2021 | ||
|
||
#![feature(closure_track_caller, stmt_expr_attributes)] | ||
|
||
fn main() { | ||
let _ = #[track_caller] async { | ||
//~^ ERROR attribute should be applied to a function definition [E0739] | ||
}; | ||
} |
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 @@ | ||
error[E0739]: attribute should be applied to a function definition | ||
--> $DIR/async-block.rs:6:13 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| _____________^^^^^^^^^^^^^^^_- | ||
LL | | | ||
LL | | }; | ||
| |_____- not a function definition | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0739`. |
10 changes: 10 additions & 0 deletions
10
src/test/ui/async-await/track-caller/async-closure-gate.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,10 @@ | ||
// edition:2021 | ||
|
||
#![feature(async_closure, stmt_expr_attributes)] | ||
|
||
fn main() { | ||
let _ = #[track_caller] async || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
//~| ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/test/ui/async-await/track-caller/async-closure-gate.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,25 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:6:13 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:6:38 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ______________________________________^ | ||
LL | | | ||
LL | | | ||
LL | | }; | ||
| |_____^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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