aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-08 14:22:05 +0100
committerGitHub <[email protected]>2020-05-08 14:22:05 +0100
commitd3eb9d8eafbebca7da95fa8a4813b92eb5080500 (patch)
treee76e38744fefe81c5ec1f121672022a36307dcf4 /crates/ra_hir_ty/src/infer
parent51e4b92c1eee25cb6bf1b5ec8e7633dfc5f67a45 (diff)
parentf5177f91ae61e1d812efd6b55a1ec7ab07c7c7e1 (diff)
Merge #4376
4376: Fix type of byte literals r=matklad a=flodiebold They're `&[u8; N]`, not `&[u8]` (see #4374). Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs4
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())),