1
Fork 0

Rollup merge of #69495 - matthiaskrgr:op_ref, r=oli-obk

don't take redundant references to operands
This commit is contained in:
Dylan DPC 2020-02-28 01:55:43 +01:00 committed by GitHub
commit b19e822b9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

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

View file

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

View file

@ -745,7 +745,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
.join(", "); .join(", ");
if !lifetimes.is_empty() { if !lifetimes.is_empty() {
if sub.regions().count() < len { if sub.regions().count() < len {
value.push_normal(lifetimes + &", "); value.push_normal(lifetimes + ", ");
} else { } else {
value.push_normal(lifetimes); value.push_normal(lifetimes);
} }

View file

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