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 7 pull requests #91157

Closed
wants to merge 171 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Michael Wright and others added 30 commits November 1, 2021 06:12
…, r=flip1995

Reference `clippy_utils` docs on nightly-rustc and some other documentation updates

The `clippy_utils` crate is now part of the nightly-rustc documentation. See [**very beautiful documentation**](https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/). This PR references them in our documentation and updates some other documentation.

changelog: none
Fix false negative in [`match_overlapping_arms`]

changelog: Fix false negative in [`match_overlapping_arms`]
Replace `in_macro` usage with `from_expansion`

changelog: none

Generally replace `in_macro(span)` with `span.from_expansion()`. If we're just trying to avoid expanded code, this seems more appropriate because any kind of expanded code is prone to false positives. One place I did not touch is `macro_use.rs`. I think this lint could use a rewrite so I moved `in_macro` there, the only place it is still used.
…shearth

Remove rustfmt::skip attribute from register_plugins function

r? `@Manishearth` since you added this in rust-lang#540 😄

changelog: none
I found the manual run command really useful, this makes it a bit easier
to type
…effen

Extend author lint

changelog: none

* Print float and int suffixes
* Print labels
* Struct field checks
* Repeat length expression check
* Destructure method calls
* Destructure closures
Add `cargo dev lint` to manually run clippy on a file

I found the manual run command really useful, this makes it a bit easier to type

Not sure if this belongs in the changelog or not

changelog: Add `cargo dev lint` to manually run clippy on a file
TraitKind -> Trait
TyAliasKind -> TyAlias
ImplKind -> Impl
FnKind -> Fn

All `*Kind`s in AST are supposed to be enums.

Tuple structs are converted to braced structs for the types above, and fields are reordered in syntactic order.

Also, mutable AST visitor now correctly visit spans in defaultness, unsafety, impl polarity and constness.
The only reason to use `abort_if_errors` is when the program is so broken that either:
1. later passes get confused and ICE
2. any diagnostics from later passes would be noise

This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints.
So it can continue to lint and compile even if there are lint errors.
Fix ICE in undocumented_unsafe_blocks

changelog: Fix ICE in [`undocumented_unsafe_blocks`]

closes: rust-lang#7934
Introduce `expr_visitor` and `expr_visitor_no_bodies`

changelog: none

A couple utils that satisfy a *lot* of visitor use cases. Factoring in every possible usage would be really big so I just focused on cleaning clippy_utils.
dswij and others added 16 commits November 23, 2021 10:11
Fix FP on `if_then_some_else_none` when there is early return

closes rust-lang#7870

changelog: [`if_then_some_else_none`] now does not fire when there is early return
Rustup

Re-sync, because I didn't get to syncing things back to rustc.

r? `@ghost`

changelog: none
Make `intrinsics::write_bytes` const

This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.

Tracking issue: rust-lang#86302
…, r=Manishearth,GuillaumeGomez

Inhibit clicks on summary's children

A byproduct of using `<details>` and `<summary>` to show/hide detailed documentation was that clicking any part of a method heading (or impl heading) would show or hide the documentation. This was not super noticeable because clicking a link inside the method heading would navigate to that link. But clicking any unlinked black text in a method heading would trigger the behavior.

That behavior was somewhat unexpected, and means that if you try to click a type name in a method heading, but miss by a few pixels, you get a confusing surprise.

This change inhibits that behavior by putting an event listener on most summaries that cancels the event unless the event target was the summary itself. In practice, that means it cancels the event unless the target was the "[+]" / "[-]", because the rest of the heading is wrapped inside a `<div>`, which is the target for anything that doesn't have a more specific target.

r? `@Manishearth`
Give people a single link they can click in the contributing guide

Doc Jones mentioned that one of the things making it hard to get started
is that the amount of information is overwhelming, between the
dev-guide, contributing guide, and discussion platforms. This gives
people a single link they can click to ask for help.

cc `@doc-jones` - is this what you had in mind?
Split inline const to two feature gates and mark expression position inline const complete

