1 #![warn(clippy::self_named_constructors)]
7 pub fn should_spawn() -> ShouldSpawn {
11 fn should_not_spawn() -> ShouldNotSpawn {
17 pub fn new() -> ShouldNotSpawn {
22 struct ShouldNotSpawnWithTrait;
24 trait ShouldNotSpawnTrait {
28 impl ShouldNotSpawnTrait for ShouldNotSpawnWithTrait {
32 impl ShouldNotSpawnWithTrait {
33 pub fn should_not_spawn_with_trait() -> impl ShouldNotSpawnTrait<Item = Self> {
34 ShouldNotSpawnWithTrait
38 // Same trait name and same type name should not spawn the lint
42 trait TraitSameTypeName {
43 fn should_not_spawn() -> Self;
45 impl TraitSameTypeName for ShouldNotSpawn {
46 fn should_not_spawn() -> Self {
51 struct SelfMethodShouldNotSpawn;
53 impl SelfMethodShouldNotSpawn {
54 fn self_method_should_not_spawn(self) -> Self {
55 SelfMethodShouldNotSpawn