Skip to content

Commit

Permalink
async-move-2015: Rename test, add comments, remove test output
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Nov 20, 2023
1 parent 9f12677 commit c639090
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// force-host
// no-prefer-dynamic

// Proc macro helper for issue #89699, used by tests/ui/proc-macro/edition-gated-async-move-
// syntax-issue89699.rs, emitting an `async move` closure. This syntax is only available in
// editions 2018 and up, but is used in edition 2015 in the test.

#![crate_type = "proc-macro"]

extern crate proc_macro;
Expand Down Expand Up @@ -31,6 +35,5 @@ pub fn foo(_attr: TokenStream, item: TokenStream) -> TokenStream {
TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())),
TokenTree::Group(Group::new(Delimiter::Brace, body)),
]);
eprintln!("{:?}", ret);
ret
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// aux-build:edition-gated-async-move-syntax.rs
// edition: 2015

// Non-regression test for issue #89699, where a proc-macro emitting syntax only available in edition 2018 and up (`async move`) is used on edition 2015

Check failure on line 4 in tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs

View workflow job for this annotation

GitHub Actions / PR - mingw-check-tidy

line longer than 100 chars

extern crate edition_gated_async_move_syntax;

#[edition_gated_async_move_syntax::foo]
fn foo() {} //~ ERROR `async move` blocks are only allowed in Rust 2018 or later
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: `async move` blocks are only allowed in Rust 2018 or later
--> $DIR/edition-gated-async-move-syntax-issue89699.rs:9:1
|
LL | fn foo() {}
| ^^

error: aborting due to previous error

6 changes: 0 additions & 6 deletions tests/ui/proc-macro/issue-89699.rs

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ui/proc-macro/issue-89699.stderr

This file was deleted.

0 comments on commit c639090

Please sign in to comment.