Skip to content

Commit 7ef77e5

Browse files
committed
Merge from rustc
2 parents a8d8747 + 2adddd5 commit 7ef77e5

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

clippy_lints/src/raw_strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ declare_clippy_lint! {
5050
/// ```
5151
#[clippy::version = "1.72.0"]
5252
pub NEEDLESS_RAW_STRING_HASHES,
53-
style,
53+
pedantic,
5454
"suggests reducing the number of hashes around a raw string literal"
5555
}
5656
impl_lint_pass!(RawStrings => [NEEDLESS_RAW_STRINGS, NEEDLESS_RAW_STRING_HASHES]);

clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ declare_clippy_lint! {
2828
/// know the name of the lint.
2929
///
3030
/// ### Known problems
31-
/// Only checks for lints associated using the
32-
/// `declare_lint_pass!`, `impl_lint_pass!`, and `lint_array!` macros.
31+
/// Only checks for lints associated using the `declare_lint_pass!` and
32+
/// `impl_lint_pass!` macros.
3333
///
3434
/// ### Example
3535
/// ```rust,ignore

clippy_utils/src/mir/mod.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,26 @@ pub fn visit_local_usage(locals: &[Local], mir: &Body<'_>, location: Location) -
3030
locals.len()
3131
];
3232

33-
traversal::ReversePostorder::new(mir, location.block).try_fold(init, |usage, (tbb, tdata)| {
34-
// Give up on loops
35-
if tdata.terminator().successors().any(|s| s == location.block) {
36-
return None;
37-
}
33+
traversal::Postorder::new(&mir.basic_blocks, location.block)
34+
.collect::<Vec<_>>()
35+
.into_iter()
36+
.rev()
37+
.try_fold(init, |usage, tbb| {
38+
let tdata = &mir.basic_blocks[tbb];
39+
40+
// Give up on loops
41+
if tdata.terminator().successors().any(|s| s == location.block) {
42+
return None;
43+
}
3844

39-
let mut v = V {
40-
locals,
41-
location,
42-
results: usage,
43-
};
44-
v.visit_basic_block_data(tbb, tdata);
45-
Some(v.results)
46-
})
45+
let mut v = V {
46+
locals,
47+
location,
48+
results: usage,
49+
};
50+
v.visit_basic_block_data(tbb, tdata);
51+
Some(v.results)
52+
})
4753
}
4854

4955
struct V<'a> {

0 commit comments

Comments
 (0)