Revert "Add rustc_test_entrypoint_marker" - #161931
Conversation
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred in compiler/rustc_attr_ir Some changes occurred in compiler/rustc_attr_parsing |
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Yeah #161917 is the annoying one of the two. |
|
Consider also cases like #![feature(macro_metavar_expr_concat)]
#![feature(macro_attr)]
macro_rules! ohno {
attr() { $(#[$a:meta])* fn $name:ident () $body: block } => {
$(#[$a])*
fn ${ concat(not_, $name) }() $body
}
}
#[ohno]
#[test]
fn works() {}
#[test]
#[ohno]
fn no_works() {}So it was already possible to combine misbehaving attribute macros and Another way to fix this and these issues is to make the test macro reorder itself, i.e. for #[test] // not last
#[ohno]
fn blah() {}we expand into #[ohno]
#[test] // last!
fn blah() {} |
There was a problem hiding this comment.
The following also does not work (despite not being weird) , can you add it as a test case?
#![feature(macro_attr)]
macro_rules! ohno {
attr() { $(#[$a:meta])* fn $name:ident () $body: block } => {
$(#[$a])*
fn $name () $body
}
}
#[test]
#[ohno]
fn my_test() {}produces:
error[E0658]: use of an internal attribute
--> src/lib.rs:10:1
|
10 | #[test]
| ^^^^^^^
|
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
= note: the `rustc_test_entrypoint_marker` attribute is an internal implementation detail that will never be stable
For more information about this error, try `rustc --explain E0658`.
|
Good idea! Added |
| @@ -0,0 +1,17 @@ | |||
| //@ check-pass | |||
There was a problem hiding this comment.
| //@ check-pass | |
| //@ check-pass | |
| //@ compile-flags: --test |
There was a problem hiding this comment.
Oh whooops that's terrible, thanks for catching that!
7418683 to
9b70ab0
Compare
|
Confirmed that the test now fails before the revert. |
…point, r=mejrs Revert "Add rustc_test_entrypoint_marker" Reverts rust-lang#158854 because it caused two beta regressions Revert required some minor solving of conflicts We can think about re-landing it after Fixes rust-lang#161920 Fixes rust-lang#161917 cc: @Nadrieril @N1ark @aDotInTheVoid @jdonszelmann
…uwer Rollup of 8 pull requests Successful merges: - #137720 (support `#[target_feature(enable = ...)]` on `#[naked]` functions) - #160923 (Handle multiple action records in EH personality function) - #161788 (Check to ensure we're running against the correct LLVM version) - #161644 (bootstrap: Flatten and rename `compute_src_directory_via_git`) - #161702 (Use `drop_guard` in some places in {core,alloc,std}) - #161931 (Revert "Add rustc_test_entrypoint_marker") - #162015 (touch up "get attribute" docs.) - #162019 (remove a couple of redundant clones, thanks clippy)
…point, r=mejrs Revert "Add rustc_test_entrypoint_marker" Reverts rust-lang#158854 because it caused two beta regressions Revert required some minor solving of conflicts We can think about re-landing it after Fixes rust-lang#161920 Fixes rust-lang#161917 cc: @Nadrieril @N1ark @aDotInTheVoid @jdonszelmann
…point, r=mejrs Revert "Add rustc_test_entrypoint_marker" Reverts rust-lang#158854 because it caused two beta regressions Revert required some minor solving of conflicts We can think about re-landing it after Fixes rust-lang#161920 Fixes rust-lang#161917 cc: @Nadrieril @N1ark @aDotInTheVoid @jdonszelmann
…uwer Rollup of 11 pull requests Successful merges: - #160923 (Handle multiple action records in EH personality function) - #161788 (Check to ensure we're running against the correct LLVM version) - #158303 (Always escape grapheme extenders in `str::escape_debug`) - #161644 (bootstrap: Flatten and rename `compute_src_directory_via_git`) - #161702 (Use `drop_guard` in some places in {core,alloc,std}) - #161713 (Add config for gram editor to .gitignore) - #161792 (Fix and improve diagnostics for lint `rust_2021_prefixes_incompatible_syntax`) - #161931 (Revert "Add rustc_test_entrypoint_marker") - #162015 (touch up "get attribute" docs.) - #162019 (remove a couple of redundant clones, thanks clippy) - #162023 (Remove redundant braces from `NonZero` doctests)
…uwer Rollup of 11 pull requests Successful merges: - #160923 (Handle multiple action records in EH personality function) - #161788 (Check to ensure we're running against the correct LLVM version) - #158303 (Always escape grapheme extenders in `str::escape_debug`) - #161644 (bootstrap: Flatten and rename `compute_src_directory_via_git`) - #161702 (Use `drop_guard` in some places in {core,alloc,std}) - #161713 (Add config for gram editor to .gitignore) - #161792 (Fix and improve diagnostics for lint `rust_2021_prefixes_incompatible_syntax`) - #161931 (Revert "Add rustc_test_entrypoint_marker") - #162015 (touch up "get attribute" docs.) - #162019 (remove a couple of redundant clones, thanks clippy) - #162023 (Remove redundant braces from `NonZero` doctests)
Rollup merge of #161931 - JonathanBrouwer:revert-test-entry-point, r=mejrs Revert "Add rustc_test_entrypoint_marker" Reverts #158854 because it caused two beta regressions Revert required some minor solving of conflicts We can think about re-landing it after Fixes #161920 Fixes #161917 cc: @Nadrieril @N1ark @aDotInTheVoid @jdonszelmann
Reverts #158854 because it caused two beta regressions
Revert required some minor solving of conflicts
We can think about re-landing it after
Fixes #161920
Fixes #161917
cc: @Nadrieril @N1ark @aDotInTheVoid @jdonszelmann