-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New Lint: wildcard imports
#5029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8a572a5
ba1d50c
4229dbc
3f5ed28
06a6189
f4f781d
b67764d
8472ecd
b562a51
4dd2252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ use rustc::ty::{self, Ty, TyCtxt}; | |
use rustc::{bug, span_bug}; | ||
use rustc_data_structures::sync::Lrc; | ||
use rustc_hir::def::{DefKind, Res}; | ||
use rustc_hir::*; | ||
use rustc_hir::{BinOp, BinOpKind, Block, Expr, ExprKind, HirId, QPath, UnOp}; | ||
use rustc_lint::LateContext; | ||
use rustc_span::symbol::Symbol; | ||
use std::cmp::Ordering::{self, Equal}; | ||
use std::convert::TryInto; | ||
use std::hash::{Hash, Hasher}; | ||
use syntax::ast::{FloatTy, LitKind}; | ||
use syntax::ast::{FloatTy, LitFloatType, LitKind}; | ||
|
||
/// A `LitKind`-like enum to fold constant `Expr`s into. | ||
#[derive(Debug, Clone)] | ||
|
@@ -152,8 +152,6 @@ impl Constant { | |
|
||
/// Parses a `LitKind` to a `Constant`. | ||
pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant { | ||
use syntax::ast::*; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This produced one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be worth adding this to the |
||
|
||
match *lit { | ||
LitKind::Str(ref is, _) => Constant::Str(is.to_string()), | ||
LitKind::Byte(b) => Constant::Int(u128::from(b)), | ||
|
@@ -277,7 +275,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { | |
|
||
#[allow(clippy::cast_possible_wrap)] | ||
fn constant_not(&self, o: &Constant, ty: Ty<'_>) -> Option<Constant> { | ||
use self::Constant::*; | ||
use self::Constant::{Bool, Int}; | ||
match *o { | ||
Bool(b) => Some(Bool(!b)), | ||
Int(value) => { | ||
|
@@ -293,7 +291,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { | |
} | ||
|
||
fn constant_negate(&self, o: &Constant, ty: Ty<'_>) -> Option<Constant> { | ||
use self::Constant::*; | ||
use self::Constant::{Int, F32, F64}; | ||
match *o { | ||
Int(value) => { | ||
let ity = match ty.kind { | ||
|
Uh oh!
There was an error while loading. Please reload this page.