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

Allow documentation on fields. #36

Open
ticki opened this issue Jan 25, 2017 · 6 comments
Open

Allow documentation on fields. #36

ticki opened this issue Jan 25, 2017 · 6 comments

Comments

@ticki
Copy link

ticki commented Jan 25, 2017

    /// A page management error.
    enum Error {
        /// No clusters left in the freelist.
        ///
        /// This is the equivalent to OOM, but with disk space.
        OutOfClusters {
            description("Out of free clusters.")
        }
        /// A page checksum did not match.
        ///
        /// The checksum of the data and the checksum stored in the page pointer did not match.
        ///
        /// This indicates some form of data corruption in the sector storing the page.
        PageChecksumMismatch {
            /// The page with the mismatching checksum.
            page: page::Pointer,
            /// The actual checksum of the page.
            found: u32,
        } {
            display("Mismatching checksums in {} - expected {:x}, found {:x}.",
                    page, page.checksum, found)
            description("Mismatching checksum in page.")
        }
    }

gives error

error: expected ident, found #
  --> /home/andy/code/tfs/src/io/alloc.rs:22:13
   |
22 |             /// The page with the mismatching checksum.
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ticki
Copy link
Author

ticki commented Jan 25, 2017

The issue seems to be that it doesn't respond to metadata attributes on fields, which has the consequence that #[doc = "blah"] doesn't work.

@ticki
Copy link
Author

ticki commented Jan 25, 2017

I've tried to implement it here, but the code is really messy, and I am having a hard time following it, so it ends up in an error currently, however I suspect it is almost in goal.

@tailhook
Copy link
Owner

I think implementation should be similar to #30, except we don't need these attributes in match statements. Your one looks fine, but I haven't tested it yet.

By the way, this feature and #30 may conflict somehow (both work on attributes on variants but the attributes should be propagated in different ways). This is also the reason why I haven't applied #30. Hadn't checked if the conflict is real, though.

@ticki
Copy link
Author

ticki commented Jan 25, 2017

I like #30.

@ticki
Copy link
Author

ticki commented Jan 25, 2017

Oh. It's not a replacement, but a related pr. nvm

@tailhook
Copy link
Owner

Okay, I've merged in #30, but can't easily figure out how to fix this one :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants