This commit is contained in:
parent
79e3c7cd55
commit
7c91fb8ded
3 changed files with 5 additions and 5 deletions
|
@ -12,7 +12,7 @@ use rustc::ty::{Ty, TypeFlags};
|
|||
use rustc::{declare_lint_pass, declare_tool_lint};
|
||||
use rustc_errors::Applicability;
|
||||
use rustc_typeck::hir_ty_to_ty;
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
use syntax_pos::{InnerSpan, Span, DUMMY_SP};
|
||||
|
||||
use crate::utils::{in_constant, in_macro_or_desugar, is_copy, span_lint_and_then};
|
||||
|
||||
|
@ -123,7 +123,7 @@ fn verify_ty_bound<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, source: S
|
|||
}
|
||||
match source {
|
||||
Source::Item { .. } => {
|
||||
let const_kw_span = span.from_inner_byte_pos(0, 5);
|
||||
let const_kw_span = span.from_inner(InnerSpan::new(0, 5));
|
||||
db.span_suggestion(
|
||||
const_kw_span,
|
||||
"make this a static item",
|
||||
|
|
|
@ -1120,7 +1120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Casts {
|
|||
if let ExprKind::Lit(ref lit) = ex.node {
|
||||
use syntax::ast::{LitIntType, LitKind};
|
||||
if let LitKind::Int(n, _) = lit.node {
|
||||
if cast_to.is_fp() {
|
||||
if cast_to.is_floating_point() {
|
||||
let from_nbits = 128 - n.leading_zeros();
|
||||
let to_nbits = fp_ty_mantissa_nbits(cast_to);
|
||||
if from_nbits != 0 && to_nbits != 0 && from_nbits <= to_nbits {
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::borrow::Cow;
|
|||
use syntax::ast::*;
|
||||
use syntax::parse::{parser, token};
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_pos::{symbol::Symbol, BytePos, Span};
|
||||
use syntax_pos::{BytePos, Span};
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** This lint warns when you use `println!("")` to
|
||||
|
@ -418,7 +418,7 @@ fn check_tts<'a>(cx: &EarlyContext<'a>, tts: &TokenStream, is_write: bool) -> (O
|
|||
match arg.position {
|
||||
ArgumentImplicitlyIs(_) | ArgumentIs(_) => {},
|
||||
ArgumentNamed(name) => {
|
||||
if *p == Symbol::intern(name) {
|
||||
if *p == name {
|
||||
seen = true;
|
||||
all_simple &= arg.format == SIMPLE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue