Skip to content

Commit cc35165

Browse files
committed
Auto merge of #4840 - flip1995:rollup-jqk3a3i, r=flip1995
Rollup of 5 pull requests Successful merges: - #4730 (Fix check_infinite_loop (while_immutable_condition) by checking for break or return inside loop body) - #4766 (Fix false positive in derive_hash_xor_eq) - #4811 (Literal Representation Restructure) - #4820 (doc: fix the comment above the lint function) - #4830 (use more efficient code to generate repeated string) Failed merges: r? @ghost changelog: none
2 parents 35a559f + b452400 commit cc35165

20 files changed

+549
-294
lines changed

clippy_lints/src/derive.rs

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ fn check_hash_peq<'a, 'tcx>(
9090
if_chain! {
9191
if match_path(&trait_ref.path, &paths::HASH);
9292
if let Some(peq_trait_def_id) = cx.tcx.lang_items().eq_trait();
93+
if !&trait_ref.trait_def_id().is_local();
9394
then {
9495
// Look for the PartialEq implementations for `ty`
9596
cx.tcx.for_each_relevant_impl(peq_trait_def_id, ty, |impl_id| {

clippy_lints/src/excessive_precision.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::utils::span_lint_and_sugg;
2+
use crate::utils::sugg::format_numeric_literal;
23
use if_chain::if_chain;
34
use rustc::hir;
45
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -86,8 +87,7 @@ impl ExcessivePrecision {
8687
if sym_str == s {
8788
None
8889
} else {
89-
let di = super::literal_representation::DigitInfo::new(&s, true);
90-
Some(di.grouping_hint())
90+
Some(format_numeric_literal(&s, None, true))
9191
}
9292
} else {
9393
None

0 commit comments

Comments
 (0)