Skip to content

Commit 39e896c

Browse files
committed
Make clippy work with parallel rustc
1 parent baec524 commit 39e896c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clippy_lints/src/consts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ use rustc::lint::LateContext;
1717
use rustc::ty::subst::{Subst, Substs};
1818
use rustc::ty::{self, Instance, Ty, TyCtxt};
1919
use rustc::{bug, span_bug};
20+
use rustc_data_structures::sync::Lrc;
2021
use std::cmp::Ordering::{self, Equal};
2122
use std::cmp::PartialOrd;
2223
use std::convert::TryInto;
2324
use std::hash::{Hash, Hasher};
24-
use std::rc::Rc;
2525
use syntax::ast::{FloatTy, LitKind};
2626
use syntax::ptr::P;
2727

@@ -31,7 +31,7 @@ pub enum Constant {
3131
/// a String "abc"
3232
Str(String),
3333
/// a Binary String b"abc"
34-
Binary(Rc<Vec<u8>>),
34+
Binary(Lrc<Vec<u8>>),
3535
/// a single char 'a'
3636
Char(char),
3737
/// an integer's bit representation
@@ -156,7 +156,7 @@ pub fn lit_to_constant<'tcx>(lit: &LitKind, ty: Ty<'tcx>) -> Constant {
156156
match *lit {
157157
LitKind::Str(ref is, _) => Constant::Str(is.to_string()),
158158
LitKind::Byte(b) => Constant::Int(u128::from(b)),
159-
LitKind::ByteStr(ref s) => Constant::Binary(Rc::clone(s)),
159+
LitKind::ByteStr(ref s) => Constant::Binary(Lrc::clone(s)),
160160
LitKind::Char(c) => Constant::Char(c),
161161
LitKind::Int(n, _) => Constant::Int(n),
162162
LitKind::Float(ref is, _) | LitKind::FloatUnsuffixed(ref is) => match ty.sty {

clippy_lints/src/enum_variants.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc::lint::{EarlyContext, EarlyLintPass, Lint, LintArray, LintPass};
1515
use rustc::{declare_tool_lint, lint_array};
1616
use syntax::ast::*;
1717
use syntax::source_map::Span;
18-
use syntax::symbol::LocalInternedString;
18+
use syntax::symbol::{LocalInternedString, InternedString};
1919

2020
/// **What it does:** Detects enumeration variants that are prefixed or suffixed
2121
/// by the same characters.
@@ -111,7 +111,7 @@ declare_clippy_lint! {
111111
}
112112

113113
pub struct EnumVariantNames {
114-
modules: Vec<(LocalInternedString, String)>,
114+
modules: Vec<(InternedString, String)>,
115115
threshold: u64,
116116
}
117117

@@ -308,6 +308,6 @@ impl EarlyLintPass for EnumVariantNames {
308308
};
309309
check_variant(cx, self.threshold, def, &item_name, item_name_chars, item.span, lint);
310310
}
311-
self.modules.push((item_name, item_camel));
311+
self.modules.push((item_name.as_interned_str(), item_camel));
312312
}
313313
}

clippy_lints/src/utils/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ use rustc::ty::{
2525
subst::Kind,
2626
Binder, Ty, TyCtxt,
2727
};
28+
use rustc_data_structures::sync::Lrc;
2829
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart};
2930
use std::borrow::Cow;
3031
use std::env;
3132
use std::mem;
32-
use std::rc::Rc;
3333
use std::str::FromStr;
3434
use syntax::ast::{self, LitKind};
3535
use syntax::attr;
@@ -223,7 +223,7 @@ pub fn path_to_def(cx: &LateContext<'_, '_>, path: &[&str]) -> Option<def::Def>
223223
None => return None,
224224
};
225225

226-
for item in mem::replace(&mut items, Rc::new(vec![])).iter() {
226+
for item in mem::replace(&mut items, Lrc::new(vec![])).iter() {
227227
if item.ident.name == *segment {
228228
if path_it.peek().is_none() {
229229
return Some(item.def);

0 commit comments

Comments
 (0)