Skip to content

Commit aebbaf7

Browse files
authored
Rollup merge of #69495 - matthiaskrgr:op_ref, r=oli-obk
don't take redundant references to operands
2 parents 7d6862c + 280e381 commit aebbaf7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/libcore/str/pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ impl TwoWaySearcher {
10501050
// &v[..period]. If it is, we use "Algorithm CP1". Otherwise we use
10511051
// "Algorithm CP2", which is optimized for when the period of the needle
10521052
// is large.
1053-
if &needle[..crit_pos] == &needle[period..period + crit_pos] {
1053+
if needle[..crit_pos] == needle[period..period + crit_pos] {
10541054
// short period case -- the period is exact
10551055
// compute a separate critical factorization for the reversed needle
10561056
// x = u' v' where |v'| < period(x).

src/librustc/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'tcx> TyCtxt<'tcx> {
341341
db.note("distinct uses of `impl Trait` result in different opaque types");
342342
let e_str = values.expected.to_string();
343343
let f_str = values.found.to_string();
344-
if &e_str == &f_str && &e_str == "impl std::future::Future" {
344+
if e_str == f_str && &e_str == "impl std::future::Future" {
345345
// FIXME: use non-string based check.
346346
db.help(
347347
"if both `Future`s have the same `Output` type, consider \

src/librustc_infer/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
745745
.join(", ");
746746
if !lifetimes.is_empty() {
747747
if sub.regions().count() < len {
748-
value.push_normal(lifetimes + &", ");
748+
value.push_normal(lifetimes + ", ");
749749
} else {
750750
value.push_normal(lifetimes);
751751
}

src/librustdoc/core.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
283283
.filter_map(|lint| {
284284
// We don't want to whitelist *all* lints so let's
285285
// ignore those ones.
286-
if whitelisted_lints.iter().any(|l| &lint.name == l) {
286+
if whitelisted_lints.iter().any(|l| lint.name == l) {
287287
None
288288
} else {
289289
Some((lint::LintId::of(lint), lint::Allow))

0 commit comments

Comments
 (0)