-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use intra-doc links for core/src/slice.mod.rs
#75932
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jyn514 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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.
There are a lot more links that can still be converted (e.g.
rust/library/core/src/slice/mod.rs
Line 7 in 197187f
//! [`std::slice`]: ../../std/slice/index.html |
r=me with comments addressed
Use |
Thanks so much for the coverage 👍 . I'm not sure how can I fix this, I don't think I can use |
You can :) This is linking to https://doc.rust-lang.org/std/slice/index.html, which is a re-export of https://doc.rust-lang.org/core/slice/index.html, which is the current module. So |
Oh hmm - it looks like that's not quite true, the |
Yah, thats what made me think of keeping it. |
Even though this is 7k file, but not many changes |
Ok, can I link
? |
It appears yes, I can |
This is #65983, fixed by #73101. If you wait a day or two until the beta bump it will be fixed then; if not you'll have to revert the changes. |
sorry I didn't run the checker for that. Ok I guess we can wait for it to be fixed. Thanks again for the help |
That's ok, that's what CI is for :) |
Beta was bumped today, so this should be good to go after a rebase :) |
still broken :( |
@Amjad50 you haven't rebased, so it's showing the test result from the previous compiler. Try rebasing over master. |
I rebased, when I push to here should I force? or just merge with the previous |
You should force-push, yes. |
If you merge it defeats the point of rebasing: it shows both the old and new commits, and makes it look in the diff as if you have all the hundreds of commits that you rebased over. |
- most are using primitive types links, which cannot be used with intra links at the moment - also `std` cannot be referenced in any link
b16984f
to
6aae4a2
Compare
Is the rebase done correctly? It failed |
Your rebase is fine but the bug was still not fixed :( It's a rustdoc bug of some sort, I'll try to look into it this weekend. If you can reproduce outside the standard library that would be amazing ❤️ but no problem if you're not sure how. |
Definitely, I really love contributing. Thanks so much for the help.😊 |
I don't understand why this is failing :/ the error is being returned directly from
|
`alloc::slice` uses `core::slice` functions, documentation are copied from there and the links as well without resolution. `crate::ptr...` cannot be resolved in `alloc::slice`, but `ptr` itself is imported in both `alloc::slice` and `core::slice`, so we used that instead.
I think I fixed it, the problem in general is not solved. But for this case, we can use |
So from what I understand, Is there a way to change it so it resolves first and then copy the documentation? And would that affect other documentation processes. |
The fact that it does this is a bug, and I thought I fixed it in #73101. I don't know why it's still happening. |
In fact if you look at the debug logging it shouldn't be resolving in the current scope: it says itself that it's looking at core: |
Should this be merged? Or you think it's better to fix the problem first? |
Let's merge this for now, since the link will keep working even if the rustdoc bug is fixed. I'll open a separate issue for the rustdoc bug. @bors r+ rollup |
📌 Commit 300a007 has been approved by |
Use intra-doc links for `core/src/slice.mod.rs` partial help in rust-lang#75080 r? @jyn514 - most are using primitive types links, which cannot be used with intra links at the moment - also `std` cannot be referenced in any link, `std::ptr::NonNull` and `std::slice` could not be referenced
Use intra-doc links for `core/src/slice.mod.rs` partial help in rust-lang#75080 r? @jyn514 - most are using primitive types links, which cannot be used with intra links at the moment - also `std` cannot be referenced in any link, `std::ptr::NonNull` and `std::slice` could not be referenced
☀️ Test successful - checks-actions, checks-azure |
partial help in #75080
r? @jyn514
std
cannot be referenced in any link,std::ptr::NonNull
andstd::slice
could not be referenced