1
Fork 0

Rollup merge of #55358 - sinkuu:redundant_clone2, r=estebank

Remove redundant clone (2)
This commit is contained in:
kennytm 2018-10-26 18:25:12 +08:00
commit 626b49666f
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
35 changed files with 56 additions and 65 deletions

View file

@ -84,7 +84,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> AutoTraitFinder<'a, 'tcx, 'rcx, 'cstore> {
.into_iter()
.chain(self.get_auto_trait_impl_for(
def_id,
name.clone(),
name,
generics.clone(),
def_ctor,
tcx.require_lang_item(lang_items::SyncTraitLangItem),

View file

@ -67,7 +67,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> {
}
let ty = self.cx.tcx.type_of(def_id);
let generics = self.cx.tcx.generics_of(def_id);
let real_name = name.clone().map(|name| Ident::from_str(&name));
let real_name = name.map(|name| Ident::from_str(&name));
let param_env = self.cx.tcx.param_env(def_id);
for &trait_def_id in self.cx.all_traits.iter() {
if !self.cx.renderinfo.borrow().access_levels.is_doc_reachable(trait_def_id) ||
@ -112,7 +112,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> {
);
let may_apply = match infcx.evaluate_obligation(
&traits::Obligation::new(
cause.clone(),
cause,
param_env,
trait_ref.to_predicate(),
),

View file

@ -3611,7 +3611,7 @@ impl ToSource for syntax_pos::Span {
fn to_src(&self, cx: &DocContext) -> String {
debug!("converting span {:?} to snippet", self.clean(cx));
let sn = match cx.sess().source_map().span_to_snippet(*self) {
Ok(x) => x.to_string(),
Ok(x) => x,
Err(_) => String::new()
};
debug!("got snippet {}", sn);