-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove many unnecessary manual link resolves from library #77832
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
If anyone's interested, I used this kind of hacky Python script (gist): import re
from pathlib import Path
import sys
pat = re.compile(r'\[`?(.*)<.*>(::([A-Za-z0-9_]+))?(\(\))?`?\]: \1(::\3)?')
for path in Path(sys.argv[1]).rglob('*.rs'):
print(path)
inf = open(path, 'r')
lines = inf.readlines()
inf.close()
outf = open(path, 'w')
prev_line_empty = False
prev_prev_line_empty = False
for line in lines:
if not pat.search(line):
if not (prev_line_empty and prev_prev_line_empty and line.strip('/ \n') == ''):
outf.write(line)
prev_prev_line_empty = prev_line_empty
prev_line_empty = line.strip('/ \n') == ''
else:
print('match!')
prev_prev_line_empty = prev_line_empty
prev_line_empty = True # empty because was not written to file
outf.close() There were a few spots where it was over-eager in removing blank lines, but they were easy to fix manually. |
r? @jyn514 |
This is blocked until the next beta bump, I think, we intentionally test the standard library is documented with --stage 0 so library contributors don't have to build the compiler: #75368 (comment) |
Oops, forgot :) Oh well, at least the PR will be ready then. |
This comment has been minimized.
This comment has been minimized.
4e12af1
to
ea3da77
Compare
Rebased. I think this is ready now! |
Accept '!' in intra-doc links This will allow linking to things like `Result<T, !>`. *See <https://github.com/rust-lang/rust/pull/77832#discussion_r528409079>.* r? `@jyn514`
@camelid I think this is ready to go once you rebase (which should fix the linkchecker error). |
Don't we have to wait for the next beta bump though? |
@camelid I think I might have been wrong about that - since the links fail silently, they won't actually cause |
@jyn514 Actually they don't fail silently (at least not in CI):
|
@jyn514 I just told CI to re-run, so we'll see what happens :) |
CI still failed with the same linkchecker errors. |
Probably this should just wait until the next beta bump – it's not urgent, although it is annoying to have to wait another 5 weeks :/ |
Only a few more days and then we can finally merge this! 😂 |
Okay, the beta bump happened! Re-running CI... |
Hmm, I don't see the button to re-run the workflow. Maybe because it's too old. @jyn514 do you want to |
@camelid can you rebase and push manually to make sure the links actually work? |
Now that rust-lang#76934 has merged, we can remove a lot of these! E.g, this is no longer necessary: [`Vec<T>`]: Vec
ea3da77
to
0506789
Compare
@jyn514 CI passed. Should be ready to go! |
@bors r+ rollup Thanks for sticking with this! I know waiting for the release trains is a pain. |
📌 Commit 0506789 has been approved by |
☀️ Test successful - checks-actions |
Now that #76934 has merged, we can remove a lot of these! E.g, this is
no longer necessary:
cc @jyn514