This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete.

I think I have resolved most outstanding issues related to `inline_const` with rust-lang#89561 and other PRs. The only thing left that I am aware of is rust-lang#90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in rust-lang#89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another.

`@rustbot` label: T-compiler F-inline_const
…enkov

Use `derive_default_enum` in the compiler

Let's get this feature some real-world love.

`@rustbot` label: +C-cleanup +S-waiting-on-review
Update Clippy

r? `@Manishearth`

Delayed Clippy sync. I didn't get to it over the weekend..
@rustbot rustbot added the rollup A PR which is a rollup label Nov 23, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Nov 23, 2021

📌 Commit c9ce710 has been approved by matthiaskrgr

@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 Nov 23, 2021
@bors
Copy link
Contributor

bors commented Nov 23, 2021

⌛ Testing commit c9ce710 with merge 85bf916647702f16f9a15a891d530ae1787c6530...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    |
note: function defined here
   --> /checkout/src/tools/clippy/clippy_lints/src/lib.rs:414:8
    |
414 | pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) {

For more information about this error, try `rustc --explain E0061`.
[RUSTC-TIMING] rls_rustc test:false 0.447
error: could not compile `rls-rustc` due to previous error
---
test [compile-fail] compile-fail/modifying_constants.rs ... ok

error: failure produced the wrong error: exit status: 101
status: exit status: 101
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/miri" "tests/compile-fail/intrinsics/write_bytes_overflow.rs" "-L" "/tmp/compiletestfeWSAL" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/tmp/compiletestfeWSAL/intrinsics/write_bytes_overflow.stage-id" "-A" "unused" "--edition" "2018" "-Astable-features" "--sysroot" "/home/user/.cache/miri/HOST" "-L" "/tmp/compiletestfeWSAL/intrinsics/write_bytes_overflow.stage-id.aux"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
thread 'rustc' panicked at 'Size::mul: 4 * 9223372036854775808 doesn't fit in u64', /checkout/compiler/rustc_target/src/abi/mod.rs:449:21
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   1: core::panicking::panic_fmt
   2: <rustc_target::abi::Size as core::ops::arith::Mul<u64>>::mul
   3: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator>>::write_bytes_intrinsic
   4: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator>>::emulate_intrinsic
   5: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator> as miri::shims::intrinsics::EvalContextExt>::call_intrinsic
   6: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator>>::eval_fn_call
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::Evaluator>>::terminator
   8: miri::eval::eval_entry
   9: <rustc_interface::passes::QueryContext>::enter::<<miri::MiriCompilerCalls as rustc_driver::Callbacks>::after_analysis::{closure#0}, ()>
  10: <miri::MiriCompilerCalls as rustc_driver::Callbacks>::after_analysis
  11: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorReported>>
  12: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  13: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>
  14: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.
---
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s


running 1 test
test [ui] ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s


running 1 test
---
.......... (50/53)
..        (53/53)


/checkout/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml search-tab-selection-if-current-is-empty... FAILED
[ERROR] (line 4) TimeoutError: waiting for selector "#titles" failed: timeout 30000ms exceeded: for command `// Waiting for the search results to appear...
wait-for: "#titles"`



command did not execute successfully: "/node-v14.4.0-linux-x64/bin/node" "/checkout/src/tools/rustdoc-gui/tester.js" "--jobs" "16" "--doc-folder" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc" "--tests-folder" "/checkout/src/test/rustdoc-gui"


Build completed unsuccessfully in 0:00:45

@bors
Copy link
Contributor

bors commented Nov 23, 2021

💔 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 Nov 23, 2021
@matthiaskrgr
Copy link
Member Author

Hmm, kinda hard to say what causes the problem here :/

@lilasta
Copy link
Contributor

lilasta commented Nov 24, 2021

I'm sorry, it might be my PR (#90081)... I've committed the fix now.

@matthiaskrgr matthiaskrgr deleted the rollup-uj56mdm branch November 25, 2021 19:49
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.