Improve some codes according to the reviews
- improve diagnostics of field uniqueness check and representation check - simplify the implementation of field uniqueness check - remove some useless codes and improvement neatness
This commit is contained in:
parent
2b04ca94bb
commit
0dbd6e9572
9 changed files with 658 additions and 124 deletions
|
@ -181,11 +181,6 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
|
|||
| ty::Ref(_, _, Mutability::Not)
|
||||
| ty::Array(..) => Err(NoSolution),
|
||||
|
||||
// Check for anonymous adts.
|
||||
ty::Adt(adt, generics) if adt.is_anonymous() => {
|
||||
Ok(adt.non_enum_variant().fields.iter().map(|f| f.ty(ecx.tcx(), generics)).collect())
|
||||
}
|
||||
|
||||
ty::Dynamic(..)
|
||||
| ty::Str
|
||||
| ty::Slice(_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue