Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display derive with doc comments fails on unit structs #32

Closed
6 of 9 tasks
dr-orlovsky opened this issue Oct 30, 2020 · 0 comments
Closed
6 of 9 tasks

Display derive with doc comments fails on unit structs #32

dr-orlovsky opened this issue Oct 30, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dr-orlovsky
Copy link
Member

Checklist
Put x in the boxes below:

  • I am using rust compiler version no less than 1.41.1
  • I am using the latest code (git checkout master && git pull origin)
  • I did cargo update
  • I recompiler adter removing target directory

Bug type

Put x in the boxes below:

  • Build issue
  • Test failing
  • Runtime panic
  • Incorrect results
  • Unexpected/undocumented behavior

Problem description

Display derive with doc comments fails on unit structs

Reproducing

Steps to reproduce the behavior:

  1. Operating system: MacOS
  2. Rust compiler version: nightly
  3. Code snippet:
    /// Address type do not support ONION address format and can be used only with
    /// IPv4 or IPv6 addresses
    #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display, Error)]
    #[display(doc_comments)]
    pub struct NoOnionSupportError;

Logs

Please copy and paste content of cargo test --all --all-features -v in a block
below right after "console" line:

error[E0308]: mismatched types
  --> src/internet.rs:30:68
   |
30 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display, Error)]
   |                                                                    ^^^^^^^
   |                                                                    |
   |                                                                    expected enum `std::result::Result`, found `()`
   |                                                                    implicitly returns `()` as its body has no tail or `return` expression
   |
   = note:   expected enum `std::result::Result<(), std::fmt::Error>`
           found unit type `()`
   = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
@dr-orlovsky dr-orlovsky added the bug Something isn't working label Oct 30, 2020
@dr-orlovsky dr-orlovsky self-assigned this Oct 30, 2020
@dr-orlovsky dr-orlovsky modified the milestones: v2.1, v2.0.7 Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant