Skip to content

Commit 6c7538d

Browse files
committed
Port #[link_ordinal] to the new attribute parsing infrastructure.
1 parent 71cd1bb commit 6c7538d

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#[link(name = "foo")]
22
extern "C" {
33
#[link_ordinal("JustMonika")]
4-
//~^ ERROR illegal ordinal format in `link_ordinal`
4+
//~^ ERROR malformed `link_ordinal` attribute input
55
fn foo();
66
#[link_ordinal("JustMonika")]
7-
//~^ ERROR illegal ordinal format in `link_ordinal`
7+
//~^ ERROR malformed `link_ordinal` attribute input
88
static mut imported_variable: i32;
99
}
1010

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
error: illegal ordinal format in `link_ordinal`
1+
error[E0539]: malformed `link_ordinal` attribute input
22
--> $DIR/link-ordinal-invalid-format.rs:3:5
33
|
44
LL | #[link_ordinal("JustMonika")]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: an unsuffixed integer value, e.g., `1`, is expected
5+
| ^^^^^^^^^^^^^^^------------^^
6+
| | |
7+
| | expected an integer literal here
8+
| help: must be of the form: `#[link_ordinal(ordinal)]`
89

9-
error: illegal ordinal format in `link_ordinal`
10+
error[E0539]: malformed `link_ordinal` attribute input
1011
--> $DIR/link-ordinal-invalid-format.rs:6:5
1112
|
1213
LL | #[link_ordinal("JustMonika")]
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14-
|
15-
= note: an unsuffixed integer value, e.g., `1`, is expected
14+
| ^^^^^^^^^^^^^^^------------^^
15+
| | |
16+
| | expected an integer literal here
17+
| help: must be of the form: `#[link_ordinal(ordinal)]`
1618

1719
error: aborting due to 2 previous errors
1820

21+
For more information about this error, try `rustc --explain E0539`.

tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ error[E0805]: malformed `link_ordinal` attribute input
22
--> $DIR/link-ordinal-missing-argument.rs:3:5
33
|
44
LL | #[link_ordinal()]
5-
| ^^^^^^^^^^^^^^^^^
6-
| |
7-
| expected a single argument here
5+
| ^^^^^^^^^^^^^^--^
6+
| | |
7+
| | expected a single argument here
88
| help: must be of the form: `#[link_ordinal(ordinal)]`
99

1010
error[E0805]: malformed `link_ordinal` attribute input
1111
--> $DIR/link-ordinal-missing-argument.rs:7:5
1212
|
1313
LL | #[link_ordinal()]
14-
| ^^^^^^^^^^^^^^^^^
15-
| |
16-
| expected a single argument here
14+
| ^^^^^^^^^^^^^^--^
15+
| | |
16+
| | expected a single argument here
1717
| help: must be of the form: `#[link_ordinal(ordinal)]`
1818

1919
error: aborting due to 2 previous errors

tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ error[E0805]: malformed `link_ordinal` attribute input
22
--> $DIR/link-ordinal-too-many-arguments.rs:3:5
33
|
44
LL | #[link_ordinal(3, 4)]
5-
| ^^^^^^^^^^^^^^^^^^^^^
6-
| |
7-
| expected a single argument here
5+
| ^^^^^^^^^^^^^^------^
6+
| | |
7+
| | expected a single argument here
88
| help: must be of the form: `#[link_ordinal(ordinal)]`
99

1010
error[E0805]: malformed `link_ordinal` attribute input
1111
--> $DIR/link-ordinal-too-many-arguments.rs:7:5
1212
|
1313
LL | #[link_ordinal(3, 4)]
14-
| ^^^^^^^^^^^^^^^^^^^^^
15-
| |
16-
| expected a single argument here
14+
| ^^^^^^^^^^^^^^------^
15+
| | |
16+
| | expected a single argument here
1717
| help: must be of the form: `#[link_ordinal(ordinal)]`
1818

1919
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)