-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests, fix span issue, improve diagnostics.
- Loading branch information
Showing
7 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(raw_dylib)] | ||
//~^ WARN the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
|
||
#[link(name="foo")] | ||
extern { | ||
#[link_name="foo"] | ||
#[link_ordinal(42)] | ||
//~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]` | ||
fn foo(); | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
warning: the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
--> $DIR/link-ordinal-and-name.rs:1:12 | ||
| | ||
LL | #![feature(raw_dylib)] | ||
| ^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: cannot use `#[link_name]` with `#[link_ordinal]` | ||
--> $DIR/link-ordinal-and-name.rs:7:5 | ||
| | ||
LL | #[link_ordinal(42)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
11 changes: 11 additions & 0 deletions
11
src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(raw_dylib)] | ||
//~^ WARN the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
|
||
#[link(name="foo")] | ||
extern { | ||
#[link_ordinal("JustMonika")] | ||
//~^ ERROR illegal ordinal format in `link_ordinal` | ||
fn foo(); | ||
} | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
warning: the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
--> $DIR/link-ordinal-invalid-format.rs:1:12 | ||
| | ||
LL | #![feature(raw_dylib)] | ||
| ^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: illegal ordinal format in `link_ordinal` | ||
--> $DIR/link-ordinal-invalid-format.rs:6:5 | ||
| | ||
LL | #[link_ordinal("JustMonika")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: an unsuffixed integer value, e.g., `1`, is expected | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![feature(raw_dylib)] | ||
//~^ WARN the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
|
||
#[link(name="foo")] | ||
extern { | ||
#[link_ordinal(18446744073709551616)] | ||
//~^ ERROR ordinal value in `link_ordinal` is too large: `18446744073709551616` | ||
fn foo(); | ||
} | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
warning: the feature `raw_dylib` is incomplete and may cause the compiler to crash | ||
--> $DIR/link-ordinal-too-large.rs:1:12 | ||
| | ||
LL | #![feature(raw_dylib)] | ||
| ^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: ordinal value in `link_ordinal` is too large: `18446744073709551616` | ||
--> $DIR/link-ordinal-too-large.rs:6:5 | ||
| | ||
LL | #[link_ordinal(18446744073709551616)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the value may not exceed `std::usize::MAX` | ||
|
||
error: aborting due to previous error | ||
|