mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Rollup merge of #119003 - matthiaskrgr:nein_clone, r=Nadrieril
NFC: do not clone types that are copy
This commit is contained in:
commit
c9ba4583aa
@ -353,7 +353,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
|||||||
let new_kind = match ty.kind() {
|
let new_kind = match ty.kind() {
|
||||||
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.pointer_width)),
|
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.pointer_width)),
|
||||||
Uint(t @ Usize) => Uint(t.normalize(self.tcx.sess.target.pointer_width)),
|
Uint(t @ Usize) => Uint(t.normalize(self.tcx.sess.target.pointer_width)),
|
||||||
t @ (Uint(_) | Int(_)) => t.clone(),
|
t @ (Uint(_) | Int(_)) => *t,
|
||||||
_ => panic!("tried to get overflow intrinsic for op applied to non-int type"),
|
_ => panic!("tried to get overflow intrinsic for op applied to non-int type"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -341,13 +341,13 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
|
|||||||
Entry::Occupied(e) => {
|
Entry::Occupied(e) => {
|
||||||
let (canonical, var_values) = e.get();
|
let (canonical, var_values) = e.get();
|
||||||
state.var_values.extend_from_slice(var_values);
|
state.var_values.extend_from_slice(var_values);
|
||||||
canonical.clone()
|
*canonical
|
||||||
}
|
}
|
||||||
Entry::Vacant(e) => {
|
Entry::Vacant(e) => {
|
||||||
let canonical = canonicalize_op(tcx, key, state);
|
let canonical = canonicalize_op(tcx, key, state);
|
||||||
let OriginalQueryValues { var_values, universe_map } = state;
|
let OriginalQueryValues { var_values, universe_map } = state;
|
||||||
assert_eq!(universe_map.len(), 1);
|
assert_eq!(universe_map.len(), 1);
|
||||||
e.insert((canonical.clone(), tcx.arena.alloc_slice(var_values)));
|
e.insert((canonical, tcx.arena.alloc_slice(var_values)));
|
||||||
canonical
|
canonical
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ impl<'tcx> Const<'tcx> {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn kind(self) -> ConstKind<'tcx> {
|
pub fn kind(self) -> ConstKind<'tcx> {
|
||||||
self.0.kind.clone()
|
self.0.kind
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -473,7 +473,7 @@ impl<'tcx> IntoKind for Ty<'tcx> {
|
|||||||
type Kind = TyKind<'tcx>;
|
type Kind = TyKind<'tcx>;
|
||||||
|
|
||||||
fn kind(self) -> TyKind<'tcx> {
|
fn kind(self) -> TyKind<'tcx> {
|
||||||
self.kind().clone()
|
*self.kind()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ impl ConstructorSet {
|
|||||||
}
|
}
|
||||||
ConstructorSet::Integers { range_1, range_2 } => {
|
ConstructorSet::Integers { range_1, range_2 } => {
|
||||||
let seen_ranges: Vec<_> =
|
let seen_ranges: Vec<_> =
|
||||||
seen.iter().map(|ctor| ctor.as_int_range().unwrap().clone()).collect();
|
seen.iter().map(|ctor| *ctor.as_int_range().unwrap()).collect();
|
||||||
for (seen, splitted_range) in range_1.split(seen_ranges.iter().cloned()) {
|
for (seen, splitted_range) in range_1.split(seen_ranges.iter().cloned()) {
|
||||||
match seen {
|
match seen {
|
||||||
Presence::Unseen => missing.push(IntRange(splitted_range)),
|
Presence::Unseen => missing.push(IntRange(splitted_range)),
|
||||||
|
Loading…
Reference in New Issue
Block a user