File tree 3 files changed +11
-10
lines changed
3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -501,8 +501,8 @@ impl<'a> InferenceContext<'a> {
501
501
}
502
502
Literal :: ByteString ( ..) => {
503
503
let byte_type = Ty :: simple ( TypeCtor :: Int ( Uncertain :: Known ( IntTy :: u8 ( ) ) ) ) ;
504
- let slice_type = Ty :: apply_one ( TypeCtor :: Slice , byte_type) ;
505
- Ty :: apply_one ( TypeCtor :: Ref ( Mutability :: Shared ) , slice_type )
504
+ let array_type = Ty :: apply_one ( TypeCtor :: Array , byte_type) ;
505
+ Ty :: apply_one ( TypeCtor :: Ref ( Mutability :: Shared ) , array_type )
506
506
}
507
507
Literal :: Char ( ..) => Ty :: simple ( TypeCtor :: Char ) ,
508
508
Literal :: Int ( _v, ty) => Ty :: simple ( TypeCtor :: Int ( ( * ty) . into ( ) ) ) ,
Original file line number Diff line number Diff line change @@ -17,19 +17,20 @@ impl<T> [T] {
17
17
#[lang = "slice_alloc"]
18
18
impl<T> [T] {}
19
19
20
- fn test() {
21
- <[_]>::foo(b"foo" );
20
+ fn test(x: &[u8] ) {
21
+ <[_]>::foo(x );
22
22
}
23
23
"# ) ,
24
24
@r###"
25
25
45..49 'self': &[T]
26
26
56..79 '{ ... }': T
27
27
66..73 'loop {}': !
28
28
71..73 '{}': ()
29
- 133..160 '{ ...o"); }': ()
30
- 139..149 '<[_]>::foo': fn foo<u8>(&[u8]) -> u8
31
- 139..157 '<[_]>:..."foo")': u8
32
- 150..156 'b"foo"': &[u8]
29
+ 131..132 'x': &[u8]
30
+ 141..163 '{ ...(x); }': ()
31
+ 147..157 '<[_]>::foo': fn foo<u8>(&[u8]) -> u8
32
+ 147..160 '<[_]>::foo(x)': u8
33
+ 158..159 'x': &[u8]
33
34
"###
34
35
) ;
35
36
}
Original file line number Diff line number Diff line change @@ -414,15 +414,15 @@ fn test() {
414
414
27..31 '5f32': f32
415
415
37..41 '5f64': f64
416
416
47..54 '"hello"': &str
417
- 60..68 'b"bytes"': &[u8]
417
+ 60..68 'b"bytes"': &[u8; _ ]
418
418
74..77 ''c'': char
419
419
83..87 'b'b'': u8
420
420
93..97 '3.14': f64
421
421
103..107 '5000': i32
422
422
113..118 'false': bool
423
423
124..128 'true': bool
424
424
134..202 'r#" ... "#': &str
425
- 208..218 'br#"yolo"#': &[u8]
425
+ 208..218 'br#"yolo"#': &[u8; _ ]
426
426
"###
427
427
) ;
428
428
}
You can’t perform that action at this time.
0 commit comments