File tree 3 files changed +10
-4
lines changed
src/tools/clippy/tests/ui
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ macro_rules! specialize_for_lengths {
90
90
$num => {
91
91
for s in iter {
92
92
copy_slice_and_advance!( target, sep_bytes) ;
93
- let content_bytes = s. borrow( ) . as_ref( ) ;
93
+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
94
94
copy_slice_and_advance!( target, content_bytes) ;
95
95
}
96
96
} ,
@@ -99,7 +99,7 @@ macro_rules! specialize_for_lengths {
99
99
// arbitrary non-zero size fallback
100
100
for s in iter {
101
101
copy_slice_and_advance!( target, sep_bytes) ;
102
- let content_bytes = s. borrow( ) . as_ref( ) ;
102
+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
103
103
copy_slice_and_advance!( target, content_bytes) ;
104
104
}
105
105
}
Original file line number Diff line number Diff line change @@ -201,7 +201,13 @@ impl AsRef<ByteStr> for ByteStr {
201
201
}
202
202
}
203
203
204
- // `impl AsRef<ByteStr> for [u8]` omitted to avoid widespread inference failures
204
+ #[ unstable( feature = "bstr" , issue = "134915" ) ]
205
+ impl AsRef < ByteStr > for [ u8 ] {
206
+ #[ inline]
207
+ fn as_ref ( & self ) -> & ByteStr {
208
+ ByteStr :: new ( self )
209
+ }
210
+ }
205
211
206
212
#[ unstable( feature = "bstr" , issue = "134915" ) ]
207
213
impl AsRef < ByteStr > for str {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ trait Trait {
7
7
fn as_ptr ( & self ) ;
8
8
}
9
9
10
- impl < ' a > Trait for & ' a [ u8 ] {
10
+ impl < ' a > Trait for & ' a [ u32 ] {
11
11
fn as_ptr ( & self ) {
12
12
self . as_ref ( ) . as_ptr ( ) ;
13
13
}
You can’t perform that action at this time.
0 commit comments