You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mspiegel opened this issue
Jun 18, 2016
· 4 comments
Labels
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint groupT-middleType: Probably requires verifiying types
I'm a novice to rust and noticed recently that I had accidentally created two implementation sections within the same module. Both sections were impl's that did not have a trait declaration:
impl Foobar {
...stuff here
}
impl Foobar {
...more stuff here
}
It's probably a good practice to warn on duplicate impls or is there something I am not considering?
The text was updated successfully, but these errors were encountered:
mcarton
added
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
T-middle
Type: Probably requires verifiying types
A-lint
Area: New lints
L-style
Lint: Belongs in the style lint group
labels
Jun 18, 2016
I see duplicate impls in conjunction with #[cfg(..)]s to unify implementations for different systems. Otherwise I consider them a net loss in readability.
Different impl sections can have different generic bounds.
I also like to (ab?)use that to make sections in the documentation:
pubstructFoo;/// # ConstructorsimplFoo{/// Make a default `Foo`pubfnnew() -> Foo{ … }/// Make a `Foo` with some `Bar`pubfnwith_bar() -> Foo{ … }}/// # Operations on `Foo`simplFoo{/// Do something with a `Foo`pubfndo_sth(self){ … }}
looks like this:
But:
pubstructFoo;implFoo{/// # Constructors/// Make a default `Foo`pubfnnew() -> Foo{ … }/// Make a `Foo` with some `Bar`pubfnwith_bar() -> Foo{ … }/// # Operations on `Foo`s/// Do something with a `Foo`pubfndo_sth(self){ … }}
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-styleLint: Belongs in the style lint groupT-middleType: Probably requires verifiying types
I'm a novice to rust and noticed recently that I had accidentally created two implementation sections within the same module. Both sections were impl's that did not have a trait declaration:
It's probably a good practice to warn on duplicate impls or is there something I am not considering?
The text was updated successfully, but these errors were encountered: