]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/from_over_into_unfixable.rs
1 #![warn(clippy::from_over_into)]
3 struct InMacro(String
);
5 macro_rules
! in_macro
{
11 impl Into
<InMacro
> for String
{
12 //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free
13 fn into(self) -> InMacro
{
18 struct WeirdUpperSelf
;
20 impl Into
<WeirdUpperSelf
> for &'
static [u8] {
21 //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free
22 fn into(self) -> WeirdUpperSelf
{
23 let _
= Self::default();
30 impl Into
<u8> for ContainsVal
{
31 //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free
38 pub struct Lval
<T
>(T
);
40 pub struct Rval
<T
>(T
);
42 impl<T
> Into
<Rval
<Self>> for Lval
<T
> {
43 //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free
44 fn into(self) -> Rval
<Self> {