Skip to content

Commit 8ed810a

Browse files
authored
Rollup merge of #148667 - hkBst:clippy-fix-14, r=Kivooeo
a few small clippy fixes
2 parents b659868 + 244eef6 commit 8ed810a

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

compiler/rustc_ast_lowering/src/index.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
125125
}
126126

127127
impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
128-
/// Because we want to track parent items and so forth, enable
129-
/// deep walking so that we walk nested items in the context of
130-
/// their outer items.
128+
// Because we want to track parent items and so forth, enable
129+
// deep walking so that we walk nested items in the context of
130+
// their outer items.
131131

132132
fn visit_nested_item(&mut self, item: ItemId) {
133133
debug!("visit_nested_item: {:?}", item);

compiler/rustc_errors/src/emitter.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,11 +2322,6 @@ impl HumanEmitter {
23222322
show_code_change
23232323
{
23242324
for part in parts {
2325-
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
2326-
snippet
2327-
} else {
2328-
String::new()
2329-
};
23302325
let span_start_pos = sm.lookup_char_pos(part.span.lo()).col_display;
23312326
let span_end_pos = sm.lookup_char_pos(part.span.hi()).col_display;
23322327

@@ -2402,7 +2397,7 @@ impl HumanEmitter {
24022397
// LL - REMOVED <- row_num - 2 - (newlines - first_i - 1)
24032398
// LL + NEWER
24042399
// | <- row_num
2405-
2400+
let snippet = sm.span_to_snippet(part.span).unwrap_or_default();
24062401
let newlines = snippet.lines().count();
24072402
if newlines > 0 && row_num > newlines {
24082403
// Account for removals where the part being removed spans multiple

compiler/rustc_hir_analysis/src/variance/terms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a> fmt::Debug for VarianceTerm<'a> {
4444
}
4545
}
4646

47-
/// The first pass over the crate simply builds up the set of inferreds.
47+
// The first pass over the crate simply builds up the set of inferreds.
4848

4949
pub(crate) struct TermsContext<'a, 'tcx> {
5050
pub tcx: TyCtxt<'tcx>,

compiler/rustc_lint/src/passes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ macro_rules! late_lint_methods {
5555
/// Each `check` method checks a single syntax node, and should not
5656
/// invoke methods recursively (unlike `Visitor`). By default they
5757
/// do nothing.
58-
//
58+
///
5959
// FIXME: eliminate the duplication with `Visitor`. But this also
6060
// contains a few lint-specific methods with no equivalent in `Visitor`.
61-
61+
//
6262
macro_rules! declare_late_lint_pass {
6363
([], [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => (
6464
pub trait LateLintPass<'tcx>: LintPass {

compiler/rustc_middle/src/mir/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::ty::{self, ConstKind, GenericArgsRef, ScalarInt, Ty, TyCtxt};
1616

1717
///////////////////////////////////////////////////////////////////////////
1818
/// Evaluated Constants
19-
19+
///
2020
/// Represents the result of const evaluation via the `eval_to_allocation` query.
2121
/// Not to be confused with `ConstAllocation`, which directly refers to the underlying data!
2222
/// Here we indirect via an `AllocId`.

compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::spec::{
55
/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
66
///
77
/// Requires the devkitARM toolchain for 3DS targets on the host system.
8-
98
pub(crate) fn target() -> Target {
109
let pre_link_args = TargetOptions::link_args(
1110
LinkerFlavor::Gnu(Cc::Yes, Lld::No),

compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::spec::{
77
/// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib).
88
///
99
/// Requires the VITASDK toolchain on the host system.
10-
1110
pub(crate) fn target() -> Target {
1211
let pre_link_args = TargetOptions::link_args(
1312
LinkerFlavor::Gnu(Cc::Yes, Lld::No),

0 commit comments

Comments
 (0)