remove redundant import (clippy::single_component_path_imports)
remove redundant format!() call (clippy::useless_format) don't use ok() before calling expect() (clippy::ok_expect)
This commit is contained in:
@@ -273,7 +273,6 @@ fn lint_int_literal<'a, 'tcx>(
|
|||||||
cx.sess()
|
cx.sess()
|
||||||
.source_map()
|
.source_map()
|
||||||
.span_to_snippet(lit.span)
|
.span_to_snippet(lit.span)
|
||||||
.ok()
|
|
||||||
.expect("must get snippet from literal"),
|
.expect("must get snippet from literal"),
|
||||||
t.name_str(),
|
t.name_str(),
|
||||||
min,
|
min,
|
||||||
@@ -338,7 +337,6 @@ fn lint_uint_literal<'a, 'tcx>(
|
|||||||
cx.sess()
|
cx.sess()
|
||||||
.source_map()
|
.source_map()
|
||||||
.span_to_snippet(lit.span)
|
.span_to_snippet(lit.span)
|
||||||
.ok()
|
|
||||||
.expect("must get snippet from literal"),
|
.expect("must get snippet from literal"),
|
||||||
t.name_str(),
|
t.name_str(),
|
||||||
min,
|
min,
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ fn check_static_lifetimes<'tcx>(
|
|||||||
span: Span,
|
span: Span,
|
||||||
) {
|
) {
|
||||||
if tcx.any_free_region_meets(parent_substs, |r| *r == ty::ReStatic) {
|
if tcx.any_free_region_meets(parent_substs, |r| *r == ty::ReStatic) {
|
||||||
tcx.sess.struct_span_err(span, &format!("cannot specialize on `'static` lifetime")).emit();
|
tcx.sess.struct_span_err(span, "cannot specialize on `'static` lifetime").emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use rustc_ast::attr;
|
|||||||
use rustc_span::symbol::sym;
|
use rustc_span::symbol::sym;
|
||||||
use rustc_span::FileName;
|
use rustc_span::FileName;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use serde_json;
|
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::ops;
|
use std::ops;
|
||||||
|
|||||||
Reference in New Issue
Block a user