|
1 | | -//~ NOTE not an `extern` block |
2 | 1 | // This test enumerates as many compiler-builtin ungated attributes as |
3 | 2 | // possible (that is, all the mutually compatible ones), and checks |
4 | 3 | // that we get "expected" (*) warnings for each in the various weird |
|
67 | 66 | //~| WARN previously accepted |
68 | 67 | //~| HELP can only be applied to |
69 | 68 | //~| HELP remove the attribute |
70 | | -#![link(name = "x")] //~ WARN attribute should be applied to an `extern` block |
71 | | -//~^ WARN this was previously accepted |
| 69 | +#![link(name = "x")] //~ WARN attribute cannot be used on |
| 70 | +//~| WARN this was previously accepted |
| 71 | +//~| HELP can only be applied to foreign modules |
| 72 | +//~| HELP remove the attribute |
72 | 73 | #![link_name = "1900"] |
73 | 74 | //~^ WARN attribute cannot be used on |
74 | 75 | //~| WARN previously accepted |
@@ -683,35 +684,40 @@ mod link_section { |
683 | 684 | // Note that this is a `check-pass` test, so it will never invoke the linker. |
684 | 685 |
|
685 | 686 | #[link(name = "x")] |
686 | | -//~^ WARN attribute should be applied to an `extern` block |
| 687 | +//~^ WARN attribute cannot be used on |
687 | 688 | //~| WARN this was previously accepted |
| 689 | +//~| HELP can only be applied to foreign modules |
| 690 | +//~| HELP remove the attribute |
688 | 691 | mod link { |
689 | | - //~^ NOTE not an `extern` block |
690 | | - |
691 | 692 | mod inner { #![link(name = "x")] } |
692 | | - //~^ WARN attribute should be applied to an `extern` block |
| 693 | + //~^ WARN attribute cannot be used on |
693 | 694 | //~| WARN this was previously accepted |
694 | | - //~| NOTE not an `extern` block |
| 695 | + //~| HELP can only be applied to foreign modules |
| 696 | + //~| HELP remove the attribute |
695 | 697 |
|
696 | 698 | #[link(name = "x")] fn f() { } |
697 | | - //~^ WARN attribute should be applied to an `extern` block |
| 699 | + //~^ WARN attribute cannot be used on |
698 | 700 | //~| WARN this was previously accepted |
699 | | - //~| NOTE not an `extern` block |
| 701 | + //~| HELP can only be applied to foreign modules |
| 702 | + //~| HELP remove the attribute |
700 | 703 |
|
701 | 704 | #[link(name = "x")] struct S; |
702 | | - //~^ WARN attribute should be applied to an `extern` block |
| 705 | + //~^ WARN attribute cannot be used on |
703 | 706 | //~| WARN this was previously accepted |
704 | | - //~| NOTE not an `extern` block |
| 707 | + //~| HELP can only be applied to foreign modules |
| 708 | + //~| HELP remove the attribute |
705 | 709 |
|
706 | 710 | #[link(name = "x")] type T = S; |
707 | | - //~^ WARN attribute should be applied to an `extern` block |
| 711 | + //~^ WARN attribute cannot be used on |
708 | 712 | //~| WARN this was previously accepted |
709 | | - //~| NOTE not an `extern` block |
| 713 | + //~| HELP can only be applied to foreign modules |
| 714 | + //~| HELP remove the attribute |
710 | 715 |
|
711 | 716 | #[link(name = "x")] impl S { } |
712 | | - //~^ WARN attribute should be applied to an `extern` block |
| 717 | + //~^ WARN attribute cannot be used on |
713 | 718 | //~| WARN this was previously accepted |
714 | | - //~| NOTE not an `extern` block |
| 719 | + //~| HELP can only be applied to foreign modules |
| 720 | + //~| HELP remove the attribute |
715 | 721 |
|
716 | 722 | #[link(name = "x")] extern "Rust" {} |
717 | 723 | //~^ WARN attribute should be applied to an `extern` block |
|
0 commit comments