-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen/trait_impls: Omit version constraints if already guarded
This removes unnecessary (duplicate) `#[cfg]` attributes on trait implementations where the surrounding `mod` (when in a file that fully defines a `struct`) already declares this constraint. This does not suffice for `flags`/`enums` where multiple types live in a single shared file without surrounding constraint. When the feature requirement is already described it is superfluous (and noisy) to specify it again. Besides, rustdoc omits duplicate feature requirements if it can show this just once at the top of the page for the entire `struct`.
- Loading branch information
Showing
5 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,6 +154,7 @@ fn generate_enum( | |
&analysis.functions, | ||
&analysis.specials, | ||
None, | ||
None, | ||
)?; | ||
|
||
writeln!(w)?; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,7 @@ fn generate_flags( | |
&analysis.functions, | ||
&analysis.specials, | ||
None, | ||
None, | ||
)?; | ||
|
||
writeln!(w)?; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters