about summary refs log tree commit diff
path: root/tests/ui/rfcs
diff options
context:
space:
mode:
authorNoratrieb <48135649+Noratrieb@users.noreply.github.com>2025-01-18 18:19:42 +0100
committerNoratrieb <48135649+Noratrieb@users.noreply.github.com>2025-02-26 19:09:51 +0100
commita954c512809a2d6f3e592c0287dbe41264b54808 (patch)
treec912fd946b93e04c18fdb94e241f24eef192a286 /tests/ui/rfcs
parentac91805f3179fc2225c60e8ccf5a1daa09d43f3d (diff)
downloadrust-a954c512809a2d6f3e592c0287dbe41264b54808.tar.gz
rust-a954c512809a2d6f3e592c0287dbe41264b54808.zip
Support raw-dylib link kind on ELF
raw-dylib is a link kind that allows rustc to link against a library
without having any library files present.
This currently only exists on Windows. rustc will take all the symbols
from raw-dylib link blocks and put them in an import library, where they
can then be resolved by the linker.

While import libraries don't exist on ELF, it would still be convenient
to have this same functionality. Not having the libraries present at
build-time can be convenient for several reasons, especially
cross-compilation. With raw-dylib, code linking against a library can be
cross-compiled without needing to have these libraries available on the
build machine. If the libc crate makes use of this, it would allow
cross-compilation without having any libc available on the build
machine. This is not yet possible with this implementation, at least
against libc's like glibc that use symbol versioning.
The raw-dylib kind could be extended with support for symbol versioning
in the future.

