Treat numbers as ad-hoc types for the purpose of checking ability obligations

This commit is contained in:
Ayaz Hafiz 2022-07-13 11:18:21 -04:00
parent 568e8d9475
commit 7b23077265
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 37 additions and 29 deletions

View file

@ -553,15 +553,6 @@ impl ObligationCache<'_> {
}
Erroneous(_) => return Err(var),
},
Alias(name, _, _, AliasKind::Opaque) => {
let opaque = *name;
if self
.check_opaque_and_read(subs, opaque, Symbol::ENCODE_ENCODING)
.is_err()
{
return Err(var);
}
}
Alias(
Symbol::NUM_U8
| Symbol::NUM_U16
@ -576,13 +567,23 @@ impl ObligationCache<'_> {
| Symbol::NUM_NAT
| Symbol::NUM_F32
| Symbol::NUM_F64
| Symbol::NUM_DEC,
| Symbol::NUM_DEC
| Symbol::NUM_NUM,
_,
_,
_,
) => {
// yes
}
Alias(name, _, _, AliasKind::Opaque) => {
let opaque = *name;
if self
.check_opaque_and_read(subs, opaque, Symbol::ENCODE_ENCODING)
.is_err()
{
return Err(var);
}
}
Alias(_, arguments, real_type_var, _) => {
push_var_slice!(arguments.all_variables());
stack.push(*real_type_var);