Uh oh!
There was an error while loading. Please reload this page.
Rollup of 22 pull requests - #74403
Closed
Manishearth wants to merge 92 commits into
Closed
Conversation
This would partially resolvefortanix/rust-sgx#31
Currently dependency crates of the standard library can sometimes leak into error messages such as when traits to import are suggested. Additionally they can leak into documentation such as in the list of "all traits implemented by `u32`". The dependencies of the standard library, however, are intended to be private. The dependencies of the standard library can't actually be stabl-y imported nor is the documentation that relevant since you can't import them on stable either. This commit updates both the compiler and rustdoc to ignore unstable traits in these two scenarios. Specifically the suggestion for traits to import ignore unstable traits, and similarly the list of traits implemented by a type excludes unstable traits. This commit is extracted from rust-lang#73441 where the addition of some new dependencies to the standard library was showed to leak into various error messages and documentation. The intention here is to go ahead and land these changes ahead of that since it will likely take some time to land.
…rch64 Copyright (c) 2020, Arm Limited.
This commit also categorizing access as Field, Index, or Subslice. Ideas are taken from `mir::ProjectionElem`. Proposed changes: https://github.com/rust-lang/project-rfc-2229/blob/master/hir-place-target.mdCloses: rust-lang/project-rfc-2229#1, rust-lang/project-rfc-2229#2 Co-authored-by: Aman Arora <me@aman-arora.com> Co-authored-by: Chris Pardy <chrispardy36@gmail.com> Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
Fixesrust-lang#72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.
As rustc is permanently unstable. So marking every items with unstable is essential useless.
to avoid surprising listed in API guidelines.
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()]`
- Explicitly check for missing docs - Don't run any lints except those we explicitly specified
- 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
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
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.Just use a boolean instead.
…, r=nikomatsakis Make hir ProjectionKind more precise This commit also categorizing access as Field, Index, or Subslice. Ideas are taken from `mir::ProjectionElem`. Proposed changes: https://github.com/rust-lang/project-rfc-2229/blob/master/hir-place-target.mdCloses: rust-lang/project-rfc-2229#1, Closes: rust-lang/project-rfc-2229#2 r? @nikomatsakis@matthewjasper
…anishearth Move #[doc(alias)] check in rustc Part of rust-lang#73721. r? @ollie27
forbid generic params in the type of const params implements and closesrust-lang#74152fixesrust-lang#74101, closesrust-lang#71169, fixesrust-lang#73491, closesrust-lang#62878@eddyb and I talked [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/type.20of.20const.20parameters/near/203405696) about this and we probably want to also forbid generic consts in the default type of a parameter, e.g. `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`, this is currently still allowed and I will probably fix that in a followup PR. r? @varkor@eddyb
…akis
Fix 44056 test with debug on macos.
The test `codegen/issue-44056-macos-tls-align.rs` fails on macos if `debug-assertions` is enabled in `config.toml`. It has the following error:
```
/Users/eric/Proj/rust/rust/src/test/codegen/issue-44056-macos-tls-align.rs:9:11: error: CHECK: expected string not found in input
// CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:1:1: note: scanning from here
; ModuleID = 'issue_44056_macos_tls_align.3a1fbbbh-cgu.0'
^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:9:1: note: possible intended match here
@STATIC_VAR_1 = thread_local global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
^
```
Comparing the output, the actual output is missing the text "`local_unnamed_addr`".
The fix here is to ignore `local_unnamed_addr`, as it doesn't seem relevant to the test.Don't panic if the lhs of a div by zero is not statically known Fixesrust-lang#73993 for real this time r? @wesleywiser
…debar, r=kinnison Focus on the current file in the source file sidebar Fixesrust-lang#73360. r? @kinnison cc @rust-lang/rustdoc
…er-warns, r=Mark-Simulacrum Do not render unstable items for rustc doc See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782 Before:  After:  Nothing changes in unstable items of std: Before:  After:  Closesrust-lang#54682
…eGomez rustdoc: Rename internal API fns to `into_string` to avoid surprising listed in API guidelines.
… r=pietroalbini Add RISC-V GNU/Linux to src/tools/build-manifest as a host platform Missed during rust-lang#72973
Fix typo in std::mem::transmute documentation `u32::from_ge_bytes` function does not exist; replace with `u32::from_be_bytes`. It is clear that `u32::from_le_bytes` is not meant from the context; the latter is used correctly while `from_be_bytes` is misspelled.
…lacrum BtreeMap: superficially refactor root access Remove or comment every unwrap in BTreeMap's main code and more. r? @Mark-Simulacrum
const generics triage I went through all const generics issues and closed all issues which are already fixed. Some issues already have a regression test but were not closed. Also doing this as part of this PR. uff r? @eddyb@varkorclosesrust-lang#61936closesrust-lang#62878closesrust-lang#63695closesrust-lang#67144closesrust-lang#68596closesrust-lang#69816closesrust-lang#70217closesrust-lang#70507closesrust-lang#70586closesrust-lang#71348closesrust-lang#71805closesrust-lang#73120closesrust-lang#73508closesrust-lang#73730closesrust-lang#74255
Fix typo in the latest release note
Manishearth
commented
Jul 16, 2020
MemberAuthor
bors
commented
Jul 16, 2020
Collaborator
📌 Commit cabbca7 has been approved by |
bors
commented
Jul 16, 2020
Collaborator
🌲 The tree is currently closed for pull requests below priority 5, this pull request will be tested once the tree is reopened |
bors
commented
Jul 16, 2020
Collaborator
⌛ Testing commit cabbca7 with merge 3e11ffaacb0e32680188763e78a5eddf4c79b640... |
Member
Same error as #74401 |
bors
commented
Jul 16, 2020
Collaborator
💔 Test failed - checks-actions |
jyn514
commented
Jul 16, 2020
Member
cc @rust-lang/infra - this doesn't look related to the rollup, nothing modified |
Manishearth
commented
Jul 16, 2020
MemberAuthor
Confirmed, it failed in #73566 (comment) too. I bet something in GHA changed |
tesuji
commented
Jul 16, 2020
Contributor
Manishearth
commented
Jul 16, 2020
MemberAuthor
@lzutao doesn't m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
everybody_loopsfor rustdoc; instead ignore resolution errors #73566 (Don't runeverybody_loopsfor rustdoc; instead ignore resolution errors)ignore-stage1annotations. #73981 (Remove someignore-stage1annotations.)into_string#74359 (rustdoc: Rename internal API fns tointo_string)Failed merges:
r? @ghost