impl Copy/Clone for arrays in std, not in compiler
This commit is contained in:
parent
495322d776
commit
ce1143e94d
9 changed files with 30 additions and 187 deletions
|
@ -33,7 +33,8 @@ pub fn can_type_implement_copy(
|
|||
| ty::Char
|
||||
| ty::RawPtr(..)
|
||||
| ty::Never
|
||||
| ty::Ref(_, _, hir::Mutability::Not) => return Ok(()),
|
||||
| ty::Ref(_, _, hir::Mutability::Not)
|
||||
| ty::Array(..) => return Ok(()),
|
||||
|
||||
ty::Adt(adt, substs) => (adt, substs),
|
||||
|
||||
|
|
|
@ -1859,7 +1859,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
| ty::Char
|
||||
| ty::RawPtr(..)
|
||||
| ty::Never
|
||||
| ty::Ref(_, _, hir::Mutability::Not) => {
|
||||
| ty::Ref(_, _, hir::Mutability::Not)
|
||||
| ty::Array(..) => {
|
||||
// Implementations provided in libcore
|
||||
None
|
||||
}
|
||||
|
@ -1872,11 +1873,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
| ty::Foreign(..)
|
||||
| ty::Ref(_, _, hir::Mutability::Mut) => None,
|
||||
|
||||
ty::Array(element_ty, _) => {
|
||||
// (*) binder moved here
|
||||
Where(obligation.predicate.rebind(vec![element_ty]))
|
||||
}
|
||||
|
||||
ty::Tuple(tys) => {
|
||||
// (*) binder moved here
|
||||
Where(obligation.predicate.rebind(tys.iter().map(|k| k.expect_ty()).collect()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue