Skip to content

Commit 63041d0

Browse files
committed
Rustup
1 parent b4b6e65 commit 63041d0

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

clippy_lints/src/consts.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use std::mem;
1313
use std::rc::Rc;
1414
use syntax::ast::{FloatTy, LitKind};
1515
use syntax::ptr::P;
16-
use rustc::middle::const_val::ConstVal;
1716
use crate::utils::{sext, unsext, clip};
1817

1918
#[derive(Debug, Copy, Clone)]
@@ -428,15 +427,15 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
428427
pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'tcx>) -> Option<Constant> {
429428
use rustc::mir::interpret::{Scalar, ConstValue};
430429
match result.val {
431-
ConstVal::Value(ConstValue::Scalar(Scalar::Bits{ bits: b, ..})) => match result.ty.sty {
430+
ConstValue::Scalar(Scalar::Bits{ bits: b, ..}) => match result.ty.sty {
432431
ty::TyBool => Some(Constant::Bool(b == 1)),
433432
ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)),
434433
ty::TyFloat(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
435434
ty::TyFloat(FloatTy::F64) => Some(Constant::F64(f64::from_bits(b as u64))),
436435
// FIXME: implement other conversion
437436
_ => None,
438437
},
439-
ConstVal::Value(ConstValue::ScalarPair(Scalar::Ptr(ptr), Scalar::Bits { bits: n, .. })) => match result.ty.sty {
438+
ConstValue::ScalarPair(Scalar::Ptr(ptr), Scalar::Bits { bits: n, .. }) => match result.ty.sty {
440439
ty::TyRef(_, tam, _) => match tam.sty {
441440
ty::TyStr => {
442441
let alloc = tcx

clippy_lints/src/utils/paths.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
//! about.
33
44
pub const ANY_TRAIT: [&str; 3] = ["std", "any", "Any"];
5-
pub const ARC: [&str; 3] = ["alloc", "arc", "Arc"];
5+
pub const ARC: [&str; 3] = ["alloc", "sync", "Arc"];
66
pub const ASMUT_TRAIT: [&str; 3] = ["core", "convert", "AsMut"];
77
pub const ASREF_TRAIT: [&str; 3] = ["core", "convert", "AsRef"];
88
pub const BEGIN_PANIC: [&str; 3] = ["std", "panicking", "begin_panic"];
99
pub const BEGIN_PANIC_FMT: [&str; 3] = ["std", "panicking", "begin_panic_fmt"];
10-
pub const BINARY_HEAP: [&str; 3] = ["alloc", "binary_heap", "BinaryHeap"];
10+
pub const BINARY_HEAP: [&str; 4] = ["alloc", "collections", "binary_heap", "BinaryHeap"];
1111
pub const BORROW_TRAIT: [&str; 3] = ["core", "borrow", "Borrow"];
1212
pub const BOX: [&str; 3] = ["std", "boxed", "Box"];
1313
pub const BOX_NEW: [&str; 4] = ["std", "boxed", "Box", "new"];
14-
pub const BTREEMAP: [&str; 4] = ["alloc", "btree", "map", "BTreeMap"];
15-
pub const BTREEMAP_ENTRY: [&str; 4] = ["alloc", "btree", "map", "Entry"];
16-
pub const BTREESET: [&str; 4] = ["alloc", "btree", "set", "BTreeSet"];
14+
pub const BTREEMAP: [&str; 5] = ["alloc", "collections", "btree", "map", "BTreeMap"];
15+
pub const BTREEMAP_ENTRY: [&str; 5] = ["alloc", "collections", "btree", "map", "Entry"];
16+
pub const BTREESET: [&str; 5] = ["alloc", "collections", "btree", "set", "BTreeSet"];
1717
pub const CLONE: [&str; 4] = ["core", "clone", "Clone", "clone"];
1818
pub const CLONE_TRAIT: [&str; 3] = ["core", "clone", "Clone"];
1919
pub const CMP_MAX: [&str; 3] = ["core", "cmp", "max"];
@@ -47,7 +47,7 @@ pub const IO_PRINT: [&str; 4] = ["std", "io", "stdio", "_print"];
4747
pub const IO_READ: [&str; 3] = ["std", "io", "Read"];
4848
pub const IO_WRITE: [&str; 3] = ["std", "io", "Write"];
4949
pub const ITERATOR: [&str; 4] = ["core", "iter", "iterator", "Iterator"];
50-
pub const LINKED_LIST: [&str; 3] = ["alloc", "linked_list", "LinkedList"];
50+
pub const LINKED_LIST: [&str; 4] = ["alloc", "collections", "linked_list", "LinkedList"];
5151
pub const LINT: [&str; 2] = ["lint", "Lint"];
5252
pub const LINT_ARRAY: [&str; 2] = ["lint", "LintArray"];
5353
pub const MEM_FORGET: [&str; 3] = ["core", "mem", "forget"];
@@ -101,7 +101,7 @@ pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
101101
pub const TRY_INTO_RESULT: [&str; 4] = ["std", "ops", "Try", "into_result"];
102102
pub const UNINIT: [&str; 4] = ["core", "intrinsics", "", "uninit"];
103103
pub const VEC: [&str; 3] = ["alloc", "vec", "Vec"];
104-
pub const VEC_DEQUE: [&str; 3] = ["alloc", "vec_deque", "VecDeque"];
104+
pub const VEC_DEQUE: [&str; 4] = ["alloc", "collections", "vec_deque", "VecDeque"];
105105
pub const VEC_FROM_ELEM: [&str; 3] = ["alloc", "vec", "from_elem"];
106-
pub const WEAK_ARC: [&str; 3] = ["alloc", "arc", "Weak"];
106+
pub const WEAK_ARC: [&str; 3] = ["alloc", "sync", "Weak"];
107107
pub const WEAK_RC: [&str; 3] = ["alloc", "rc", "Weak"];

tests/ui/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![allow(dead_code, needless_pass_by_value)]
77

88
extern crate alloc;
9-
use alloc::linked_list::LinkedList;
9+
use alloc::collections::linked_list::LinkedList;
1010

1111
trait Foo {
1212
type Baz = LinkedList<u8>;

0 commit comments

Comments
 (0)