-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
async-std
docs no longer build on recent nightlies
#75100
Comments
Copy/pasting from the PR: There's not a good way to fix this. We could revert, but then we lose the fixes to intra-doc links and they'd be permanently unstable again. Maybe we could have a reachability pass for rustdoc that's separate from the one for rustc? #73566 (comment) That's going to require a lot of work though, it's not a quick fix. And I don't know if it would actually do what I want. |
So a minimal repro for this would be something like the following? #[cfg(any(windows, doc))]
fn this() -> u32 {
3
}
#[cfg(any(unix, doc))]
fn this() -> u32 {
4
}
pub async fn wow() -> u32 {
this()
} |
No, that's not right - that errors on the function signatures, not the function bodies:
This error is because rustdoc is type checking the function bodies. |
A minimal repro is pub async fn f() {
content::should::not::matter();
}
error[E0433]: failed to resolve: could not resolve path `content::should::not::matter`
--> body_error.rs:2:5
|
2 | content::should::not::matter();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `content::should::not::matter`
|
= note: this error was originally ignored because you are running `rustdoc`
= note: try running again with `rustc` or `cargo check` and you may get a more detailed error |
Ah, and a more realistic example would probably be: mod windows {
pub trait WinFoo {
fn foo(&self) {}
}
impl WinFoo for () {}
}
#[cfg(any(windows, doc))]
use windows::*;
mod unix {
pub trait UnixFoo {
fn foo(&self) {}
}
impl UnixFoo for () {}
}
#[cfg(any(unix, doc))]
use unix::*;
async fn bar() {
().foo()
} Thanks ❤️ |
@GuillaumeGomez I'm not sure why rust/src/librustc_privacy/lib.rs Lines 791 to 797 in 780d6cb
privacy_access_levels and we can fix it for privacy_access_levels generally and only pessimize that call?
|
I think it might be interesting to ask the compiler team before doing anything in here. They might have a solution we didn't think about. :) |
Ping @rust-lang/compiler - does anyone know why The following patch does not fix it, but that might just be because I'm not understanding diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs
index fc00050f405..5855b48c01d 100644
--- a/src/librustc_privacy/lib.rs
+++ b/src/librustc_privacy/lib.rs
@@ -782,8 +782,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
// FIXME: This is some serious pessimization intended to workaround deficiencies
// in the reachability pass (`middle/reachable.rs`). Types are marked as link-time
// reachable if they are returned via `impl Trait`, even from private functions.
- let exist_level = cmp::max(item_level, Some(AccessLevel::ReachableFromImplTrait));
- self.reach(item.hir_id, exist_level).generics().predicates().ty();
+ //let exist_level = cmp::max(item_level, Some(AccessLevel::ReachableFromImplTrait));
+ self.reach(item.hir_id, item_level).generics().predicates().ty();
}
// Visit everything.
hir::ItemKind::Const(..) edit since this is the comment with the ping: there are even more issues than this, see #75100 (comment) |
Worth remembering: rustdoc does not care one bit about what the actual type of an impl Trait is, aside from the trait itself, which should already be known since that's explicitly specified (via trait or via the async keyword). So it should theoretically be possible to make this work without solving item bodies. |
(Though it might be nice if rustdoc indicated leaked auto-traits, which would require knowing the concrete type). |
@Nemo157 knowing the type and allowing type errors are mutually incompatible. So even theoretically it would only be possible if there were no type errors, and it would be a very delicate balance trying to only run typeck if we knew it would succeed. |
Oh, another thing I should note: |
everybody_loops skipped the pass entirely, which would still give type errors like we do now. The only thing that changed is that |
@yoshuawuyts one thing I don't understand: Is this a new error on your CI, or was your CI broken before but ignored? I'm surprised this was only caught now given that the nightly that broke it was months ago, and y'all seem to be running the doc CI run on nightly. |
Can we confirm that this hasn't reached beta as well? |
@Manishearth We've been having some unrelated issues with ARM builds on our CI. That took a while to investigate and eventually disable. My guess is that that's been masking this issue. That said I haven't done much work on |
Ah, makes sense, thanks. @estebank It should have hit beta, but the stack of patches that has landed after this depending on it makes it hard to revert, and we should probably just fix it instead. |
No, it hasn't. I made sure I didn't r+ on everybody_loops until the beta release.
|
Oh, right! |
Ok, the cause of this is different from in the original PR. My suspicion is that the original
I added |
(nominated so prioritisation discussion not required) |
Ok, we can use this issue for the remaining work but let's adjust the priority to |
@jyn514 just built async-std locally with the latest nightly, and it seems to work! -- thanks so much! |
I'm going to close this, no one has a suggested any alternative approach and people are continuing to add |
async-std
docs no longer build on recent nightlies
Original issue surfaced in: async-rs/async-std#845 by @dignifiedquire. It appears that sometime after
2020-05-01
nightlies are no longer able to buildasync-std
docs. #73566 appears to be a likely cause for this regression.We use a fairly elaborate macro to generate docs, so we're not particularly surprised that a big refactor may have caused issues there. But it'd still be nice if we could get it to work again.
Error
The error message is fairly long and probably not worth posting in full. Luckily it does not appear to be an ICE, just a regression. This is the build that fails: link.
The text was updated successfully, but these errors were encountered: