Fix type of byte literals

They're `&[u8; N]`, not `&[u8]` (see #4374).
This commit is contained in:
Florian Diebold 2020-05-08 15:17:35 +02:00
parent 51e4b92c1e
commit f5177f91ae
3 changed files with 11 additions and 10 deletions

View file

@ -501,8 +501,8 @@ impl<'a> InferenceContext<'a> {
}
Literal::ByteString(..) => {
let byte_type = Ty::simple(TypeCtor::Int(Uncertain::Known(IntTy::u8())));
let slice_type = Ty::apply_one(TypeCtor::Slice, byte_type);
Ty::apply_one(TypeCtor::Ref(Mutability::Shared), slice_type)
let array_type = Ty::apply_one(TypeCtor::Array, byte_type);
Ty::apply_one(TypeCtor::Ref(Mutability::Shared), array_type)
}
Literal::Char(..) => Ty::simple(TypeCtor::Char),
Literal::Int(_v, ty) => Ty::simple(TypeCtor::Int((*ty).into())),