pub enum Bound<T> {
/// An inclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
- Included(T),
+ Included(#[stable(feature = "collections_bound", since = "1.17.0")] T),
/// An exclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
- Excluded(T),
+ Excluded(#[stable(feature = "collections_bound", since = "1.17.0")] T),
/// An infinite endpoint. Indicates that there is no bound in this direction.
#[stable(feature = "collections_bound", since = "1.17.0")]
Unbounded,
impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> {
fn check_missing_stability(&self, id: NodeId, span: Span) {
let def_id = self.tcx.hir.local_def_id(id);
+ let stab = self.tcx.stability.borrow().stab_map.get(&def_id).cloned();
let is_error = !self.tcx.sess.opts.test &&
- !self.tcx.stability.borrow().stab_map.contains_key(&def_id) &&
+ (stab == None || stab == Some(None)) &&
self.access_levels.is_reachable(id);
if is_error {
self.tcx.sess.span_err(span, "This node does not have a stability attribute");
let is_staged_api =
sess.opts.debugging_opts.force_unstable_if_unmarked ||
sess.features.borrow().staged_api;
-
let mut staged_api = FxHashMap();
staged_api.insert(LOCAL_CRATE, is_staged_api);
Index {
#![deny(missing_docs)]
#![deny(warnings)]
-#![feature(staged_api)]
#![cfg_attr(windows, feature(libc))]
// Handle rustfmt skips
#![feature(custom_attribute)]
// aux-build:pub_and_stability.rs
-#![feature(staged_api)]
#![feature(unused_feature)]
// A big point of this test is that we *declare* `unstable_declared`,
// compile-flags: -F deprecated
-#![feature(staged_api)]
#[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
fn main() {
}
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(staged_api)]
+#![stable(feature = "test", since = "0")]
+
+#[stable(feature = "test", since = "0")]
+pub struct Reverse<T>(pub T); //~ ERROR This node does not have a stability attribute
+
+fn main() {
+ // Make sure the field is used to fill the stability cache
+ Reverse(0).0;
+}