Skip to content

Commit

Permalink
Allow for unused doc comments on macros
Browse files Browse the repository at this point in the history
With Rust 1.35 we get compile errors due to doc comments that are added
to macro invocations but not actually included in the expanded output.
The rustc wrongly assumes that we want to document the resulting code
and not just provide details about the invocation itself.
This change explicitly allows for those cases. Alternatively we could
have "downgraded" the doc comments to normal comments or removed them
altogether. There is little difference between those alternatives.
  • Loading branch information
d-e-s-o committed May 25, 2019
1 parent 4625be0 commit 5383aa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nitrocli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl<'io> Stdio for ExecCtx<'io> {
}

/// The available Nitrokey models.
#[allow(unused_doc_comments)]
Enum! {DeviceModel, [
Pro => "pro",
Storage => "storage"
Expand All @@ -116,6 +117,7 @@ impl From<DeviceModel> for nitrokey::Model {
}

/// A top-level command for nitrocli.
#[allow(unused_doc_comments)]
Enum! {Command, [
Config => ("config", config),
Lock => ("lock", lock),
Expand Down
1 change: 1 addition & 0 deletions nitrocli/src/pinentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type CowStr = borrow::Cow<'static, str>;
///
/// The available PIN types correspond to the PIN types used by the Nitrokey devices: user and
/// admin.
#[allow(unused_doc_comments)]
Enum! {PinType, [
Admin => "admin",
User => "user"
Expand Down

0 comments on commit 5383aa7

Please sign in to comment.