|
1 | 1 | //~ NOTE not a function
|
2 |
| -//~^ NOTE not a foreign function or static |
3 |
| -//~^^ NOTE not a function or static |
| 2 | +//~| NOTE not a foreign function or static |
| 3 | +//~| NOTE not a function or static |
| 4 | +//~| NOTE not an `extern` block |
4 | 5 | // This test enumerates as many compiler-builtin ungated attributes as
|
5 | 6 | // possible (that is, all the mutually compatible ones), and checks
|
6 | 7 | // that we get "expected" (*) warnings for each in the various weird
|
|
59 | 60 | #![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect
|
60 | 61 | #![doc = "2400"]
|
61 | 62 | #![cold] //~ WARN attribute should be applied to a function
|
62 |
| -//~^ WARN |
63 |
| -// see issue-43106-gating-of-builtin-attrs-error.rs |
64 |
| -#![link()] |
| 63 | +//~^ WARN this was previously accepted |
| 64 | +#![link()] //~ WARN attribute should be applied to an `extern` block |
| 65 | +//~^ WARN this was previously accepted |
65 | 66 | #![link_name = "1900"]
|
66 | 67 | //~^ WARN attribute should be applied to a foreign function
|
67 | 68 | //~^^ WARN this was previously accepted by the compiler
|
@@ -547,22 +548,38 @@ mod link_section {
|
547 | 548 | }
|
548 | 549 |
|
549 | 550 |
|
550 |
| -// Note that this is a `check-pass` test, so it |
551 |
| -// will never invoke the linker. These are here nonetheless to point |
552 |
| -// out that we allow them at non-crate-level (though I do not know |
553 |
| -// whether they have the same effect here as at crate-level). |
| 551 | +// Note that this is a `check-pass` test, so it will never invoke the linker. |
554 | 552 |
|
555 | 553 | #[link()]
|
| 554 | +//~^ WARN attribute should be applied to an `extern` block |
| 555 | +//~| WARN this was previously accepted |
556 | 556 | mod link {
|
| 557 | + //~^ NOTE not an `extern` block |
| 558 | + |
557 | 559 | mod inner { #![link()] }
|
| 560 | + //~^ WARN attribute should be applied to an `extern` block |
| 561 | + //~| WARN this was previously accepted |
| 562 | + //~| NOTE not an `extern` block |
558 | 563 |
|
559 | 564 | #[link()] fn f() { }
|
| 565 | + //~^ WARN attribute should be applied to an `extern` block |
| 566 | + //~| WARN this was previously accepted |
| 567 | + //~| NOTE not an `extern` block |
560 | 568 |
|
561 | 569 | #[link()] struct S;
|
| 570 | + //~^ WARN attribute should be applied to an `extern` block |
| 571 | + //~| WARN this was previously accepted |
| 572 | + //~| NOTE not an `extern` block |
562 | 573 |
|
563 | 574 | #[link()] type T = S;
|
| 575 | + //~^ WARN attribute should be applied to an `extern` block |
| 576 | + //~| WARN this was previously accepted |
| 577 | + //~| NOTE not an `extern` block |
564 | 578 |
|
565 | 579 | #[link()] impl S { }
|
| 580 | + //~^ WARN attribute should be applied to an `extern` block |
| 581 | + //~| WARN this was previously accepted |
| 582 | + //~| NOTE not an `extern` block |
566 | 583 | }
|
567 | 584 |
|
568 | 585 | struct StructForDeprecated;
|
|
0 commit comments