This implementation is very experimental and I have not tested it very
well. I have tested it for a toy example and the lz4-sys crate, where it
was able to successfully link a binary despite not having a
corresponding library at build-time.
Diffstat (limited to 'tests/ui/rfcs')
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs21
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr6
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs7
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs7
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs15
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr14
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs7
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs12
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs13
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr14
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs11
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs11
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs12
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr26
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs22
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr20
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs11
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs11
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs15
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr14
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs18
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs5
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr9
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs12
-rw-r--r--tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr8
36 files changed, 0 insertions, 445 deletions
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
deleted file mode 100644
index e69a4537935..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Tests that dlltool failing to generate an import library will raise an error.
-
-//@ needs-dlltool
-//@ compile-flags: --crate-type lib --emit link
-//@ normalize-stderr: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
-//@ normalize-stderr: "[^ ]*/foo.dll_imports.def" -> "$$DEF_FILE"
-//@ normalize-stderr: "[^ ]*/foo.dll_imports.lib" -> "$$LIB_FILE"
-//@ normalize-stderr: "-m [^ ]*" -> "$$TARGET_MACHINE"
-//@ normalize-stderr: "-f [^ ]*" -> "$$ASM_FLAGS"
-//@ normalize-stderr: "--temp-prefix [^ ]*/foo.dll" -> "$$TEMP_PREFIX"
-#[link(name = "foo", kind = "raw-dylib")]
-extern "C" {
-    // `@1` is an invalid name to export, as it usually indicates that something
-    // is being exported via ordinal.
-    #[link_name = "@1"]
-    fn f(x: i32);
-}
-
-pub fn lib_main() {
-    unsafe { f(42); }
-}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
deleted file mode 100644
index 90cca83d1c1..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr
+++ /dev/null
@@ -1,6 +0,0 @@
-error: Dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore $TEMP_PREFIX:
-       
-       $DLLTOOL: Syntax error in def file $DEF_FILE:1␍
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
deleted file mode 100644
index 50ad8a173ad..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ only-windows
-//@ only-x86
-#[link(name = "foo", kind = "raw-dylib", import_name_type = 6)]
-//~^ ERROR import name type must be of the form `import_name_type = "string"`
-extern "C" { }
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
deleted file mode 100644
index d2cf7a0ba1f..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: import name type must be of the form `import_name_type = "string"`
-  --> $DIR/import-name-type-invalid-format.rs:3:42
-   |
-LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = 6)]
-   |                                          ^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs
deleted file mode 100644
index cf456b9b261..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// ignore-tidy-linelength
-//@ only-windows
-//@ only-x86
-#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")]
-//~^ ERROR multiple `import_name_type` arguments in a single `#[link]` attribute
-extern "C" { }
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr
deleted file mode 100644
index 8e65baf65df..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: multiple `import_name_type` arguments in a single `#[link]` attribute
-  --> $DIR/import-name-type-multiple.rs:4:74
-   |
-LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")]
-   |                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
deleted file mode 100644
index b3859ba1ce6..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ only-windows
-//@ only-x86
-#[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")]
-//~^ ERROR unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated
-extern "C" { }
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
deleted file mode 100644
index 4b8b90eb6e2..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated
-  --> $DIR/import-name-type-unknown-value.rs:3:42
-   |
-LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")]
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
deleted file mode 100644
index 3ead5cb1fd7..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//@ only-windows
-//@ only-x86
-#[link(name = "foo", import_name_type = "decorated")]
-//~^ ERROR import name type can only be used with link kind `raw-dylib`
-extern "C" { }
-
-#[link(name = "bar", kind = "static", import_name_type = "decorated")]
-//~^ ERROR import name type can only be used with link kind `raw-dylib`
-extern "C" { }
-
-// Specifying `import_name_type` before `kind` shouldn't raise an error.
-#[link(name = "bar", import_name_type = "decorated", kind = "raw-dylib")]
-extern "C" { }
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
deleted file mode 100644
index 75cadc471c4..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: import name type can only be used with link kind `raw-dylib`
-  --> $DIR/import-name-type-unsupported-link-kind.rs:3:22
-   |
-LL | #[link(name = "foo", import_name_type = "decorated")]
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: import name type can only be used with link kind `raw-dylib`
-  --> $DIR/import-name-type-unsupported-link-kind.rs:7:39
-   |
-LL | #[link(name = "bar", kind = "static", import_name_type = "decorated")]
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs
deleted file mode 100644
index ab0dcda64e6..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ only-windows
-//@ ignore-x86
-#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
-//~^ ERROR import name type is only supported on x86
-extern "C" { }
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
deleted file mode 100644
index 757f1f7994e..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: import name type is only supported on x86
-  --> $DIR/import-name-type-x86-only.rs:3:42
-   |
-LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs
deleted file mode 100644
index 057242246f0..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Tests that failing to run dlltool will raise an error.
-
-//@ needs-dlltool
-//@ compile-flags: --crate-type lib --emit link -Cdlltool=does_not_exist.exe
-#[link(name = "foo", kind = "raw-dylib")]
-extern "C" {
-    fn f(x: i32);
-}
-
-pub fn lib_main() {
-    unsafe { f(42); }
-}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr
deleted file mode 100644
index 4bbad9b30a7..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr
+++ /dev/null
@@ -1,4 +0,0 @@
-error: Error calling dlltool 'does_not_exist.exe': program not found
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs
deleted file mode 100644
index b04c2facbcd..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#[link(name="foo")]
-extern "C" {
-    #[link_name="foo"]
-    #[link_ordinal(42)]
-    //~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
-    fn foo();
-    #[link_name="foo"]
-    #[link_ordinal(5)]
-    //~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
deleted file mode 100644
index f1e54d37827..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: cannot use `#[link_name]` with `#[link_ordinal]`
-  --> $DIR/link-ordinal-and-name.rs:4:5
-   |
-LL |     #[link_ordinal(42)]
-   |     ^^^^^^^^^^^^^^^^^^^
-
-error: cannot use `#[link_name]` with `#[link_ordinal]`
-  --> $DIR/link-ordinal-and-name.rs:8:5
-   |
-LL |     #[link_ordinal(5)]
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
deleted file mode 100644
index 9b7e8d70743..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#[link(name = "foo")]
-extern "C" {
-    #[link_ordinal("JustMonika")]
-    //~^ ERROR illegal ordinal format in `link_ordinal`
-    fn foo();
-    #[link_ordinal("JustMonika")]
-    //~^ ERROR illegal ordinal format in `link_ordinal`
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
deleted file mode 100644
index 6341e57a0be..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: illegal ordinal format in `link_ordinal`
-  --> $DIR/link-ordinal-invalid-format.rs:3:5
-   |
-LL |     #[link_ordinal("JustMonika")]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: an unsuffixed integer value, e.g., `1`, is expected
-
-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 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
deleted file mode 100644
index 6b8cd49566d..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#[link(name = "foo")]
-extern "C" {
-    #[link_ordinal()]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
-    fn foo();
-    #[link_ordinal()]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
deleted file mode 100644
index 1b04bb228e7..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-missing-argument.rs:3:5
-   |
-LL |     #[link_ordinal()]
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
-
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-missing-argument.rs:6:5
-   |
-LL |     #[link_ordinal()]
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs
deleted file mode 100644
index f5fb1649cdc..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ only-windows
-#[link(name = "foo", kind = "raw-dylib")]
-extern "C" {
-    #[link_ordinal(1)] //~ ERROR multiple `link_ordinal` attributes
-    #[link_ordinal(2)]
-    fn foo();
-    #[link_ordinal(1)] //~ ERROR multiple `link_ordinal` attributes
-    #[link_ordinal(2)]
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
deleted file mode 100644
index 2e6cf3761c2..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error: multiple `link_ordinal` attributes
-  --> $DIR/link-ordinal-multiple.rs:4:5
-   |
-LL |     #[link_ordinal(1)]
-   |     ^^^^^^^^^^^^^^^^^^ help: remove this attribute
-   |
-note: attribute also specified here
-  --> $DIR/link-ordinal-multiple.rs:5:5
-   |
-LL |     #[link_ordinal(2)]
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: multiple `link_ordinal` attributes
-  --> $DIR/link-ordinal-multiple.rs:7:5
-   |
-LL |     #[link_ordinal(1)]
-   |     ^^^^^^^^^^^^^^^^^^ help: remove this attribute
-   |
-note: attribute also specified here
-  --> $DIR/link-ordinal-multiple.rs:8:5
-   |
-LL |     #[link_ordinal(2)]
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
deleted file mode 100644
index 5982c771033..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-#[link_ordinal(123)]
-//~^ ERROR attribute should be applied to a foreign function or static
-struct Foo {}
-
-#[link_ordinal(123)]
-//~^ ERROR attribute should be applied to a foreign function or static
-fn test() {}
-
-#[link_ordinal(42)]
-//~^ ERROR attribute should be applied to a foreign function or static
-static mut imported_val: i32 = 123;
-
-#[link(name = "exporter", kind = "raw-dylib")]
-extern "C" {
-    #[link_ordinal(13)]
-    fn imported_function();
-
-    #[link_ordinal(42)]
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
deleted file mode 100644
index 8f279508720..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: attribute should be applied to a foreign function or static
-  --> $DIR/link-ordinal-not-foreign-fn.rs:1:1
-   |
-LL | #[link_ordinal(123)]
-   | ^^^^^^^^^^^^^^^^^^^^
-
-error: attribute should be applied to a foreign function or static
-  --> $DIR/link-ordinal-not-foreign-fn.rs:5:1
-   |
-LL | #[link_ordinal(123)]
-   | ^^^^^^^^^^^^^^^^^^^^
-
-error: attribute should be applied to a foreign function or static
-  --> $DIR/link-ordinal-not-foreign-fn.rs:9:1
-   |
-LL | #[link_ordinal(42)]
-   | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs
deleted file mode 100644
index 9d741630fc9..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#[link(name = "foo")]
-extern "C" {
-    #[link_ordinal(72436)]
-    //~^ ERROR ordinal value in `link_ordinal` is too large: `72436`
-    fn foo();
-    #[link_ordinal(72436)]
-    //~^ ERROR ordinal value in `link_ordinal` is too large: `72436`
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
deleted file mode 100644
index 811145e77ee..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: ordinal value in `link_ordinal` is too large: `72436`
-  --> $DIR/link-ordinal-too-large.rs:3:5
-   |
-LL |     #[link_ordinal(72436)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the value may not exceed `u16::MAX`
-
-error: ordinal value in `link_ordinal` is too large: `72436`
-  --> $DIR/link-ordinal-too-large.rs:6:5
-   |
-LL |     #[link_ordinal(72436)]
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the value may not exceed `u16::MAX`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
deleted file mode 100644
index 9988115fd8b..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#[link(name = "foo")]
-extern "C" {
-    #[link_ordinal(3, 4)]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
-    fn foo();
-    #[link_ordinal(3, 4)]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
-    static mut imported_variable: i32;
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
deleted file mode 100644
index d5ce8aff34f..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-too-many-arguments.rs:3:5
-   |
-LL |     #[link_ordinal(3, 4)]
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
-
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-too-many-arguments.rs:6:5
-   |
-LL |     #[link_ordinal(3, 4)]
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
deleted file mode 100644
index 14e915d602a..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-#[link(name = "foo")]
-extern "C" {
-    #[link_ordinal(3)]
-    //~^ ERROR `#[link_ordinal]` is only supported if link kind is `raw-dylib`
-    fn foo();
-}
-
-#[link(name = "bar", kind = "static")]
-extern "C" {
-    #[link_ordinal(3)]
-    //~^ ERROR `#[link_ordinal]` is only supported if link kind is `raw-dylib`
-    fn bar();
-}
-
-fn main() {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
deleted file mode 100644
index 200b8f62874..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: `#[link_ordinal]` is only supported if link kind is `raw-dylib`
-  --> $DIR/link-ordinal-unsupported-link-kind.rs:3:5
-   |
-LL |     #[link_ordinal(3)]
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: `#[link_ordinal]` is only supported if link kind is `raw-dylib`
-  --> $DIR/link-ordinal-unsupported-link-kind.rs:10:5
-   |
-LL |     #[link_ordinal(3)]
-   |     ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
deleted file mode 100644
index bf3c5e4d435..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ only-x86
-//@ only-windows
-//@ compile-flags: --crate-type lib --emit link
-#![allow(clashing_extern_declarations)]
-#[link(name = "foo", kind = "raw-dylib")]
-extern "C" {
-    fn f(x: i32);
-}
-
-pub fn lib_main() {
-    #[link(name = "foo", kind = "raw-dylib")]
-    extern "stdcall" {
-        fn f(x: i32);
-        //~^ ERROR multiple declarations of external function `f` from library `foo.dll` have different calling conventions
-    }
-
-    unsafe { f(42); }
-}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
deleted file mode 100644
index b766b5c8dd8..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: multiple declarations of external function `f` from library `foo.dll` have different calling conventions
-  --> $DIR/multiple-declarations.rs:13:9
-   |
-LL |         fn f(x: i32);
-   |         ^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
deleted file mode 100644
index 3b982857db8..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-//@ ignore-windows
-//@ compile-flags: --crate-type lib
-#[link(name = "foo", kind = "raw-dylib")]
-//~^ ERROR: link kind `raw-dylib` is only supported on Windows targets
-extern "C" {}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
deleted file mode 100644
index ede20cb8c3f..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0455]: link kind `raw-dylib` is only supported on Windows targets
-  --> $DIR/raw-dylib-windows-only.rs:3:29
-   |
-LL | #[link(name = "foo", kind = "raw-dylib")]
-   |                             ^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0455`.
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs
deleted file mode 100644
index 48af6b009d3..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ only-x86_64
-//@ only-windows
-//@ compile-flags: --crate-type lib --emit link
-#[link(name = "foo", kind = "raw-dylib")]
-extern "stdcall" {
-    fn f(x: i32);
-    //~^ ERROR ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture
-}
-
-pub fn lib_main() {
-    unsafe { f(42); }
-}
diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
deleted file mode 100644
index ef022404e7f..00000000000
--- a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture
-  --> $DIR/unsupported-abi.rs:6:5
-   |
-LL |     fn f(x: i32);
-   |     ^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-