-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix rustdoc's formatting of lifetimes #14906
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
Conversation
@@ -91,7 +91,9 @@ impl fmt::Show for clean::Generics { | |||
|
|||
impl fmt::Show for clean::Lifetime { | |||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |||
try!(f.write("'".as_bytes())); | |||
if self.get_ref() == "static" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I thought static lifetimes should be stored as a literal string 'static
(i.e. with the '
). This possibly indicates a deeper bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the deeper bug you are alluding to is here: https://github.com/P1start/rust/blob/rustdoc-lifetimes/src/librustdoc/clean/mod.rs#L620
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! That does look like the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(of course, the link I just posted may not be a bug at all, but rather just a different choice of representation invariant that leads to the use of "static"
above rather than "'static"
. I assume rustdoc
would not have the same hygiene issues that rustc
has.)
rustdoc was previously formatting lifetimes with two apostrophes, presumably as a result of rust-lang#14797.
rustdoc was previously formatting lifetimes with two apostrophes, presumably as a result of #14797.
…-disable-explorer, r=Veykril fix: add a toggle to disable the dependency explorer For common uses of non-Cargo build systems with rust-analyzer, the dependency view isn't particularly helpful because there isn't a Cargo.toml present for dependencies or the dependencies are part of the current workspace. Speaking from the perspective of a user of `rust-project.json`, I'd prefer to have this feature disabled until I can add a field to `Crate` that defines the location of a build file (e.g., a `BUCK`) file, which would allow for removing the "search for a Cargo.toml in parent directories of a crate root" behavior that exists in a few places (I've opened [an issue](rust-lang/cargo#12187) on Cargo to request this data from `cargo-metadata`).
rustdoc was previously formatting lifetimes with two apostrophes, presumably as a result of #14797.