mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
Merge 331739105d
into 65fa0ab924
This commit is contained in:
commit
9c71494fff
@ -90,7 +90,7 @@ macro_rules! specialize_for_lengths {
|
||||
$num => {
|
||||
for s in iter {
|
||||
copy_slice_and_advance!(target, sep_bytes);
|
||||
let content_bytes = s.borrow().as_ref();
|
||||
let content_bytes: &[_] = s.borrow().as_ref();
|
||||
copy_slice_and_advance!(target, content_bytes);
|
||||
}
|
||||
},
|
||||
@ -99,7 +99,7 @@ macro_rules! specialize_for_lengths {
|
||||
// arbitrary non-zero size fallback
|
||||
for s in iter {
|
||||
copy_slice_and_advance!(target, sep_bytes);
|
||||
let content_bytes = s.borrow().as_ref();
|
||||
let content_bytes: &[_] = s.borrow().as_ref();
|
||||
copy_slice_and_advance!(target, content_bytes);
|
||||
}
|
||||
}
|
||||
|
@ -201,7 +201,13 @@ impl AsRef<ByteStr> for ByteStr {
|
||||
}
|
||||
}
|
||||
|
||||
// `impl AsRef<ByteStr> for [u8]` omitted to avoid widespread inference failures
|
||||
#[unstable(feature = "bstr", issue = "134915")]
|
||||
impl AsRef<ByteStr> for [u8] {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &ByteStr {
|
||||
ByteStr::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "bstr", issue = "134915")]
|
||||
impl AsRef<ByteStr> for str {
|
||||
|
@ -7,7 +7,7 @@ trait Trait {
|
||||
fn as_ptr(&self);
|
||||
}
|
||||
|
||||
impl<'a> Trait for &'a [u8] {
|
||||
impl<'a> Trait for &'a [u32] {
|
||||
fn as_ptr(&self) {
|
||||
self.as_ref().as_ptr();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user