Skip to content

Commit ec4d15d

Browse files
committed
Stabilize raw_dylib (#[link(kind = "raw-dylib")])
This stabilizes the raw-dylib and link_ordinal features (#58713) for the remaining architecture: x86.
1 parent c716587 commit ec4d15d

File tree

46 files changed

+29
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+29
-207
lines changed

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ declare_features! (
266266
(accepted, pub_restricted, "1.18.0", Some(32409), None),
267267
/// Allows use of the postfix `?` operator in expressions.
268268
(accepted, question_mark, "1.13.0", Some(31436), None),
269+
/// Allows the use of raw-dylibs (RFC 2627).
270+
(accepted, raw_dylib, "CURRENT_RUSTC_VERSION", Some(58713), None),
269271
/// Allows keywords to be escaped for use as identifiers.
270272
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
271273
/// Allows relaxing the coherence rules such that

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ declare_features! (
482482
(active, precise_pointer_size_matching, "1.32.0", Some(56354), None),
483483
/// Allows macro attributes on expressions, statements and non-inline modules.
484484
(active, proc_macro_hygiene, "1.30.0", Some(54727), None),
485-
/// Allows the use of raw-dylibs (RFC 2627).
486-
(active, raw_dylib, "1.65.0", Some(58713), None),
487485
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
488486
(active, raw_ref_op, "1.41.0", Some(64490), None),
489487
/// Allows using the `#[register_tool]` attribute.

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,15 +2170,6 @@ fn should_inherit_track_caller(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
21702170

21712171
fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &ast::Attribute) -> Option<u16> {
21722172
use rustc_ast::{Lit, LitIntType, LitKind};
2173-
if !tcx.features().raw_dylib && tcx.sess.target.arch == "x86" {
2174-
feature_err(
2175-
&tcx.sess.parse_sess,
2176-
sym::raw_dylib,
2177-
attr.span,
2178-
"`#[link_ordinal]` is unstable on x86",
2179-
)
2180-
.emit();
2181-
}
21822173
let meta_item_list = attr.meta_item_list();
21832174
let meta_item_list: Option<&[ast::NestedMetaItem]> = meta_item_list.as_ref().map(Vec::as_ref);
21842175
let sole_meta_list = match meta_item_list {

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,6 @@ impl<'tcx> Collector<'tcx> {
165165
"raw-dylib" => {
166166
if !sess.target.is_like_windows {
167167
sess.emit_err(FrameworkOnlyWindows { span });
168-
} else if !features.raw_dylib && sess.target.arch == "x86" {
169-
feature_err(
170-
&sess.parse_sess,
171-
sym::raw_dylib,
172-
span,
173-
"link kind `raw-dylib` is unstable on x86",
174-
)
175-
.emit();
176168
}
177169
NativeLibKind::RawDylib
178170
}
@@ -255,16 +247,6 @@ impl<'tcx> Collector<'tcx> {
255247
continue;
256248
}
257249
};
258-
if !features.raw_dylib {
259-
let span = item.name_value_literal_span().unwrap();
260-
feature_err(
261-
&sess.parse_sess,
262-
sym::raw_dylib,
263-
span,
264-
"import name type is unstable",
265-
)
266-
.emit();
267-
}
268250
import_name_type = Some((link_import_name_type, item.span()));
269251
}
270252
_ => {

src/doc/unstable-book/src/language-features/raw-dylib.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/test/run-make/raw-dylib-alt-calling-convention/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(abi_vectorcall)]
2-
#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
32

43
#[repr(C)]
54
#[derive(Clone)]

src/test/run-make/raw-dylib-c/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(raw_dylib, native_link_modifiers_verbatim)]
1+
#![feature(native_link_modifiers_verbatim)]
22

33
#[link(name = "extern_1.dll", kind = "raw-dylib", modifiers = "+verbatim")]
44
extern {

src/test/run-make/raw-dylib-import-name-type/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(raw_dylib)]
21
#![feature(abi_vectorcall)]
32

43
#[link(name = "extern", kind = "raw-dylib", import_name_type = "undecorated")]

src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(raw_dylib)]
2-
31
extern crate raw_dylib_test;
42
extern crate raw_dylib_test_wrapper;
53

src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(raw_dylib)]
2-
31
#[link(name = "extern_1", kind = "raw-dylib")]
42
extern {
53
fn extern_fn_1();

0 commit comments

Comments
 (0)