-
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
intra-rustdoc-link: Cannot use core in core crate #73445
Comments
Note: Document build pass in user crate: /// Intra link testings
///
/// [`Deref::Target`](core::ops::Deref)
pub struct Foo; |
What happens if you use |
Actually this might be a markdown issue, does |
@lzutao |
@jyn514 no, it's not a markdown issue |
@rustbot modify labels: T-rustdoc A-intra-doc-links D-confusing |
Which can be worked around with an |
Oh, using |
I don't see how: |
I cannot use Documenting core v0.0.0 (/home/lzutao/fork/rust/compiler/src/libcore)
error: `[std::ops::Deref]` cannot be resolved, ignoring it.
--> src/libcore/result.rs:1151:77
|
1151 | /// Coerces the [`Ok`] variant of the original [`Result`] via [`Deref`](std::ops::Deref)
| ^^^^^^^^^^^^^^^ cannot be resolved, ignoring
|
You have a point. But for me what makes this confusing is that in doctest |
doctests are separate crates that have the original as a dependency. This is the reason you can't have doctests for private functions even if they're |
Yes, that's understandable. But a note or help message in case resolve links fail could help. |
@lzutao well, yes, core does not have a std in it's dependencies |
Doctests are separate crates and this distinction comes up quite often anyway so I'm not sure if it needs to be fixed in intra doc links, I'd also be surprised if folks didn't know it as well. |
I still want to fix this; now that #73473 is fixed, it's blocked on #75176 (comment). I think this has value and is possible to implement so I'm re-opening - just because it doesn't work by default doesn't mean it has to never work. |
Update: this no longer ICEs, it just gives an error about duplicate macros:
Marking this as blocked on #83761. |
Oh I take it back - that's the error for |
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
Allow using `core::` in intra-doc links within core itself I came up with this idea ages ago, but rustdoc used to ICE on it. Now it doesn't. Helps with rust-lang#73445. Doesn't fix it completely since `extern crate self as std;` in std still gives strange errors.
I tried to document this code in libcore (
./x.py doc src/libcore
):I expected to see the above code build pass.
Instead, this happened: Build failed the following errors:
cc #43466
cc @Manishearth @GuillaumeGomez @jyn514
The text was updated successfully, but these errors were encountered: