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 ascii whitespace char for doc aliases #77570

Merged
merged 3 commits into from
Oct 15, 2020

Conversation

GuillaumeGomez
Copy link
Member

Fixes issue from #76705 (comment)

cc @lopopolo @ollie27

r? @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 5, 2020
@GuillaumeGomez GuillaumeGomez changed the title Whitespace doc alias Allow ascii whitespace char for doc aliases Oct 5, 2020
@lopopolo
Copy link
Contributor

lopopolo commented Oct 5, 2020

Thank you! 📚

@jyn514 jyn514 added A-doc-alias Area: `#[doc(alias)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 5, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 5, 2020

You need to run x.py test src/test/rustdoc --test-args check-doc-alias --bless:

---- [ui] ui/check-doc-alias-attr.rs stdout ----
diff of stderr:

36	LL | | ")]
37	   | |_^
38	
-	error: ' ' character isn't allowed in `#[doc(alias = "...")]`
-	  --> $DIR/check-doc-alias-attr.rs:14:7
-	   |
-	LL | #[doc(alias = " ")]
-	   |       ^^^^^^^^^^^
-	
45	error: '\t' character isn't allowed in `#[doc(alias = "...")]`
46	  --> $DIR/check-doc-alias-attr.rs:15:7
47	   |

48	LL | #[doc(alias = "\t")]
49	   |       ^^^^^^^^^^^^
50	
-	error: aborting due to 8 previous errors
+	error: aborting due to 7 previous errors

Other than that this seems fine to me.

@jyn514
Copy link
Member

jyn514 commented Oct 5, 2020

Actually ollie had concerns about this in #76705 (comment), so

r? @ollie27

@rust-highfive rust-highfive assigned ollie27 and unassigned jyn514 Oct 5, 2020
@ollie27
Copy link
Member

ollie27 commented Oct 5, 2020

The issue I had with whitespace is that search queries are trimmed so if an alias begins with or ends in whitespace then it's impossible to search for it. We could allow spaces as long as they're not at the beginning or end of the alias though.

@GuillaumeGomez
Copy link
Member Author

Excellent point! Then I'll update this PR to take this into account.

@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez
Copy link
Member Author

ping @ollie27

@GuillaumeGomez
Copy link
Member Author

I fixed the last comments so let's move on!

@bors: r=jyn514,ollie27

@bors
Copy link
Contributor

bors commented Oct 14, 2020

📌 Commit 11f3476 has been approved by jyn514,ollie27

@bors
Copy link
Contributor

bors commented Oct 14, 2020

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors bors 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 Oct 14, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#77570 (Allow ascii whitespace char for doc aliases )
 - rust-lang#77739 (Remove unused code)
 - rust-lang#77753 (Check html comments)
 - rust-lang#77879 (Provide better documentation and help messages for x.py setup)
 - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests)
 - rust-lang#77934 (Document -Z codegen-backend in the unstable book)
 - rust-lang#77936 (Remove needless alloc_slice)
 - rust-lang#77946 (Validate references to source scopes)
 - rust-lang#77951 (Update books)

Failed merges:

r? `@ghost`
@bors bors merged commit 35210a6 into rust-lang:master Oct 15, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 15, 2020
@GuillaumeGomez GuillaumeGomez deleted the whitespace-doc-alias branch October 15, 2020 08:21
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 9, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

`@rustbot` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 9, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

``@rustbot`` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 9, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

```@rustbot``` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 9, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

````@rustbot```` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 9, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

`````@rustbot````` label +A-docs
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 10, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

``````@rustbot`````` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 10, 2024
…e-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

```````@rustbot``````` label +A-docs
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 10, 2024
Rollup merge of rust-lang#127484 - ShE3py:rustdoc-doc-alias-whitespace-doc, r=fmease

`#[doc(alias)]`'s doc: say that ASCII spaces are allowed

PR rust-lang#77570 allowed ASCII spaces in doc aliases, but the documentation wasn't updated to say so.

The code checking the aliases:
https://github.com/rust-lang/rust/blob/7fdefb804ec300fb605039522a7c0dfc9e7dc366/compiler/rustc_passes/src/check_attr.rs#L693-L704

``````@rustbot`````` label +A-docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doc-alias Area: `#[doc(alias)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants