Skip to content
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

Rollup of 10 pull requests #80078

Closed
wants to merge 28 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Tunahan Karlibas and others added 28 commits December 9, 2020 01:17
This will make rustdoc behave properly when -Dwarnings is given
Take into account negative impls in "trait item not found" suggestions

This removes the suggestion to implement a trait for a type when that type already has a negative implementation for the trait, and replaces it with a note to point out that the trait is explicitely unimplemented, as suggested by `@scottmcm.`

Helps with rust-lang#79683.

r? `@scottmcm` do you want to review this?
…r=jyn514

Declare a new lint to properly deny warnings in rustdoc

This declares a new lint: `INVALID_RUST_CODEBLOCK` that is used by `rustdoc` to properly follow `-D warnings` instead of unconditionally emitting a warning.

## Todo List

- [x] Declare lint.
- [x] Document lint (file: `src/doc/rustdoc/src/lints.md`).
- [x] Use lint in `rustdoc` (file: `src/librustdoc/passes/check_code_block_syntax.rs`, maybe others).
- [x] Write tests.
  - [x] Note: one for the behaviour of the new lint when the error is in a dependency, not the crate being tested (rust-lang#79816 (comment))
- [x] Refactor things.

## Questions

- How/where are lints tested ?
- Where are lints for `rustdoc` tested ?

Fix rust-lang#79792.

`@rustbot` label T-rustdoc A-lint
Remove memoization leftovers from constant evaluation machine

Closes rust-lang#79667
Fix issue rust-lang#78496

EarlyOtherwiseBranch finds MIR structures like:

```
bb0: {
  ...
  _2 = discriminant(X)
  ...
  switchInt(_2) -> [1_isize: bb1, otherwise: bb3]
}
bb1: {
  ...
  _3 = discriminant(Y)
  ...
  switchInt(_3) -> [1_isize: bb2, otherwise: bb3]
}
bb2: {...}
bb3: {...}
```

And transforms them into something like:

```
bb0: {
  ...
  _2 = discriminant(X)
  _3 = discriminant(Y)
  _4 = Eq(_2, _3)
  switchInt(_4) -> [true: bb4, otherwise: bb3]
}
bb2: {...} // unchanged
bb3: {...} // unchanged
bb4: {
  switchInt(_2) -> [1_isize: bb2, otherwise: bb3]
}
```

But that is not always a safe thing to do -- sometimes the early `otherwise` branch is necessary so the later block could assume the value of `discriminant(X)`.

I am not totally sure what's the best way to detect that, but fixing rust-lang#78496 should be easy -- we just check if `X` is a sub-expression of `Y`. A more precise test might be to check if `Y` contains a `Downcast(1)` of `X`, but I think this might be good enough.

Fix rust-lang#78496
…ikomatsakis

Move binder for dyn to each list item

This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`.

This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in ````@rust-lang/wg-traits.````

r? ````@nikomatsakis````
…on-panic, r=dtolnay

Fix overflow when converting ZST Vec to VecDeque

```rust
let v = vec![(); 100];
let queue = VecDeque::from(v);
println!("{:?}", queue);
```
This code will currently panic with a capacity overflow.
This PR resolves this issue and makes the code run fine.

Resolves rust-lang#78532
…ulacrum

BTreeMap: more expressive local variables in merge

r? ````@Mark-Simulacrum````
…ulacrum

BTreeSet: simplify implementation of pop_first/pop_last

…and stop it interfering in rust-lang#79245.
r? ````@Mark-Simulacrum````
…Mark-Simulacrum

expand-yaml-anchors: Make the output directory separator-insensitive

Fixes rust-lang#75709
@rustbot rustbot added the rollup A PR which is a rollup label Dec 16, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Dec 16, 2020

📌 Commit 7c61d6a has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 16, 2020
@bors
Copy link
Contributor

bors commented Dec 16, 2020

⌛ Testing commit 7c61d6a with merge c6b3c5b30cf7678a6a3e8f7c7fdc21c91753f9f5...

@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-linux of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
48 | |     /// //          ^^^ This is the span we are looking for!
49 | |     /// ```
   | |___________^
   |
   = note: `-D invalid-rust-codeblock` implied by `-D warnings`

error: aborting due to previous error

error: could not document `rustc_trait_selection`
error: could not document `rustc_trait_selection`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2018 --crate-type lib --crate-name rustc_trait_selection compiler/rustc_trait_selection/src/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/release/deps --extern rustc_ast=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_ast-af8907c51d0619b2.rmeta --extern rustc_attr=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_attr-2f11728d63006441.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-900d11de835d34e6.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-1aabeb89ce38e926.rmeta --extern rustc_hir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_hir-782d95bf352570dd.rmeta --extern rustc_index=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_index-984047fbd60b0386.rmeta --extern rustc_infer=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_infer-01d356349ffa8afd.rmeta --extern rustc_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/release/deps/librustc_macros-5f0ec4a119c6ac86.so --extern rustc_middle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_middle-fc5655365d5ee0f8.rmeta --extern rustc_parse_format=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_parse_format-916525696df77022.rmeta --extern rustc_session=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_session-b88d46fe3041e688.rmeta --extern rustc_span=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-3f54fec704da7e59.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-a7d4facd2979b981.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-e1ca8c1925105298.rmeta --extern tracing=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/deps/libtracing-166f52f5b1e92350.rmeta -Dwarnings -Winvalid_codeblock_attributes --crate-version '1.50.0-nightly
  (c6b3c5b30
  2020-12-16)' --document-private-items --enable-index-page -Zunstable-options -Znormalize-docs` (exit code: 1)
[RUSTC-TIMING] rustc_codegen_llvm test:false 4.136
[RUSTC-TIMING] rustc_trait_selection test:false 5.431
error: build failed



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--locked" "--color" "always" "--features" "jemalloc llvm max_level_info" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "--no-deps" "-p" "rustc_span" "-p" "rustc_symbol_mangling" "-p" "rustc_metadata" "-p" "rustc_passes" "-p" "rustc_query_system" "-p" "rustc_plugin_impl" "-p" "coverage_test_macros" "-p" "rustc_traits" "-p" "rustc_mir_build" "-p" "rustc_macros" "-p" "rustc_privacy" "-p" "rustc_codegen_llvm" "-p" "rustc_graphviz" "-p" "rustc_interface" "-p" "rustc_ast_passes" "-p" "rustc_incremental" "-p" "rustc_fs_util" "-p" "rustc_middle" "-p" "rustc_builtin_macros" "-p" "rustc_error_codes" "-p" "rustc_infer" "-p" "rustc_llvm" "-p" "rustc_errors" "-p" "rustc_data_structures" "-p" "rustc_codegen_ssa" "-p" "rustc_parse" "-p" "rustc_lint" "-p" "rustc_serialize" "-p" "rustc_apfloat" "-p" "rustc_driver" "-p" "rustc_target" "-p" "rustc_arena" "-p" "rustc_save_analysis" "-p" "rustc_ast" "-p" "rustc_lexer" "-p" "rustc_type_ir" "-p" "rustc_hir_pretty" "-p" "rustc_index" "-p" "rustc_attr" "-p" "rustc_typeck" "-p" "rustc_hir" "-p" "rustc_session" "-p" "rustc_trait_selection" "-p" "rustc_parse_format" "-p" "rustc_ast_pretty" "-p" "rustc_ast_lowering" "-p" "rustc_lint_defs" "-p" "rustc_mir" "-p" "rustc_ty_utils" "-p" "rustc_feature" "-p" "rustc_resolve" "-p" "rustc_expand"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --include-default-paths src/tools/build-manifest
Build completed unsuccessfully in 0:24:00

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Dec 16, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 16, 2020
@bors
Copy link
Contributor

bors commented Dec 17, 2020

☔ The latest upstream changes (presumably #79790) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@jyn514
Copy link
Member

jyn514 commented Dec 21, 2020

Most of these were merged.

@jyn514 jyn514 closed this Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.