]> git.lizzy.rs Git - rust.git/blob - tests/ui/from_over_into.rs
Addition `manual_map` test for `unsafe` blocks
[rust.git] / tests / ui / from_over_into.rs
1 #![warn(clippy::from_over_into)]
2
3 // this should throw an error
4 struct StringWrapper(String);
5
6 impl Into<StringWrapper> for String {
7     fn into(self) -> StringWrapper {
8         StringWrapper(self)
9     }
10 }
11
12 // this is fine
13 struct A(String);
14
15 impl From<String> for A {
16     fn from(s: String) -> A {
17         A(s)
18     }
19 }
20
21 fn main() {}