a few small clippy fixes
This commit is contained in:
parent
96064126a0
commit
244eef6d2b
7 changed files with 8 additions and 15 deletions
|
|
@ -125,9 +125,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
|
|||
}
|
||||
|
||||
impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
||||
/// Because we want to track parent items and so forth, enable
|
||||
/// deep walking so that we walk nested items in the context of
|
||||
/// their outer items.
|
||||
// Because we want to track parent items and so forth, enable
|
||||
// deep walking so that we walk nested items in the context of
|
||||
// their outer items.
|
||||
|
||||
fn visit_nested_item(&mut self, item: ItemId) {
|
||||
debug!("visit_nested_item: {:?}", item);
|
||||
|
|
|
|||
|
|
@ -2322,11 +2322,6 @@ impl HumanEmitter {
|
|||
show_code_change
|
||||
{
|
||||
for part in parts {
|
||||
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
|
||||
snippet
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
let span_start_pos = sm.lookup_char_pos(part.span.lo()).col_display;
|
||||
let span_end_pos = sm.lookup_char_pos(part.span.hi()).col_display;
|
||||
|
||||
|
|
@ -2402,7 +2397,7 @@ impl HumanEmitter {
|
|||
// LL - REMOVED <- row_num - 2 - (newlines - first_i - 1)
|
||||
// LL + NEWER
|
||||
// | <- row_num
|
||||
|
||||
let snippet = sm.span_to_snippet(part.span).unwrap_or_default();
|
||||
let newlines = snippet.lines().count();
|
||||
if newlines > 0 && row_num > newlines {
|
||||
// Account for removals where the part being removed spans multiple
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ impl<'a> fmt::Debug for VarianceTerm<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// The first pass over the crate simply builds up the set of inferreds.
|
||||
// The first pass over the crate simply builds up the set of inferreds.
|
||||
|
||||
pub(crate) struct TermsContext<'a, 'tcx> {
|
||||
pub tcx: TyCtxt<'tcx>,
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ macro_rules! late_lint_methods {
|
|||
/// Each `check` method checks a single syntax node, and should not
|
||||
/// invoke methods recursively (unlike `Visitor`). By default they
|
||||
/// do nothing.
|
||||
//
|
||||
///
|
||||
// FIXME: eliminate the duplication with `Visitor`. But this also
|
||||
// contains a few lint-specific methods with no equivalent in `Visitor`.
|
||||
|
||||
//
|
||||
macro_rules! declare_late_lint_pass {
|
||||
([], [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => (
|
||||
pub trait LateLintPass<'tcx>: LintPass {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use crate::ty::{self, ConstKind, GenericArgsRef, ScalarInt, Ty, TyCtxt};
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/// Evaluated Constants
|
||||
|
||||
///
|
||||
/// Represents the result of const evaluation via the `eval_to_allocation` query.
|
||||
/// Not to be confused with `ConstAllocation`, which directly refers to the underlying data!
|
||||
/// Here we indirect via an `AllocId`.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ use crate::spec::{
|
|||
/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
|
||||
///
|
||||
/// Requires the devkitARM toolchain for 3DS targets on the host system.
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let pre_link_args = TargetOptions::link_args(
|
||||
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use crate::spec::{
|
|||
/// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib).
|
||||
///
|
||||
/// Requires the VITASDK toolchain on the host system.
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let pre_link_args = TargetOptions::link_args(
|
||||
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue