Skip to content

Commit

Permalink
allow dead TyGenericParams (YAGNI but maybe...)
Browse files Browse the repository at this point in the history
  • Loading branch information
aneksteind committed Aug 1, 2023
1 parent 1c39f40 commit 1e5b3b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions c2rust-analyze/src/rewrite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub enum Rewrite<S = Span> {
/// `<'a, 'b, ...>`
/// needed for cases when the span of the ADT name
/// is different from ADT generic params
#[allow(dead_code)]

This comment has been minimized.

Copy link
@spernsteiner

spernsteiner Aug 1, 2023

Collaborator

I've mostly quit using #[allow(dead_code)] because it's easy to introduce a new use of the formerly-dead item but forget to remove the attribute, which is then misleading. Instead, I add a leading underscore (e.g. _TyGenericParams), so it's still visible in the code and docs, but anyone introducing a use of the item will also have to remove the underscore (or else do Rewrite::_TyGenericParams(...), which stands out in code review).

This comment has been minimized.

Copy link
@aneksteind

aneksteind Aug 1, 2023

Author Contributor
TyGenericParams(Vec<Rewrite>),

// `static` builders
Expand Down

0 comments on commit 1e5b3b5

Please sign in to comment.