Skip to content

Commit dfc878b

Browse files
committed
---
yaml --- r: 178783 b: refs/heads/auto c: b64572c h: refs/heads/master i: 178781: e83330d 178779: 3c8f112 178775: 28664d4 178767: 0dd1aa2 178751: 29eb3d2 v: v3
1 parent c135c71 commit dfc878b

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 4aa661ab3608551edab18584b958d281f8e4c094
13+
refs/heads/auto: b64572cefe9f37c58c07af745afc91bfd0303c30
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/stability.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,19 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
253253
None => {
254254
// This is an 'unmarked' API, which should not exist
255255
// in the standard library.
256-
self.tcx.sess.span_err(span, "use of unmarked library feature");
257-
self.tcx.sess.span_note(span, "this is either a bug in the library you are \
258-
using or a bug in the compiler - there is \
259-
no way to use this feature");
256+
if self.tcx.sess.features.borrow().unmarked_api {
257+
self.tcx.sess.span_warn(span, "use of unmarked library feature");
258+
self.tcx.sess.span_note(span, "this is either a bug in the library you are \
259+
using and a bug in the compiler - please \
260+
report it in both places");
261+
} else {
262+
self.tcx.sess.span_err(span, "use of unmarked library feature");
263+
self.tcx.sess.span_note(span, "this is either a bug in the library you are \
264+
using and a bug in the compiler - please \
265+
report it in both places");
266+
self.tcx.sess.span_note(span, "use #![feature(unmarked_api)] in the \
267+
crate attributes to override this");
268+
}
260269
}
261270
}
262271
}

branches/auto/src/libsyntax/feature_gate.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
119119

120120
// Allows use of #[staged_api]
121121
("staged_api", "1.0.0", Active),
122+
123+
// Allows using items which are missing stability attributes
124+
("unmarked_api", "1.0.0", Active)
122125
];
123126

124127
enum Status {
@@ -145,6 +148,7 @@ pub struct Features {
145148
pub quote: bool,
146149
pub old_orphan_check: bool,
147150
pub simd_ffi: bool,
151+
pub unmarked_api: bool,
148152
pub lib_features: Vec<(InternedString, Span)>
149153
}
150154

@@ -157,6 +161,7 @@ impl Features {
157161
quote: false,
158162
old_orphan_check: false,
159163
simd_ffi: false,
164+
unmarked_api: false,
160165
lib_features: Vec::new()
161166
}
162167
}
@@ -566,6 +571,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C
566571
quote: cx.has_feature("quote"),
567572
old_orphan_check: cx.has_feature("old_orphan_check"),
568573
simd_ffi: cx.has_feature("simd_ffi"),
574+
unmarked_api: cx.has_feature("unmarked_api"),
569575
lib_features: unknown_features
570576
}
571577
}

0 commit comments

Comments
 (0)