Skip to content

Commit 0f45845

Browse files
committed
Merge pull request rust-lang#652 from oli-obk/fix/nightly
WIP: fix nightly breakage
2 parents d305bca + 3f34b65 commit 0f45845

23 files changed

+202
-260
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ regex-syntax = "0.2.2"
2424
[dev-dependencies]
2525
compiletest_rs = "0.0.11"
2626
regex = "0.1.47"
27-
regex_macros = "0.1.27"
27+
regex_macros = "0.1.28"
2828
lazy_static = "0.1.15"
2929
rustc-serialize = "0.3"
3030

src/approx_const.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc::lint::*;
22
use rustc_front::hir::*;
33
use std::f64::consts as f64;
44
use utils::span_lint;
5-
use syntax::ast::{Lit, Lit_, FloatTy};
5+
use syntax::ast::{Lit, LitKind, FloatTy};
66

77
/// **What it does:** This lint checks for floating point literals that approximate constants which are defined in [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants) or [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants), respectively, suggesting to use the predefined constant.
88
///
@@ -55,9 +55,9 @@ impl LateLintPass for ApproxConstant {
5555

5656
fn check_lit(cx: &LateContext, lit: &Lit, e: &Expr) {
5757
match lit.node {
58-
Lit_::LitFloat(ref s, FloatTy::TyF32) => check_known_consts(cx, e, s, "f32"),
59-
Lit_::LitFloat(ref s, FloatTy::TyF64) => check_known_consts(cx, e, s, "f64"),
60-
Lit_::LitFloatUnsuffixed(ref s) => check_known_consts(cx, e, s, "f{32, 64}"),
58+
LitKind::Float(ref s, FloatTy::F32) => check_known_consts(cx, e, s, "f32"),
59+
LitKind::Float(ref s, FloatTy::F64) => check_known_consts(cx, e, s, "f64"),
60+
LitKind::FloatUnsuffixed(ref s) => check_known_consts(cx, e, s, "f{32, 64}"),
6161
_ => (),
6262
}
6363
}

src/attrs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use reexport::*;
66
use semver::Version;
77
use syntax::codemap::Span;
88
use syntax::attr::*;
9-
use syntax::ast::{Attribute, Lit, Lit_, MetaList, MetaWord, MetaNameValue};
9+
use syntax::ast::{Attribute, Lit, LitKind, MetaItemKind};
1010
use utils::{in_macro, match_path, span_lint, BEGIN_UNWIND};
1111

1212
/// **What it does:** This lint checks for items annotated with `#[inline(always)]`, unless the annotated function is empty or simply panics.
@@ -54,12 +54,12 @@ impl LintPass for AttrPass {
5454

5555
impl LateLintPass for AttrPass {
5656
fn check_attribute(&mut self, cx: &LateContext, attr: &Attribute) {
57-
if let MetaList(ref name, ref items) = attr.node.value.node {
57+
if let MetaItemKind::List(ref name, ref items) = attr.node.value.node {
5858
if items.is_empty() || name != &"deprecated" {
5959
return;
6060
}
6161
for ref item in items {
62-
if let MetaNameValue(ref name, ref lit) = item.node {
62+
if let MetaItemKind::NameValue(ref name, ref lit) = item.node {
6363
if name == &"since" {
6464
check_semver(cx, item.span, lit);
6565
}
@@ -144,11 +144,11 @@ fn check_attrs(cx: &LateContext, span: Span, name: &Name, attrs: &[Attribute]) {
144144
}
145145

146146
for attr in attrs {
147-
if let MetaList(ref inline, ref values) = attr.node.value.node {
147+
if let MetaItemKind::List(ref inline, ref values) = attr.node.value.node {
148148
if values.len() != 1 || inline != &"inline" {
149149
continue;
150150
}
151-
if let MetaWord(ref always) = values[0].node {
151+
if let MetaItemKind::Word(ref always) = values[0].node {
152152
if always != &"always" {
153153
continue;
154154
}
@@ -163,7 +163,7 @@ fn check_attrs(cx: &LateContext, span: Span, name: &Name, attrs: &[Attribute]) {
163163
}
164164

165165
fn check_semver(cx: &LateContext, span: Span, lit: &Lit) {
166-
if let Lit_::LitStr(ref is, _) = lit.node {
166+
if let LitKind::Str(ref is, _) = lit.node {
167167
if Version::parse(&*is).is_ok() {
168168
return;
169169
}

src/bit_mask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc::middle::def::{Def, PathResolution};
44
use rustc_front::hir::*;
55
use rustc_front::util::is_comparison_binop;
66
use syntax::codemap::Span;
7-
use syntax::ast::Lit_;
7+
use syntax::ast::LitKind;
88

99
use utils::span_lint;
1010

@@ -254,7 +254,7 @@ fn check_ineffective_gt(cx: &LateContext, span: Span, m: u64, c: u64, op: &str)
254254
fn fetch_int_literal(cx: &LateContext, lit: &Expr) -> Option<u64> {
255255
match lit.node {
256256
ExprLit(ref lit_ptr) => {
257-
if let Lit_::LitInt(value, _) = lit_ptr.node {
257+
if let LitKind::Int(value, _) = lit_ptr.node {
258258
Some(value) //TODO: Handle sign
259259
} else {
260260
None

0 commit comments

Comments
 (0)