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

Update Clippy #111255

Merged
merged 138 commits into from
May 6, 2023
Merged

Update Clippy #111255

merged 138 commits into from
May 6, 2023

Commits on Mar 22, 2023

  1. Merge from rustc

    RalfJung committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    8889587 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2023

  1. Merge from rustc

    oli-obk committed Mar 23, 2023
    Configuration menu
    Copy the full SHA
    95bb486 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2023

  1. Merge from rustc

    RalfJung committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    b6495af View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2023

  1. Merge from rustc

    oli-obk committed Apr 4, 2023
    Configuration menu
    Copy the full SHA
    a937f49 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2023

  1. Configuration menu
    Copy the full SHA
    f5ac844 View commit details
    Browse the repository at this point in the history
  2. Fix tools

    nbdd0121 committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    293c1a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0963a66 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2023

  1. Auto merge of rust-lang#110031 - compiler-errors:generic-elaboration,…

    … r=b-naber
    
    Make elaboration generic over input
    
    Combines all the `elaborate_*` family of functions into just one, which is an iterator over the same type that you pass in (e.g. elaborating `Predicate` gives `Predicate`s, elaborating `Obligation`s gives `Obligation`s, etc.)
    bors committed Apr 9, 2023
    Configuration menu
    Copy the full SHA
    d048c11 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2023

  1. Merge from rustc

    saethlin committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    fe129a0 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2023

  1. Configuration menu
    Copy the full SHA
    6b95029 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2023

  1. resolve: Pre-compute non-reexport module children

    Instead of repeating the same logic by walking HIR during metadata encoding.
    
    The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list.
    They can be encoded separately if this need ever arises.
    
    `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
    petrochenkov committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    5989400 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a0fb90 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4680aa2 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2023

  1. Auto merge of rust-lang#110160 - petrochenkov:notagain2, r=cjgillot

    resolve: Pre-compute non-reexport module children
    
    Instead of repeating the same logic by walking HIR during metadata encoding.
    
    The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises.
    
    `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
    bors committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    d61570c View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2023

  1. Alloc hir::Lit in an arena to remove the destructor from Expr

    This allows allocating `Expr`s into a dropless arena, which is useful
    for using length prefixed thing slices in HIR, since these can only be
    allocated in the dropless arena and not in a typed arena. This is
    something I'm working on.
    Noratrieb committed Apr 16, 2023
    Configuration menu
    Copy the full SHA
    8f53926 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2023

  1. Configuration menu
    Copy the full SHA
    0a81f82 View commit details
    Browse the repository at this point in the history
  2. make cargo test pass

    Centri3 committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    dfccebe View commit details
    Browse the repository at this point in the history
  3. refactor

    Centri3 committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    a7c3301 View commit details
    Browse the repository at this point in the history
  4. make cargo test pass, again

    Centri3 committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    a57445d View commit details
    Browse the repository at this point in the history
  5. improve description a bit

    Centri3 committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    80707aa View commit details
    Browse the repository at this point in the history
  6. Merge from rustc

    oli-obk committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    f85928f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    89f0aaa View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2023

  1. refactor

    Centri3 committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    fa1efa8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ebfbc5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1dfc231 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. Auto merge of rust-lang#110496 - WaffleLapkin:🏳️‍⚧️sound, r=compiler-…

    …errors
    
    Don't transmute `&List<GenericArg>` <-> `&List<Ty>`
    
    In rust-lang#93505 we allowed safely transmuting between `&List<GenericArg<'_>>` and `&List<Ty<'_>>`. This was possible because `GenericArg` is a tagged pointer and the tag for types is `0b00`, such that a `GenericArg` with a type inside has the same layout as `Ty`.
    
    While this was meant as an optimization, it doesn't look like it was actually any perf or max-rss win (see rust-lang#94799 (comment), rust-lang#94841, rust-lang#110496 (comment)).
    
    Additionally the way it was done is quite fragile — `unsafe` code was not properly documented or contained in a module, types were not marked as `repr(C)` (making the transmutes possibly unsound). All of this makes the code maintenance harder and blocks other possible optimizations (as an example I've found out about these `transmutes` when my change caused them to sigsegv compiler).
    
    Thus, I think we can safely (pun intended) remove those transmutes, making maintenance easier, optimizations possible, code less cursed, etc.
    
    r? `@compiler-errors`
    bors committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    d3b1001 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2745c87 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. Configuration menu
    Copy the full SHA
    a3aeec4 View commit details
    Browse the repository at this point in the history
  2. make cargo test pass

    Centri3 committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    41f6d88 View commit details
    Browse the repository at this point in the history
  3. Remove WithOptconstParam.

    cjgillot committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    8ead58c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    afa28e6 View commit details
    Browse the repository at this point in the history
  5. add EarlyBinder to output of explicit_item_bounds; replace bound_expl…

    …icit_item_bounds usages; remove bound_explicit_item_bounds query
    kylematsuda committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    097309c View commit details
    Browse the repository at this point in the history
  6. add subst_identity_iter and subst_identity_iter_copied methods on Ear…

    …lyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
    kylematsuda committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    55d8146 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    654d12f View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#109999 - m-ou-se:flatten-format-args, r=oli-obk

    Enable flatten-format-args by default.
    
    Part of rust-lang#99012.
    
    This enables the `flatten-format-args` feature that was added by rust-lang#106824:
    
    > This change inlines string literals, integer literals and nested format_args!() into format_args!() during ast lowering, making all of the following pairs result in equivalent hir:
    >
    > ```rust
    > println!("Hello, {}!", "World");
    > println!("Hello, World!");
    > ```
    >
    > ```rust
    > println!("[info] {}", format_args!("error"));
    > println!("[info] error");
    > ```
    >
    > ```rust
    > println!("[{}] {}", status, format_args!("error: {}", msg));
    > println!("[{}] error: {}", status, msg);
    > ```
    >
    > ```rust
    > println!("{} + {} = {}", 1, 2, 1 + 2);
    > println!("1 + 2 = {}", 1 + 2);
    > ```
    >
    > And so on.
    >
    > This is useful for macros. E.g. a `log::info!()` macro could just pass the tokens from the user directly into a `format_args!()` that gets efficiently flattened/inlined into a `format_args!("info: {}")`.
    >
    > It also means that `dbg!(x)` will have its file, line, and expression name inlined:
    >
    > ```rust
    > eprintln!("[{}:{}] {} = {:#?}", file!(), line!(), stringify!(x), x); // before
    > eprintln!("[example.rs:1] x = {:#?}", x); // after
    > ```
    >
    > Which can be nice in some cases, but also means a lot more unique static strings than before if dbg!() is used a lot.
    
    This is mostly an optimization, except that it will be visible through [`fmt::Arguments::as_str()`](https://doc.rust-lang.org/nightly/std/fmt/struct.Arguments.html#method.as_str).
    
    In rust-lang#106823, there was already a libs-api FCP about the documentation of `fmt::Arguments::as_str()` to allow it to give `Some` rather than `None` depending on optimizations like this. That was just a documentation update though. This PR is the one that actually makes the user visible change:
    
    ```rust
    assert_eq!(format_args!("abc").as_str(), Some("abc")); // Unchanged.
    assert_eq!(format_args!("ab{}", "c").as_str(), Some("abc")); // Was `None` before!
    ```
    bors committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    e8197b1 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. Auto merge of rust-lang#96840 - cjgillot:query-feed, r=oli-obk

    Allow to feed a value in another query's cache and remove `WithOptConstParam`
    
    I used it to remove `WithOptConstParam` queries, as an example.
    
    The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`.
    
    There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle.  The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`.
    
    When replayed, we may the following cases:
    - `typeck` is green, in that case `type_of` is green too, and all is right;
    - `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash;
    - `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`.
    
    As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly.
    
    There is an open question about loading from the on-disk cache.  If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour.
    
    I specifically allowed to feed the value to `type_of` from inside a call to `type_of`.  In that case, the dep-graph will check that the fingerprints of both values match.
    
    This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`.  The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`.  The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
    bors committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    84bab31 View commit details
    Browse the repository at this point in the history
  2. offset_of

    beepster4096 committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    68c4776 View commit details
    Browse the repository at this point in the history
  3. fix false positive

    Centri3 committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    85d7de2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb3e0fb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7f13e6d View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2023

  1. Auto merge of rust-lang#106934 - DrMeepster:offset_of, r=WaffleLapkin

    Add offset_of! macro (RFC 3308)
    
    Implements rust-lang/rfcs#3308 (tracking issue rust-lang#106655) by adding the built in macro `core::mem::offset_of`. Two of the future possibilities are also implemented:
    
    * Nested field accesses (without array indexing)
    * DST support (for `Sized` fields)
    
    I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it.
    
    cc `@thomcc` (RFC author)
    bors committed Apr 22, 2023
    Configuration menu
    Copy the full SHA
    86d8f12 View commit details
    Browse the repository at this point in the history
  2. Merge from rustc

    RalfJung committed Apr 22, 2023
    Configuration menu
    Copy the full SHA
    a43708a View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#104844 - cjgillot:mention-eval-place, r=jackh…

    …726,RalfJung
    
    Evaluate place expression in `PlaceMention`
    
    rust-lang#102256 introduces a `PlaceMention(place)` MIR statement which keep trace of `let _ = place` statements from surface rust, but without semantics.
    
    This PR proposes to change the behaviour of `let _ =` patterns with respect to the borrow-checker to verify that the bound place is live.
    
    Specifically, consider this code:
    ```rust
    let _ = {
        let a = 5;
        &a
    };
    ```
    
    This passes borrowck without error on stable. Meanwhile, replacing `_` by `_: _` or `_p` errors with "error[E0597]: `a` does not live long enough", [see playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c448d25a7c205dc95a0967fe96bccce8).
    
    This PR *does not* change how `_` patterns behave with respect to initializedness: it remains ok to bind a moved-from place to `_`.
    
    The relevant test is `tests/ui/borrowck/let_underscore_temporary.rs`. Crater check found no regression.
    
    For consistency, this PR changes miri to evaluate the place found in `PlaceMention`, and report eventual dangling pointers found within it.
    
    r? `@RalfJung`
    bors committed Apr 22, 2023
    Configuration menu
    Copy the full SHA
    f30fc0a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    628605e View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2023

  1. Configuration menu
    Copy the full SHA
    583c97e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0add5bb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d5a2c2b View commit details
    Browse the repository at this point in the history
  4. Fix dogfood test

    flip1995 committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    36bf3ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    acf50a7 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#10703 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    f16bfa4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a1b75c5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    69da902 View commit details
    Browse the repository at this point in the history
  9. split test into 2

    matthiaskrgr committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    572eecd View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#10670 - lukaslueg:issue10634, r=Jarcho

    Don't suggest `suboptimal_flops` unavailable in nostd
    
    Fixes rust-lang#10634
    
    changelog: Enhancement: [`suboptimal_flops`]: Do not suggest `{f32,f64}::abs()` or `{f32,f64}::mul_add()` in a `no_std`-environment.
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    316d83a View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#10679 - y21:better-const-ctx-check, r=Jarcho

    use `is_inside_const_context` for `in_constant` util fn
    
    Fixes rust-lang#10452.
    
    This PR improves the `in_constant` util function to detect more cases of const contexts. Previously this function would not detect cases like expressions in array length position or expression in an inline const block `const { .. }`.
    
    changelog: [`bool_to_int_with_if`]: recognize array length operand as being in a const context and don't suggest `usize::from` there
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    496c110 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#108118 - oli-obk:lazy_typeck, r=cjgillot

    Run various queries from other queries instead of explicitly in phases
    
    These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps.
    
    This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    4ed4869 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#10704 - matthiaskrgr:splitest, r=llogiq

    split test into 2
    
    changelog: none
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    e1f6305 View commit details
    Browse the repository at this point in the history
  14. Remove check for lib.register_* and src/docs* in `cargo dev updat…

    …e_lints`
    
    This reverts commit 22d435b.
    Alexendoo committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    022baa5 View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#10706 - Alexendoo:remove-old-generated-files-…

    …check, r=llogiq
    
    Remove check for `lib.register_*` and `src/docs*` in `cargo dev update_lints`
    
    The transition period has well passed
    
    changelog: none
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    797a7fe View commit details
    Browse the repository at this point in the history
  16. Spelling

    * applying
    * binding
    * complex
    * constituent
    * demonstrate
    * desugaring
    * exact
    * expression
    * for
    * functionalities
    * github
    * implementation
    * infers
    * multiple conflicting traits
    * mutable
    * necessarily
    * nightly
    * nonexistent
    * optional
    * parameter
    * reassignments
    * resources
    * substitution
    * suggestion
    * that
    * that array is
    * using the
    
    Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
    jsoref committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    d2061fa View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6f7801f View commit details
    Browse the repository at this point in the history
  18. Auto merge of rust-lang#10432 - samueltardieu:issue-10430, r=Manishearth

    New lint: detect `if` expressions with simple boolean assignments to the same target
    
    Closes rust-lang#10430
    
    changelog: [`needless_bool_assign`] new lint to detect simple boolean assignment to the same target in `if` branches
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    7a870ae View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e8726b2 View commit details
    Browse the repository at this point in the history
  20. Auto merge of rust-lang#10649 - jsoref:spelling, r=Jarcho

    Spelling
    
    This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).
    
    The misspellings have been reported at https://github.com/jsoref/rust-clippy/actions/runs/4710771873#summary-12776860721
    
    The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-clippy/actions/runs/4710771874#summary-12776860722
    
    changelog: none
    bors committed Apr 23, 2023
    Configuration menu
    Copy the full SHA
    96f8471 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2023

  1. Auto merge of rust-lang#10697 - lochetti:fix_9757, r=dswij

    Ignore `shadow` warns in code from macro expansions
    
    This PR fixes rust-lang/rust-clippy#9757
    
    I am in doubt if just looking for `pat.span.from_expansion()` would be sufficient instead of looking for both `pat.span.desugaring_kind().is_some()` or `pat.span.from_expansion()`. The tests (including the new one) passes if I leave the only `if pat.span.from_expansion()`. Any feedbacks?
    
    Also, this is my first PR here, sorry for anything and thanks for the patience!
    
    changelog: [`shadow_same`, `shadow_reuse`, `shadow_unrelated`]: avoiding warns in macro-generated code
    bors committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    5161c4c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c859b6 View commit details
    Browse the repository at this point in the history
  3. Merge from rustc

    RalfJung committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    26f9fce View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3045998 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#10683 - Centri3:allow-attributes, r=Alexendoo

    Fix false positive in `allow_attributes`
    
    This would emit a warning if used in a proc-macro with the feature `lint_reasons` enabled. This is now fixed.
    
    changelog: [`allow_attributes`]: Don't lint if in external macro
    bors committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    4b6fdb4 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#10707 - y21:redudant_pattern_matching_rest_pa…

    …t, r=Manishearth
    
    check for `..` pattern in `redundant_pattern_matching`
    
    The `redundant_pattern_matching` lint currently checks for `if let Some(_) = ...`, but not for `if let Some(..) = ...`.
    This PR makes sure to also check for the `..` pattern in tuple structs.
    It also found one such instance in clippy itself so that shows it's worth checking for this pattern as well 😅
    
    changelog: [`redundant_pattern_matching`]: check for `..` pattern in tuple structs
    bors committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    30db6ed View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#10702 - blyxyas:fix-let_underscore_untyped_he…

    …lp_message, r=Manishearth
    
    Improve the help message + add a help span
    
    This would close rust-lang#10410, because it applies the general consensus achieved in that issue (that replacing `let _ = ...` to `_ = ...` doesn't present any benefits).
    
    I also added a little help message span.
    
    changelog:[`let_underscore_untyped`]: Fix the help message confusion + add a help message span.
    bors committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    c4f2c48 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#110718 - flip1995:clippyup, r=Manishearth

    Update Clippy
    
    r? `@Manishearth`
    
    A few days late, I was on a business trip, sorry.
    bors committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    5514d9f View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2023

  1. Configuration menu
    Copy the full SHA
    4a76b6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    acfb2c4 View commit details
    Browse the repository at this point in the history
  3. run cargo dev fmt

    Centri3 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    8efe9ff View commit details
    Browse the repository at this point in the history
  4. make cargo test pass

    Centri3 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    1ac30d3 View commit details
    Browse the repository at this point in the history
  5. use in_external_macro

    Centri3 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    14a6fa4 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#10665 - Centri3:string_lit_as_bytes_changes, …

    …r=giraffate
    
    Don't apply `string_lit_as_bytes` if in macro expansion
    
    The following code will emit a warning on both w! and h!, despite there being nothing the user (or library author) could do about it:
    ```rust
    #![warn(clippy::string_lit_as_bytes)]
    
    use windows::w;
    use windows::h;
    
    fn main() {
        let _w = w!("example");
        let _h = h!("example");
    }
    ```
    This is because windows-rs will create a binding `const INPUT: &[u8] = $s.as_bytes()`, and changing this to b"$s" is, well, suboptimal. I don't know enough about Rust to know if this is something that can be detected though if it can be I'm happy with closing this in favor of implementing that.
    
    I'm not sure whether this is how it should be done though, as this simply tells clippy to not invoke this even if it's applicable (this also affects the other string lints, but didn't cause any tests to fail).
    
    changelog: [`string_lit_as_bytes`]: Don't lint if in external macro
    bors committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    abd2c1e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    637d10b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    aa6c27a View commit details
    Browse the repository at this point in the history
  9. use //@ for commands in tests

    Centri3 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    e3ee10d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9cf9642 View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#10715 - xFrednet:changelog-1-69, r=llogiq

    Catching, stray, commas, (I'll, never, learn, to, use, them, correctly)  😅
    
    Roses are red,
    Violets are blue,
    Fixing commas,
    Is the completed todo.
    
    (It's always impressive, that the poems are getting worse)
    
    ---
    
    Follow-up from: rust-lang/rust-clippy#10668
    
    changelog: none
    bors committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    19465c9 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#10712 - blyxyas:fix-fixflag_implies_all_targe…

    …ts, r=llogiq
    
    Document that `cargo clippy --fix` implies `--all-targets`
    
    In [`cargo fix`'s documentation](https://doc.rust-lang.org/cargo/commands/cargo-fix.html) they indicate that `fix` implies `--all-targets` if no target is supplied. As Clippy uses Cargo under the hood, this also applies to Clippy, but we didn't document that behaviour.
    
    This PR changes that
    
    Fixes rust-lang#10690
    changelog: Add to documentation that `--fix` implies `--all-targets`
    bors committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    a7335cb View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#110556 - kylematsuda:earlybinder-explicit-i…

    …tem-bounds, r=compiler-errors
    
    Switch to `EarlyBinder` for `explicit_item_bounds`
    
    Part of the work to finish rust-lang#105779.
    
    This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`.
    
    r? `@compiler-errors` (hope it's okay to request you, since you reviewed rust-lang#110299 and rust-lang#110498 😃)
    matthiaskrgr authored Apr 25, 2023
    Configuration menu
    Copy the full SHA
    331c547 View commit details
    Browse the repository at this point in the history
  14. Update lint_configuration.md

    Centri3 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    8c8cf40 View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#10656 - Centri3:master, r=xFrednet

    Add configuration for `semicolon_block` lints
    
    Does exactly what it says on the tin, suggests moving a block's final semicolon inside if it's multiline and outside if it's singleline.
    
    I don't really like how this is implemented so I'm not too sure if this is ready yet. Alas, it might be ok.
    
    ---
    
    fixes rust-lang#10654
    
    changelog: Enhancement: [`semicolon_inside_block`]: Added `semicolon-inside-block-ignore-singleline` as a new config value.
    [rust-lang#10656](rust-lang/rust-clippy#10656)
    changelog: Enhancement: [`semicolon_outside_block`]: Added `semicolon-outside-block-ignore-multiline` as a new config value.
    [rust-lang#10656](rust-lang/rust-clippy#10656)
    <!-- changelog_checked -->
    bors committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    990bbdc View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2023

  1. Merge from rustc

    RalfJung committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    92645b0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9564895 View commit details
    Browse the repository at this point in the history
  3. adds lint to detect construction of unit struct using default

    Using `default` to construct a unit struct increases code complexity and
    adds a function call. This can be avoided by simply removing the call to
    `default` and simply construct by name.
    Icxolu committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    9428138 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2023

  1. Configuration menu
    Copy the full SHA
    0339d4e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    273c898 View commit details
    Browse the repository at this point in the history
  3. Make clippy happy

    compiler-errors committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    83504fa View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2023

  1. Merge from rustc

    RalfJung committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    19b3b22 View commit details
    Browse the repository at this point in the history
  2. run linkcheck in Remark CI

    fix new lints link
    
    install nightly rust-docs
    
    run linkcheck without nightly toolchain
    
    remove nightly toolchain, add rust-docs component
    
    Test Remark
    
    Update basics.md
    
    Update basics.md
    
    Update basics.md
    
    update workflow
    
    add rust docs toolchain
    
    Update remark.yml
    
    workflow test
    
    manual test
    
    update book path
    
    add linkcheck book to CI
    
    Update lint_passes.md
    SergenKaraoglan committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    d1f55e6 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#10720 - SergenKaraoglan:personal, r=flip1995

    run linkcheck in clippy ci
    
    fixes rust-lang#10711
    
    changelog: Run [linkcheck.sh](https://github.com/rust-lang/rust/blob/master/src/tools/linkchecker/linkcheck.sh) from rustc repo in Remark.yml to check Clippy book.
    bors committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    b7939f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81a6141 View commit details
    Browse the repository at this point in the history
  5. Remove useless span magic

    blyxyas committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    f37054b View commit details
    Browse the repository at this point in the history
  6. Change module import system

    blyxyas committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    2b5820d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    395b1f5 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#10719 - blyxyas:fix-items_after_test_mod_impo…

    …rted_modules, r=Alexendoo
    
    Fix `items_after_test_module`: Ignore imported modules
    
    Fixes rust-lang#10713. It does a little bit of dark magic, but intention is what really counts.
    changelog:[`items_after_test_module`]: Ignore imported modules (`mod foo;`) with no body.
    bors committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    3594d55 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2023

  1. Configuration menu
    Copy the full SHA
    2ed254e View commit details
    Browse the repository at this point in the history
  2. new lint: while_pop_unwrap

    y21 committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    bb58083 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bcdcc34 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d08325 View commit details
    Browse the repository at this point in the history
  5. remove unnecessary reference

    y21 committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    ab9b7a5 View commit details
    Browse the repository at this point in the history
  6. make PopStmt copy+clone

    y21 committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    f10e39f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8d8178f View commit details
    Browse the repository at this point in the history
  8. fix run-rustfix directive

    y21 committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    9613ea8 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#10647 - y21:while_pop_unwrap, r=llogiq

    new lint: `manual_while_let_some`
    
    This PR implements the lint I suggested [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/lint.20on.20while.20pop.20unwrap).
    It looks for while loops like these:
    ```rs
    let mut numbers = vec![0, 1, 2];
    while !numbers.is_empty() {
      let number = numbers.pop().unwrap();
      // use `number`
    }
    ```
    and suggests replacing it with a while-let loop, like this:
    ```rs
    let mut numbers = vec![0, 1, 2];
    while let Some(number) = numbers.pop() {
      // use `number`
    }
    ```
    ... which is more concise and idiomatic.
    
    It only looks for `Vec::pop()` calls in the first statement of the loop body in an attempt to not trigger FPs (as pop might only be called conditionally).
    
    changelog: new lint [`manual_while_let_some`]
    bors committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    7bc3da9 View commit details
    Browse the repository at this point in the history
  10. fix diagnostic message style

    Co-authored-by: Ruby Lazuli <general@patchmixolydic.com>
    Icxolu and PatchMixolydic authored Apr 29, 2023
    Configuration menu
    Copy the full SHA
    032bc11 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2023

  1. Merge from rustc

    RalfJung committed Apr 30, 2023
    Configuration menu
    Copy the full SHA
    de4bc66 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2023

  1. Configuration menu
    Copy the full SHA
    d4baabe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5749054 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#111036 - RalfJung:miri, r=RalfJung

    update Miri
    
    r? `@ghost`
    bors committed May 1, 2023
    Configuration menu
    Copy the full SHA
    8354b34 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    220a9db View commit details
    Browse the repository at this point in the history

Commits on May 2, 2023

  1. Auto merge of rust-lang#10724 - lukaslueg:largeerrdocs, r=giraffate

    Clarify docs for `RESULT_LARGE_ERR`
    
    Adds a paragraph to address rust-lang/rust-clippy#10211 (comment)
    
    changelog: [`result_large_err`]: Update the document
    bors committed May 2, 2023
    Configuration menu
    Copy the full SHA
    824f2e7 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#110955 - fee1-dead-contrib:sus-operation, r…

    …=compiler-errors
    
    uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`
    
    Split from rust-lang#109842.
    
    r? ``@compiler-errors``
    Dylan-DPC authored May 2, 2023
    Configuration menu
    Copy the full SHA
    eac589b View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#109128 - chenyukang:yukang/remove-type-ascrip…

    …tion, r=estebank
    
    Remove type ascription from parser and diagnostics
    
    Mostly based on rust-lang#106826
    
    Part of rust-lang#101728
    
    r? `@estebank`
    bors committed May 2, 2023
    Configuration menu
    Copy the full SHA
    d36bde7 View commit details
    Browse the repository at this point in the history
  4. Don't ignore check_radians

    blyxyas committed May 2, 2023
    Configuration menu
    Copy the full SHA
    0dd2501 View commit details
    Browse the repository at this point in the history
  5. Restrict From<S> for {D,Subd}iagnosticMessage.

    Currently a `{D,Subd}iagnosticMessage` can be created from any type that
    impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static,
    str>`, which are reasonable. It also includes `&String`, which is pretty
    weird, and results in many places making unnecessary allocations for
    patterns like this:
    ```
    self.fatal(&format!(...))
    ```
    This creates a string with `format!`, takes a reference, passes the
    reference to `fatal`, which does an `into()`, which clones the
    reference, doing a second allocation. Two allocations for a single
    string, bleh.
    
    This commit changes the `From` impls so that you can only create a
    `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static,
    str>`. This requires changing all the places that currently create one
    from a `&String`. Most of these are of the `&format!(...)` form
    described above; each one removes an unnecessary static `&`, plus an
    allocation when executed. There are also a few places where the existing
    use of `&String` was more reasonable; these now just use `clone()` at
    the call site.
    
    As well as making the code nicer and more efficient, this is a step
    towards possibly using `Cow<'static, str>` in
    `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing
    the `From<&'a str>` impls to `From<&'static str>`, which is doable, but
    I'm not yet sure if it's worthwhile.
    nnethercote committed May 2, 2023
    Configuration menu
    Copy the full SHA
    431cce1 View commit details
    Browse the repository at this point in the history
  6. Update macros.rs

    smoelius authored May 2, 2023
    Configuration menu
    Copy the full SHA
    7e24ff3 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2023

  1. Auto merge of rust-lang#10730 - blyxyas:no_std_mul_add, r=Jarcho

    `imprecise_flops`: Globally ignore `#[no_std]` crates
    
    Really small fix.
    Fixes rust-lang#10728
    changelog: [`imprecise_flops`]: Fix false positives with `#[no_std]`
    bors committed May 3, 2023
    Configuration menu
    Copy the full SHA
    9353170 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#10734 - smoelius:patch-2, r=Alexendoo

    Update macros.rs (typo)
    
    r? `@Alexendoo`
    
    changelog: none
    bors committed May 3, 2023
    Configuration menu
    Copy the full SHA
    c2e0d43 View commit details
    Browse the repository at this point in the history
  3. rename to plural form

    Icxolu committed May 3, 2023
    Configuration menu
    Copy the full SHA
    4e04903 View commit details
    Browse the repository at this point in the history
  4. add more test cases

    Icxolu committed May 3, 2023
    Configuration menu
    Copy the full SHA
    8701009 View commit details
    Browse the repository at this point in the history
  5. fix failing tests

    Icxolu committed May 3, 2023
    Configuration menu
    Copy the full SHA
    4ed7fd1 View commit details
    Browse the repository at this point in the history
  6. add rustfix annotation

    Icxolu committed May 3, 2023
    Configuration menu
    Copy the full SHA
    1603715 View commit details
    Browse the repository at this point in the history
  7. fix lint docs

    Icxolu committed May 3, 2023
    Configuration menu
    Copy the full SHA
    48ae5a0 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#10716 - Icxolu:unitstruct_default_constructio…

    …n, r=Manishearth
    
    Fixes rust-lang#10609: Adds lint to detect construction of unit struct using `default`
    
    Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name.
    
    changelog: [`default_constructed_unit_structs`]: detects construction of unit structs using `default`
    
    fixes rust-lang#10609
    bors committed May 3, 2023
    Configuration menu
    Copy the full SHA
    f9c1d15 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2023

  1. Auto merge of rust-lang#110806 - WaffleLapkin:unmkI, r=lcnr

    Replace `tcx.mk_trait_ref` with `TraitRef::new`
    
    First step in implementing rust-lang/compiler-team#616
    r? `@lcnr`
    bors committed May 4, 2023
    Configuration menu
    Copy the full SHA
    8518391 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2023

  1. Configuration menu
    Copy the full SHA
    0f7b61d View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#10747 - Alexendoo:cargo-dev-dogfood-stdout, r…

    …=flip1995
    
    Inherit stdout/stderr for `cargo dev dogfood`
    
    changelog: none
    
    Prints progress as it happens and in colour, and will also show anything printed to stderr
    bors committed May 5, 2023
    Configuration menu
    Copy the full SHA
    d7173e2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    88c7632 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    79656cc View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#10749 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed May 5, 2023
    Configuration menu
    Copy the full SHA
    371120b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4cb0519 View commit details
    Browse the repository at this point in the history
  7. Update Cargo.lock

    flip1995 committed May 5, 2023
    Configuration menu
    Copy the full SHA
    b53c1bb View commit details
    Browse the repository at this point in the history