diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index ef64d8b0fdf..6c826e5dcde 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -1050,7 +1050,7 @@ fn new(needle: &[u8], end: usize) -> TwoWaySearcher { // &v[..period]. If it is, we use "Algorithm CP1". Otherwise we use // "Algorithm CP2", which is optimized for when the period of the needle // 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 // compute a separate critical factorization for the reversed needle // x = u' v' where |v'| < period(x). diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 6c5458e6e58..2599ad8ba7b 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -341,7 +341,7 @@ pub fn note_and_explain_type_err( db.note("distinct uses of `impl Trait` result in different opaque types"); let e_str = values.expected.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. db.help( "if both `Future`s have the same `Output` type, consider \ diff --git a/src/librustc_infer/infer/error_reporting/mod.rs b/src/librustc_infer/infer/error_reporting/mod.rs index 008658dff42..fd103c4c336 100644 --- a/src/librustc_infer/infer/error_reporting/mod.rs +++ b/src/librustc_infer/infer/error_reporting/mod.rs @@ -745,7 +745,7 @@ fn highlight_outer( .join(", "); if !lifetimes.is_empty() { if sub.regions().count() < len { - value.push_normal(lifetimes + &", "); + value.push_normal(lifetimes + ", "); } else { value.push_normal(lifetimes); } diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 8c4e65765d3..43d3ad21829 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -283,7 +283,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt .filter_map(|lint| { // We don't want to whitelist *all* lints so let's // ignore those ones. - if whitelisted_lints.iter().any(|l| &lint.name == l) { + if whitelisted_lints.iter().any(|l| lint.name == l) { None } else { Some((lint::LintId::of(lint), lint::Allow))