File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
src/tools/clippy/tests/ui Expand file tree Collapse file tree 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 {
9090 $num => {
9191 for s in iter {
9292 copy_slice_and_advance!( target, sep_bytes) ;
93- let content_bytes = s. borrow( ) . as_ref( ) ;
93+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
9494 copy_slice_and_advance!( target, content_bytes) ;
9595 }
9696 } ,
@@ -99,7 +99,7 @@ macro_rules! specialize_for_lengths {
9999 // arbitrary non-zero size fallback
100100 for s in iter {
101101 copy_slice_and_advance!( target, sep_bytes) ;
102- let content_bytes = s. borrow( ) . as_ref( ) ;
102+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
103103 copy_slice_and_advance!( target, content_bytes) ;
104104 }
105105 }
Original file line number Diff line number Diff line change @@ -200,7 +200,13 @@ impl AsRef<ByteStr> for ByteStr {
200200 }
201201}
202202
203- // `impl AsRef<ByteStr> for [u8]` omitted to avoid widespread inference failures
203+ #[ unstable( feature = "bstr" , issue = "134915" ) ]
204+ impl AsRef < ByteStr > for [ u8 ] {
205+ #[ inline]
206+ fn as_ref ( & self ) -> & ByteStr {
207+ ByteStr :: new ( self )
208+ }
209+ }
204210
205211#[ unstable( feature = "bstr" , issue = "134915" ) ]
206212impl AsRef < ByteStr > for str {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ trait Trait {
77 fn as_ptr ( & self ) ;
88}
99
10- impl < ' a > Trait for & ' a [ u8 ] {
10+ impl < ' a > Trait for & ' a [ u32 ] {
1111 fn as_ptr ( & self ) {
1212 self . as_ref ( ) . as_ptr ( ) ;
1313 }
You can’t perform that action at this time.
0 commit comments