Skip to content

Commit 7cbd18a

Browse files
committed
Remove the unmarked_api feature
Closes #37981.
1 parent 3abaf43 commit 7cbd18a

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

src/doc/reference.md

-5
Original file line numberDiff line numberDiff line change
@@ -2462,11 +2462,6 @@ The currently implemented features of the reference compiler are:
24622462
* `unboxed_closures` - Rust's new closure design, which is currently a work in
24632463
progress feature with many known bugs.
24642464

2465-
* `unmarked_api` - Allows use of items within a `#![staged_api]` crate
2466-
which have not been marked with a stability marker.
2467-
Such items should not be allowed by the compiler to exist,
2468-
so if you need this there probably is a compiler bug.
2469-
24702465
* `allow_internal_unstable` - Allows `macro_rules!` macros to be tagged with the
24712466
`#[allow_internal_unstable]` attribute, designed
24722467
to allow `std` macros to call

src/librustc/middle/stability.rs

+1-17
Original file line numberDiff line numberDiff line change
@@ -513,23 +513,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
513513
// handled by the lint emitting logic above.
514514
}
515515
None => {
516-
// This is an 'unmarked' API, which should not exist
517-
// in the standard library.
518-
if self.sess.features.borrow().unmarked_api {
519-
self.sess.struct_span_warn(span, "use of unmarked library feature")
520-
.span_note(span, "this is either a bug in the library you are \
521-
using or a bug in the compiler - please \
522-
report it in both places")
523-
.emit()
524-
} else {
525-
self.sess.struct_span_err(span, "use of unmarked library feature")
526-
.span_note(span, "this is either a bug in the library you are \
527-
using or a bug in the compiler - please \
528-
report it in both places")
529-
.span_note(span, "use #![feature(unmarked_api)] in the \
530-
crate attributes to override this")
531-
.emit()
532-
}
516+
span_bug!(span, "encountered unmarked API");
533517
}
534518
}
535519
}

src/libsyntax/feature_gate.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ declare_features! (
153153
// rustc internal
154154
(active, staged_api, "1.0.0", None),
155155

156-
// Allows using items which are missing stability attributes
157-
// rustc internal
158-
(active, unmarked_api, "1.0.0", None),
159-
160156
// Allows using #![no_core]
161157
(active, no_core, "1.3.0", Some(29639)),
162158

@@ -330,6 +326,9 @@ declare_features! (
330326
(removed, test_removed_feature, "1.0.0", None),
331327
(removed, visible_private_types, "1.0.0", None),
332328
(removed, unsafe_no_drop_flag, "1.0.0", None),
329+
// Allows using items which are missing stability attributes
330+
// rustc internal
331+
(removed, unmarked_api, "1.0.0", None),
333332
);
334333

335334
declare_features! (

0 commit comments

Comments
 (0)