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 12 pull requests #120519

Closed
wants to merge 38 commits into from
Closed

Commits on Jan 27, 2024

  1. std: thread_local::register_dtor fix proposal for FreeBSD.

    following-up 5d3d347 commit, rust started to spin
    __cxa_thread_call_dtors warnings even without any TLS usage.
    using instead home made TLS destructor handler `register_dtor_fallback`.
    
    close rust-lang#120413
    devnexen committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    4c01025 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2024

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

Commits on Jan 29, 2024

  1. Make duplicate lang items fatal

    Prevents terminal spam.
    Nilstrieb committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    ad1e629 View commit details
    Browse the repository at this point in the history
  2. Delete now-useless test

    The test was using an internal feature which doesn't really matter, but
    more importantly, we're now fatally exiting after the duplicate lang
    item, so this tests nothing.
    Nilstrieb committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    a360ecd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1f89e90 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2024

  1. limit the names_possiblilities to less than 3

    Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
    chenyukang and Urgau committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    0213c87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca243e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f6b21e9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0b2579a View commit details
    Browse the repository at this point in the history
  5. Limit the use of PlaceCtxt

    Nadrieril committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    cb0e8c5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    83e88c6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6ef8362 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5903142 View commit details
    Browse the repository at this point in the history
  9. check RUST_BOOTSTRAP_CONFIG in profile_user_dist test

    Signed-off-by: onur-ozkan <work@onurozkan.dev>
    onur-ozkan committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    dfbbdda View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    75f670d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    024364a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d34b0fa View commit details
    Browse the repository at this point in the history
  13. Account for unbounded type param receiver in suggestions

    When encountering
    
    ```rust
    fn f<T>(a: T, b: T) -> std::cmp::Ordering {
        a.cmp(&b) //~ ERROR E0599
    }
    ```
    
    output
    
    ```
    error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
      --> $DIR/method-on-unbounded-type-param.rs:2:7
       |
    LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
       |      - method `cmp` not found for this type parameter
    LL |     a.cmp(&b)
       |       ^^^ method cannot be called on `T` due to unsatisfied trait bounds
       |
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#120186.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    20b1c2a View commit details
    Browse the repository at this point in the history
  14. fix rebase

    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    9ccc770 View commit details
    Browse the repository at this point in the history
  15. On E0277 be clearer about implicit Sized bounds on type params and …

    …assoc types
    
    ```
    error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
       --> f100.rs:2:33
        |
    2   |     let _ = std::mem::size_of::<[i32]>();
        |                                 ^^^^^ doesn't have a size known at compile-time
        |
        = help: the trait `Sized` is not implemented for `[i32]`
    note: required by an implicit `Sized` bound in `std::mem::size_of`
       --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22
        |
    312 | pub const fn size_of<T>() -> usize {
        |                      ^ required by the implicit `Sized` requirement on this bound in `size_of`
    ```
    
    Fix rust-lang#120178.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    2875d7e View commit details
    Browse the repository at this point in the history
  16. Change incr comp test when adding explicit Sized bound

    Given the previous change to add implicit `Sized` bounds only if there
    isn't already an explicit `Sized` bound, now the incr comp machinery
    doesn't consider adding the explicit bound as being dirty, as long as
    `-Zincremental-ignore-spans` is set.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    97ec2be View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    43fdb12 View commit details
    Browse the repository at this point in the history
  18. Mark "unused binding" suggestion as maybe incorrect

    Ignoring unused bindings should be a determination made by a human, `rustfix` shouldn't auto-apply the suggested change.
    
    Fix rust-lang#54196.
    estebank committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    8ebd47e View commit details
    Browse the repository at this point in the history
  19. Don't hash lints differently to non-lints.

    `Diagnostic::keys`, which is used for hashing and equating diagnostics,
    has a surprising behaviour: it ignores children, but only for lints.
    This was added in rust-lang#88493 to fix some duplicated diagnostics, but it
    doesn't seem necessary any more.
    
    This commit removes the special case and only four tests have changed
    output, with additional errors. And those additional errors aren't
    exact duplicates, they're just similar. For example, in
    src/tools/clippy/tests/ui/same_name_method.rs we currently have this
    error:
    ```
    error: method's name is the same as an existing method in a trait
      --> $DIR/same_name_method.rs:75:13
       |
    LL |             fn foo() {}
       |             ^^^^^^^^^^^
       |
    note: existing `foo` defined here
      --> $DIR/same_name_method.rs:79:9
       |
    LL |         impl T1 for S {}
       |         ^^^^^^^^^^^^^^^^
    ```
    and with this change we also get this error:
    ```
    error: method's name is the same as an existing method in a trait
      --> $DIR/same_name_method.rs:75:13
       |
    LL |             fn foo() {}
       |             ^^^^^^^^^^^
       |
    note: existing `foo` defined here
      --> $DIR/same_name_method.rs:81:9
       |
    LL |         impl T2 for S {}
       |         ^^^^^^^^^^^^^^^^
    ```
    I think printing this second argument is reasonable, possibly even
    preferable to hiding it. And the other cases are similar.
    nnethercote committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    4225a1e View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    c780fe6 View commit details
    Browse the repository at this point in the history
  21. Apply suggestions from code review

    Co-authored-by: Josh Stone <cuviper@gmail.com>
    the8472 and cuviper committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    39dc315 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. Rollup merge of rust-lang#120207 - onur-ozkan:120202-fix, r=clubby789

    check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test
    
    Fixes a logical bug in `profile_user_dist` test (explained in rust-lang#120202).
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    c33d378 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#120321 - Nadrieril:cleanup-cx, r=compiler-e…

    …rrors
    
    pattern_analysis: cleanup the contexts
    
    This cleans up a bit the various `*Ctxt`s I had left lying around. As a bonus this made it possible to make `PatternColumn` public. I don't have a use for that yet but that could come useful.
    
    `UsefulnessCtxt` looks useless right now but I'll be adding a field or two in subsequent PRs.
    
    r? ```@compiler-errors```
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    3adfa80 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#120323 - estebank:issue-120178, r=fmease

    On E0277 be clearer about implicit `Sized` bounds on type params and assoc types
    
    ```
    error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
       --> f100.rs:2:33
        |
    2   |     let _ = std::mem::size_of::<[i32]>();
        |                                 ^^^^^ doesn't have a size known at compile-time
        |
        = help: the trait `Sized` is not implemented for `[i32]`
    note: required by an implicit `Sized` bound in `std::mem::size_of`
       --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22
        |
    312 | pub const fn size_of<T>() -> usize {
        |                      ^ required by the implicit `Sized` requirement on this bound in `size_of`
    ```
    
    Fix rust-lang#120178.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    384a303 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#120355 - the8472:doc-vec-fromiter, r=cuviper

    document `FromIterator for Vec` allocation behaviors
    
    [t-libs discussion](https://rust-lang.zulipchat.com/#narrow/stream/259402-t-libs.2Fmeetings/topic/Meeting.202024-01-24/near/417686526) about rust-lang#120091 didn't reach a strong consensus, but it was agreed that if we keep the current behavior it should at least be documented even though it is an implementation detail.
    
    The language is intentionally non-committal. The previous (non-existent) documentation permits a lot of implementation leeway and we want retain that. In some cases we even must retain it to be able to rip out some code paths that rely on unstable features.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    33fb9c8 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#120396 - estebank:method-on-unbounded-type-…

    …param, r=nnethercote
    
    Account for unbounded type param receiver in suggestions
    
    When encountering
    
    ```rust
    fn f<T>(a: T, b: T) -> std::cmp::Ordering {
        a.cmp(&b) //~ ERROR E0599
    }
    ```
    
    output
    
    ```
    error[E0599]: no method named `cmp` found for type parameter `T` in the current scope
      --> $DIR/method-on-unbounded-type-param.rs:2:7
       |
    LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering {
       |      - method `cmp` not found for this type parameter
    LL |     a.cmp(&b)
       |       ^^^ method cannot be called on `T` due to unsatisfied trait bounds
       |
       = help: items from traits can only be used if the type parameter is bounded by the trait
    help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them:
       |
    LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering {
       |       +++++
    LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering {
       |       ++++++++++
    ```
    
    Fix rust-lang#120186.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    fada009 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#120430 - devnexen:fix_tls_dtor_fbsd, r=cuviper

    std: thread_local::register_dtor fix proposal for FreeBSD.
    
    following-up 5d3d347 commit, rust started to spin
    __cxa_thread_call_dtors warnings even without any TLS usage. using instead home made TLS destructor handler `register_dtor_fallback`.
    
    close rust-lang#120413
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    6ce73c1 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#120435 - chenyukang:yukang-fix-120427-cfg-n…

    …ame, r=Urgau,Nilstrieb
    
    Suggest name value cfg when only value is used for check-cfg
    
    Fixes rust-lang#120427
    r? ```@Nilstrieb```
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    1bc6c50 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#120470 - estebank:issue-54196, r=compiler-e…

    …rrors
    
    Mark "unused binding" suggestion as maybe incorrect
    
    Ignoring unused bindings should be a determination made by a human, `rustfix` shouldn't auto-apply the suggested change.
    
    Fix rust-lang#54196.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    f4c8ab5 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#120472 - Nilstrieb:die, r=compiler-errors

    Make duplicate lang items fatal
    
    Prevents terminal spam.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    1187855 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#120490 - nnethercote:Diagnostic-hashing, r=…

    …estebank
    
    Don't hash lints differently to non-lints.
    
    `Diagnostic::keys`, which is used for hashing and equating diagnostics, has a surprising behaviour: it ignores children, but only for lints. This was added in rust-lang#88493 to fix some duplicated diagnostics, but it doesn't seem necessary any more.
    
    This commit removes the special case and only four tests have changed output, with additional errors. And those additional errors aren't exact duplicates, they're just similar. For example, in src/tools/clippy/tests/ui/same_name_method.rs we currently have this error:
    ```
    error: method's name is the same as an existing method in a trait
      --> $DIR/same_name_method.rs:75:13
       |
    LL |             fn foo() {}
       |             ^^^^^^^^^^^
       |
    note: existing `foo` defined here
      --> $DIR/same_name_method.rs:79:9
       |
    LL |         impl T1 for S {}
       |         ^^^^^^^^^^^^^^^^
    ```
    and with this change we also get this error:
    ```
    error: method's name is the same as an existing method in a trait
      --> $DIR/same_name_method.rs:75:13
       |
    LL |             fn foo() {}
       |             ^^^^^^^^^^^
       |
    note: existing `foo` defined here
      --> $DIR/same_name_method.rs:81:9
       |
    LL |         impl T2 for S {}
       |
    ```
    I think printing this second argument is reasonable, possibly even preferable to hiding it. And the other cases are similar.
    
    r? `@estebank`
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    acb39ce View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#120495 - clubby789:remove-amdgpu-kernel, r=…

    …oli-obk
    
    Remove the `abi_amdgpu_kernel` feature
    
    The tracking issue (rust-lang#51575) has been closed for 3 years, with no activity for 5.
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    684756b View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#120501 - GuillaumeGomez:glob-reexport-attr-…

    …merge-bugfix, r=notriddle
    
    rustdoc: Correctly handle attribute merge if this is a glob reexport
    
    Fixes rust-lang#120487.
    
    The regression was introduced in rust-lang#113091. Only non-glob reexports should have been impacted.
    
    cc ```@Nemo157```
    r? ```@notriddle```
    Nadrieril committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    f93dbfc View commit details
    Browse the repository at this point in the history