diff options
author | Florian Diebold <[email protected]> | 2020-05-08 14:17:35 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-05-08 14:18:33 +0100 |
commit | f5177f91ae61e1d812efd6b55a1ec7ab07c7c7e1 (patch) | |
tree | e76e38744fefe81c5ec1f121672022a36307dcf4 /crates/ra_hir_ty/src/infer/expr.rs | |
parent | 51e4b92c1eee25cb6bf1b5ec8e7633dfc5f67a45 (diff) |
Fix type of byte literals
They're `&[u8; N]`, not `&[u8]` (see #4374).
Diffstat (limited to 'crates/ra_hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 83f946eee..614c352a0 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs | |||
@@ -501,8 +501,8 @@ impl<'a> InferenceContext<'a> { | |||
501 | } | 501 | } |
502 | Literal::ByteString(..) => { | 502 | Literal::ByteString(..) => { |
503 | let byte_type = Ty::simple(TypeCtor::Int(Uncertain::Known(IntTy::u8()))); | 503 | let byte_type = Ty::simple(TypeCtor::Int(Uncertain::Known(IntTy::u8()))); |
504 | let slice_type = Ty::apply_one(TypeCtor::Slice, byte_type); | 504 | let array_type = Ty::apply_one(TypeCtor::Array, byte_type); |
505 | Ty::apply_one(TypeCtor::Ref(Mutability::Shared), slice_type) | 505 | Ty::apply_one(TypeCtor::Ref(Mutability::Shared), array_type) |
506 | } | 506 | } |
507 | Literal::Char(..) => Ty::simple(TypeCtor::Char), | 507 | Literal::Char(..) => Ty::simple(TypeCtor::Char), |
508 | Literal::Int(_v, ty) => Ty::simple(TypeCtor::Int((*ty).into())), | 508 | Literal::Int(_v, ty) => Ty::simple(TypeCtor::Int((*ty).into())), |