Skip to content

rustdoc: glue tokens before highlighting - #73807

Merged
bors merged 1 commit into
rust-lang:masterfrom
euclio:rustdoc-highlighting
Jul 16, 2020
Merged

rustdoc: glue tokens before highlighting#73807
bors merged 1 commit into
rust-lang:masterfrom
euclio:rustdoc-highlighting

Conversation

@euclio

Copy link
Copy Markdown
Contributor

Fixes#72684.

This commit also modifies the signature of Classifier::new to avoid
copying the source being highlighted.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @ollie27

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 27, 2020
@euclio
euclioforce-pushed the rustdoc-highlighting branch from b2edece to a78beaaCompareJune 27, 2020 19:09
@bors

bors commented Jul 14, 2020

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #74330) made this pull request unmergeable. Please resolve the merge conflicts.

Fixesrust-lang#72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
@euclio
euclioforce-pushed the rustdoc-highlighting branch from a78beaa to c3ee75dCompareJuly 14, 2020 23:08
@ollie27

Copy link
Copy Markdown
Contributor

Sorry for the delay.

Unfortunately this doesn't completely fix the issue. There are cases where tokens shouldn't be glued together for example:

Before this PR:

image

After this PR:

image

I'm tempted to say we should merge this anyway unless there's an easy way to fix the above because in most cases this is an improvement. @GuillaumeGomez what do you think?

@euclio

Copy link
Copy Markdown
ContributorAuthor

Yes, not ideal, but I believe that was the status-quo before && was broken. Fixing it would require bringing in the full parser which would be overkill IMO.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Not great if it introduces some regressions but it is an improvement, indeed. Can you open an issue about it, explaining a bit the situation and everything please? Once done, r=ollie27 and me

@euclio

euclio commented Jul 15, 2020

Copy link
Copy Markdown
ContributorAuthor

@GuillaumeGomez To clarify, this PR doesn't introduce any regressions. 1.38.0 (the last release where && was highlighted properly) also did not highlight &&&str correctly.

Screen Shot 2020-07-15 at 3 31 36 PM

Writing a triple reference is rare enough that I think this is acceptable.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Oh I see, I thought you were talking about the documentation, not the source code pages. Then it's all improvements! :D

@ollie27

Copy link
Copy Markdown
Contributor

I didn't realize that that bug was present in the past, in which case I agree that this is fine.

@bors r=ollie27,GuillaumeGomez

@bors

bors commented Jul 16, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit c3ee75d has been approved by ollie27,GuillaumeGomez

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 16, 2020
…e27,GuillaumeGomez
rustdoc: glue tokens before highlighting
Fixesrust-lang#72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 16, 2020
…e27,GuillaumeGomez
rustdoc: glue tokens before highlighting
Fixesrust-lang#72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 16, 2020
…e27,GuillaumeGomez
rustdoc: glue tokens before highlighting
Fixesrust-lang#72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 16, 2020
…arth
Rollup of 21 pull requests
Successful merges:
- rust-lang#73566 (Don't run `everybody_loops` for rustdoc; instead ignore resolution errors)
- rust-lang#73771 (Don't pollute docs/suggestions with libstd deps)
- rust-lang#73794 (Small cleanup for E0705 explanation)
- rust-lang#73807 (rustdoc: glue tokens before highlighting)
- rust-lang#73835 (Clean up E0710 explanation)
- rust-lang#73926 (Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64)
- rust-lang#73981 (Remove some `ignore-stage1` annotations.)
- rust-lang#73998 (add regression test for rust-lang#61216)
- rust-lang#74140 (Make hir ProjectionKind more precise)
- rust-lang#74148 (Move #[doc(alias)] check in rustc)
- rust-lang#74159 (forbid generic params in the type of const params)
- rust-lang#74171 (Fix 44056 test with debug on macos.)
- rust-lang#74221 (Don't panic if the lhs of a div by zero is not statically known)
- rust-lang#74325 (Focus on the current file in the source file sidebar)
- rust-lang#74359 (rustdoc: Rename internal API fns to `into_string`)
- rust-lang#74370 (Reintroduce spotlight / "important traits" feature)
- rust-lang#74390 (Fix typo in std::mem::transmute documentation)
- rust-lang#74391 (BtreeMap: superficially refactor root access)
- rust-lang#74392 (const generics triage)
- rust-lang#74397 (Fix typo in the latest release note)
- rust-lang#74406 (Set shell for github actions CI)
Failed merges:
r? @ghost
@bors
bors merged commit b700835 into rust-lang:masterJul 16, 2020
@euclio
euclio deleted the rustdoc-highlighting branch July 17, 2020 00:04
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc doesn't highlight "&&" properly

6 participants

@euclio@rust-highfive@bors@ollie27@GuillaumeGomez@cuviper