forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63948 - crlf0710:path_to_raw_dylib, r=Centril
Add feature gate for raw_dylib. This PR adds the feature gate for RFC 2627 (rust-lang#58713). It doesn't contain the actual functionality. Add I'm not sure whether i did it correctly, since this is the first time i did this. r? @Centril
- Loading branch information
Showing
19 changed files
with
221 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
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
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
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
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,8 @@ | ||
#[link(name="foo")] | ||
extern { | ||
#[link_ordinal(42)] | ||
//~^ ERROR: the `#[link_ordinal]` attribute is an experimental feature | ||
fn foo(); | ||
} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/rfc-2627-raw-dylib/feature-gate-raw-dylib-2.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,12 @@ | ||
error[E0658]: the `#[link_ordinal]` attribute is an experimental feature | ||
--> $DIR/feature-gate-raw-dylib-2.rs:3:5 | ||
| | ||
LL | #[link_ordinal(42)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/58713 | ||
= help: add `#![feature(raw_dylib)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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,5 @@ | ||
#[link(name="foo", kind="raw-dylib")] | ||
//~^ ERROR: kind="raw-dylib" is unstable | ||
extern {} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/rfc-2627-raw-dylib/feature-gate-raw-dylib.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,12 @@ | ||
error[E0658]: kind="raw-dylib" is unstable | ||
--> $DIR/feature-gate-raw-dylib.rs:1:1 | ||
| | ||
LL | #[link(name="foo", kind="raw-dylib")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/58713 | ||
= help: add `#![feature(raw_dylib)]` to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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 | ||
|