Skip to content

Commit

Permalink
rustc: rework stability to be on-demand for type-directed lookup.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Nov 28, 2016
1 parent f97c132 commit 9aaf26e
Show file tree
Hide file tree
Showing 97 changed files with 1,774 additions and 858 deletions.
5 changes: 1 addition & 4 deletions src/etc/generate-deriving-span-tests.py
Expand Up @@ -37,8 +37,6 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
extern crate rand;
{error_deriving}
struct Error;
{code}
Expand Down Expand Up @@ -106,7 +104,6 @@ def write_file(name, string):
ALL = STRUCT | ENUM

traits = {
'Zero': (STRUCT, [], 1),
'Default': (STRUCT, [], 1),
'FromPrimitive': (0, [], 0), # only works for C-like enums

Expand All @@ -116,7 +113,7 @@ def write_file(name, string):

for (trait, supers, errs) in [('Clone', [], 1),
('PartialEq', [], 2),
('PartialOrd', ['PartialEq'], 8),
('PartialOrd', ['PartialEq'], 9),
('Eq', ['PartialEq'], 1),
('Ord', ['Eq', 'PartialOrd', 'PartialEq'], 1),
('Debug', [], 1),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/dep_graph/dep_node.rs
Expand Up @@ -90,7 +90,7 @@ pub enum DepNode<D: Clone + Debug> {
RvalueCheck(D),
Reachability,
DeadCheck,
StabilityCheck,
StabilityCheck(D),
LateLintCheck,
TransCrate,
TransCrateItem(D),
Expand Down Expand Up @@ -189,7 +189,6 @@ impl<D: Clone + Debug> DepNode<D> {
Privacy => Some(Privacy),
Reachability => Some(Reachability),
DeadCheck => Some(DeadCheck),
StabilityCheck => Some(StabilityCheck),
LateLintCheck => Some(LateLintCheck),
TransCrate => Some(TransCrate),
TransWriteMetadata => Some(TransWriteMetadata),
Expand Down Expand Up @@ -217,6 +216,7 @@ impl<D: Clone + Debug> DepNode<D> {
Mir(ref d) => op(d).map(Mir),
BorrowCheck(ref d) => op(d).map(BorrowCheck),
RvalueCheck(ref d) => op(d).map(RvalueCheck),
StabilityCheck(ref d) => op(d).map(StabilityCheck),
TransCrateItem(ref d) => op(d).map(TransCrateItem),
TransInlinedItem(ref d) => op(d).map(TransInlinedItem),
AssociatedItems(ref d) => op(d).map(AssociatedItems),
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/hir/lowering.rs
Expand Up @@ -1362,7 +1362,8 @@ impl<'a> LoweringContext<'a> {
} else {
let fields = fields.into_iter().map(|&(s, e)| {
let expr = P(this.lower_expr(&e));
this.field(Symbol::intern(s), expr, e.span)
let unstable_span = this.allow_internal_unstable("...", e.span);
this.field(Symbol::intern(s), expr, unstable_span)
}).collect();
let attrs = ast_expr.attrs.clone();

Expand Down
9 changes: 8 additions & 1 deletion src/librustc/lint/builtin.rs
Expand Up @@ -211,6 +211,12 @@ declare_lint! {
not named `mod.rs`"
}

declare_lint! {
pub DEPRECATED,
Warn,
"detects use of deprecated items"
}

/// Does nothing as a lint pass, but registers some `Lint`s
/// which are used by other parts of the compiler.
#[derive(Copy, Clone)]
Expand Down Expand Up @@ -250,7 +256,8 @@ impl LintPass for HardwiredLints {
SAFE_EXTERN_STATICS,
PATTERNS_IN_FNS_WITHOUT_BODY,
EXTRA_REQUIREMENT_IN_IMPL,
LEGACY_DIRECTORY_OWNERSHIP
LEGACY_DIRECTORY_OWNERSHIP,
DEPRECATED
)
}
}
Expand Down

0 comments on commit 9aaf26e

Please sign in to comment.