mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 21:47:04 +00:00
parent
51e4b92c1e
commit
f5177f91ae
@ -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())),
|
||||
|
@ -17,8 +17,8 @@ impl<T> [T] {
|
||||
#[lang = "slice_alloc"]
|
||||
impl<T> [T] {}
|
||||
|
||||
fn test() {
|
||||
<[_]>::foo(b"foo");
|
||||
fn test(x: &[u8]) {
|
||||
<[_]>::foo(x);
|
||||
}
|
||||
"#),
|
||||
@r###"
|
||||
@ -26,10 +26,11 @@ fn test() {
|
||||
56..79 '{ ... }': T
|
||||
66..73 'loop {}': !
|
||||
71..73 '{}': ()
|
||||
133..160 '{ ...o"); }': ()
|
||||
139..149 '<[_]>::foo': fn foo<u8>(&[u8]) -> u8
|
||||
139..157 '<[_]>:..."foo")': u8
|
||||
150..156 'b"foo"': &[u8]
|
||||
131..132 'x': &[u8]
|
||||
141..163 '{ ...(x); }': ()
|
||||
147..157 '<[_]>::foo': fn foo<u8>(&[u8]) -> u8
|
||||
147..160 '<[_]>::foo(x)': u8
|
||||
158..159 'x': &[u8]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ fn test() {
|
||||
27..31 '5f32': f32
|
||||
37..41 '5f64': f64
|
||||
47..54 '"hello"': &str
|
||||
60..68 'b"bytes"': &[u8]
|
||||
60..68 'b"bytes"': &[u8; _]
|
||||
74..77 ''c'': char
|
||||
83..87 'b'b'': u8
|
||||
93..97 '3.14': f64
|
||||
@ -422,7 +422,7 @@ fn test() {
|
||||
113..118 'false': bool
|
||||
124..128 'true': bool
|
||||
134..202 'r#" ... "#': &str
|
||||
208..218 'br#"yolo"#': &[u8]
|
||||
208..218 'br#"yolo"#': &[u8; _]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user