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

BUG: nightly removing doc comments #5965

Closed
joshka opened this issue Nov 25, 2023 · 3 comments
Closed

BUG: nightly removing doc comments #5965

joshka opened this issue Nov 25, 2023 · 3 comments

Comments

@joshka
Copy link
Contributor

joshka commented Nov 25, 2023

In Ratatui, we format using nightly to take advantage of a few nightly only configuration settings.

Today, in addition to a bunch of changes that seem to make the code easier to read, I noticed that rustfmt started removing doc comments from the source code, which is really odd.

A PR that shows the problematic changes:
https://github.com/ratatui-org/ratatui/pull/645/files#diff-628d0c731b37af0b4b3e76450a4b5fa9efc05880d9038403ee7663f171f07f2a

Specifically the first change is in src/backend/crossterm.rs, but there are a few similar changes.

I've run rustup update which got:
nightly-aarch64-apple-darwin updated - rustc 1.76.0-nightly (37b2813a7 2023-11-24) (from rustc 1.76.0-nightly (1e9dda77b 2023-11-22))

Repro steps in case that's not enough:

  • gh repo clone ratatui-org/ratatui
  • cargo +nightly fmt
    and
    rustfmt 1.7.0-nightly (37b2813a 2023-11-24)

Diff:

impl<W> CrosstermBackend<W>
where
    W: Write,
{
    /// Creates a new `CrosstermBackend` with the given writer.
-    ///
-    /// # Example
-    ///
-    /// ```rust,no_run
-    /// # use std::io::stdout;
-    /// # use ratatui::prelude::*;
-    /// let backend = CrosstermBackend::new(stdout());
-    /// ```
    pub fn new(writer: W) -> CrosstermBackend<W> {
        CrosstermBackend { writer }
    }
}
@xfbs
Copy link

xfbs commented Nov 25, 2023

Duplicate of #5964, I think.

@ytmimi
Copy link
Contributor

ytmimi commented Nov 25, 2023

@xfbs yes, I think you're right. I'm pretty sure this is a duplicate of #5964. From my understanding this issue was caused by ABI changes in the rust-lang/rust repo and isn't related to code changes in rustfmt itself. rust-lang/rust#118127 should resolve the issues on nightly.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2023
@joshka
Copy link
Contributor Author

joshka commented Nov 25, 2023

Thanks :)

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

3 participants