-
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
Don't run everybody_loops
for rustdoc; instead ignore resolution errors
#73566
Commits on Jul 15, 2020
-
Initialize default providers only once
This avoids copying a new `Providers` struct for each downstream crate that wants to use it.
Configuration menu - View commit details
-
Copy full SHA for f6764c4 - Browse repository at this point
Copy the full SHA f6764c4View commit details -
Don't run everybody_loops for rustdoc
Instead, ignore resolution errors that occur in item bodies. The reason this can't ignore item bodies altogether is because `const fn` could be used in generic types, for example `[T; f()]`
Configuration menu - View commit details
-
Copy full SHA for a5275ff - Browse repository at this point
Copy the full SHA a5275ffView commit details -
Don't run analysis pass in rustdoc
- Explicitly check for missing docs - Don't run any lints except those we explicitly specified
Configuration menu - View commit details
-
Copy full SHA for b3187aa - Browse repository at this point
Copy the full SHA b3187aaView commit details -
Add an option not to report resolution errors for rustdoc
- Remove unnecessary `should_loop` variable - Report errors for trait implementations These should give resolution errors because they are visible outside the current scope. Without these errors, rustdoc will give ICEs: ``` thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9 15: rustc_hir::def::Res<Id>::def_id at /home/joshua/src/rust/src/librustc_hir/def.rs:382 16: rustdoc::clean::utils::register_res at src/librustdoc/clean/utils.rs:627 17: rustdoc::clean::utils::resolve_type at src/librustdoc/clean/utils.rs:587 ``` - Add much more extensive tests + fn -> impl -> fn + fn -> impl -> fn -> macro + errors in function parameters + errors in trait bounds + errors in the type implementing the trait + unknown bounds for the type + unknown types in function bodies + errors generated by macros - Use explicit state instead of trying to reconstruct it from random info - Use an enum instead of a boolean - Add example of ignored error
Configuration menu - View commit details
-
Copy full SHA for 1b8accb - Browse repository at this point
Copy the full SHA 1b8accbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 14a8707 - Browse repository at this point
Copy the full SHA 14a8707View commit details -
Don't ICE on errors in function returning impl trait
Instead, report the error. This emits the errors on-demand, without special-casing `impl Trait`, so it should catch all ICEs of this kind, including ones that haven't been found yet. Since the error is emitted during type-checking there is less info about the error; see comments in the code for details. - Add test case for -> impl Trait - Add test for impl trait with alias - Move EmitIgnoredResolutionErrors to rustdoc This makes `fn typeck_item_bodies` public, which is not desired behavior. That change should be removed once rust-lang#74070 is merged. - Don't visit nested closures twice
Configuration menu - View commit details
-
Copy full SHA for 768d6a4 - Browse repository at this point
Copy the full SHA 768d6a4View commit details -
Recurse into function bodies, but don't typeck closures
Previously, rustdoc would issue a delay_span_bug ICE on the following code: ```rust pub fn a() -> impl Fn() -> u32 { || content::doesnt::matter() } ``` This wasn't picked up earlier because having `type Alias = impl Trait;` in the same module caused _all closures_ to be typechecked, even if they wouldn't normally. Additionally, if _any_ error was emitted, no delay_span_bug would be emitted. So as part of this commit all of the tests were separated out into different files.
Configuration menu - View commit details
-
Copy full SHA for a93bcc9 - Browse repository at this point
Copy the full SHA a93bcc9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d010443 - Browse repository at this point
Copy the full SHA d010443View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf844d2 - Browse repository at this point
Copy the full SHA cf844d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cbc1cd - Browse repository at this point
Copy the full SHA 0cbc1cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3576f5d - Browse repository at this point
Copy the full SHA 3576f5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bbe4971 - Browse repository at this point
Copy the full SHA bbe4971View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f29e69 - Browse repository at this point
Copy the full SHA 2f29e69View commit details -
Use tcx as the only context for visitor
Previously two different parts of the context had to be passed separately; there were two sources of truth.
Configuration menu - View commit details
-
Copy full SHA for 763d373 - Browse repository at this point
Copy the full SHA 763d373View commit details -
Remove unnecessary lifetime parameter
TyCtxt is a reference type and so can be passed by value.
Configuration menu - View commit details
-
Copy full SHA for 0759a55 - Browse repository at this point
Copy the full SHA 0759a55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d0e8e2 - Browse repository at this point
Copy the full SHA 2d0e8e2View commit details -
Don't ICE on infinitely recursive types
`evaluate_obligation` can only be run on types that are already valid. So rustdoc still has to run typeck even though it doesn't care about the result.
Configuration menu - View commit details
-
Copy full SHA for 02a24c8 - Browse repository at this point
Copy the full SHA 02a24c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c88070 - Browse repository at this point
Copy the full SHA 4c88070View commit details -
Configuration menu - View commit details
-
Copy full SHA for b2ff0e7 - Browse repository at this point
Copy the full SHA b2ff0e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac9157b - Browse repository at this point
Copy the full SHA ac9157bView commit details -
- Move static variables into the innermost scope in which they are used - Clean up comments - Remove external_providers; rename local_providers -> providers
Configuration menu - View commit details
-
Copy full SHA for 6eec9fb - Browse repository at this point
Copy the full SHA 6eec9fbView commit details -
Catch errors for any new item, not just trait implementations
This matches the previous behavior of everybody_loops and is also more consistent than special-casing impls.
Configuration menu - View commit details
-
Copy full SHA for e117b47 - Browse repository at this point
Copy the full SHA e117b47View commit details -
Use the default providers in rustc_interface instead of adding our own
This avoids duplicating the same struct twice.
Configuration menu - View commit details
-
Copy full SHA for 281ca13 - Browse repository at this point
Copy the full SHA 281ca13View commit details
Commits on Jul 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 631b2b9 - Browse repository at this point
Copy the full SHA 631b2b9View commit details