]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/from_over_into.rs
3 #![feature(type_alias_impl_trait)]
4 #![warn(clippy::from_over_into)]
7 // this should throw an error
8 struct StringWrapper(String
);
10 impl Into
<StringWrapper
> for String
{
11 fn into(self) -> StringWrapper
{
16 struct SelfType(String
);
18 impl Into
<SelfType
> for String
{
19 fn into(self) -> SelfType
{
28 const FOO
: &'
static str = "a";
33 impl Into
<SelfKeywords
> for X
{
34 fn into(self) -> SelfKeywords
{
43 struct ExplicitPaths(bool
);
45 impl core
::convert
::Into
<bool
> for crate::ExplicitPaths
{
46 fn into(mut self) -> bool
{
47 let in_closure
= || self.0;
57 impl From
<String
> for A
{
58 fn from(s
: String
) -> A
{
63 struct PathInExpansion
;
65 impl Into
<String
> for PathInExpansion
{
66 fn into(self) -> String
{
67 // non self/Self paths in expansions are fine
72 #[clippy::msrv = "1.40"]
74 struct FromOverInto
<T
>(Vec
<T
>);
76 impl<T
> Into
<FromOverInto
<T
>> for Vec
<T
> {
77 fn into(self) -> FromOverInto
<T
> {
83 #[clippy::msrv = "1.41"]
85 struct FromOverInto
<T
>(Vec
<T
>);
87 impl<T
> Into
<FromOverInto
<T
>> for Vec
<T
> {
88 fn into(self) -> FromOverInto
<T
> {