Special case type aliases from impl trait in const/static types
This commit is contained in:
parent
3abdb08351
commit
cdbb0ff8ca
5 changed files with 13 additions and 6 deletions
|
@ -659,7 +659,8 @@ fn check_opaque_meets_bounds<'tcx>(
|
|||
// Checked when type checking the function containing them.
|
||||
hir::OpaqueTyOrigin::FnReturn | hir::OpaqueTyOrigin::AsyncFn => return,
|
||||
// Can have different predicates to their defining use
|
||||
hir::OpaqueTyOrigin::Binding | hir::OpaqueTyOrigin::Misc => {}
|
||||
hir::OpaqueTyOrigin::Binding | hir::OpaqueTyOrigin::Misc | hir::OpaqueTyOrigin::TyAlias => {
|
||||
}
|
||||
}
|
||||
|
||||
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
|
|
|
@ -497,7 +497,8 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
|||
let mut skip_add = false;
|
||||
|
||||
if let ty::Opaque(defin_ty_def_id, _substs) = *definition_ty.kind() {
|
||||
if let hir::OpaqueTyOrigin::Misc = opaque_defn.origin {
|
||||
if let hir::OpaqueTyOrigin::Misc | hir::OpaqueTyOrigin::TyAlias = opaque_defn.origin
|
||||
{
|
||||
if def_id == defin_ty_def_id {
|
||||
debug!(
|
||||
"skipping adding concrete definition for opaque type {:?} {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue