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 9 pull requests #106324

Merged
merged 26 commits into from
Dec 31, 2022
Merged

Rollup of 9 pull requests #106324

merged 26 commits into from
Dec 31, 2022

Commits on Dec 29, 2022

  1. Revert "Add tests"

    This reverts commit b656e24.
    dtolnay committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    c5f6672 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06ec0bf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a9e5c1a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3076f4e View commit details
    Browse the repository at this point in the history
  5. CFI: Monomorphize transparent ADTs before typeid

    Monomorphise `#[repr(transparent)]` parameterized ADTs before turning
    them into an Itanium mangled String.
    
    `#[repr(transparent)]` ADTs currently use the single field to represent
    them in their CFI type ID to ensure that they are compatible. However,
    if that type involves a type parameter instantiated at the ADT level, as
    in `ManuallyDrop`, this will currently ICE as the `Parameter` type
    cannot be mangled. Since this happens at lowering time, it should always
    be concrete after substitution.
    
    Fixes rust-lang#106230
    maurer committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    fb2c27d View commit details
    Browse the repository at this point in the history
  6. Support x clean --stage 1 rustc_query_impl

    Previously, clean only supported `--stage 0` for specific crates.
    
    The new `crate_description` function generates a string that looks
    like
    ```
    : {rustc_query_impl}
    ```
    jyn514 committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    cbede85 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2022

  1. Configuration menu
    Copy the full SHA
    f9cc011 View commit details
    Browse the repository at this point in the history
  2. std: rename Parker::new to Parker::new_in_place, add safe `Parker…

    …::new` constructor for SGX
    joboet committed Dec 30, 2022
    Configuration menu
    Copy the full SHA
    9abda03 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    898302e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    87bc29d View commit details
    Browse the repository at this point in the history
  5. Regression test for issue 106247

    nbdd0121 authored and dtolnay committed Dec 30, 2022
    Configuration menu
    Copy the full SHA
    4271ed4 View commit details
    Browse the repository at this point in the history
  6. Use more consistent progress messages in bootstrap

    Before:
    ```
    Testing ["rustc_interface"] stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
    ```
    
    After:
    ```
    Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
    ```
    
    Note there is a slight consistency between `build` and `test`: The
    former doesn't print "compiler artifacts". It would be annoying to fix
    and doesn't hurt anything, so I left it be.
    
    ```
    ; x t rustc_interface --stage 0 --dry-run
    Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
    ; x b rustc_interface --stage 0 --dry-run
    Building {rustc_interface} stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
    ```
    jyn514 committed Dec 30, 2022
    Configuration menu
    Copy the full SHA
    c8c849e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9dfe504 View commit details
    Browse the repository at this point in the history
  8. Make tidy errors red

    This makes it easier to see them (and makes people go owo).
    Noratrieb committed Dec 30, 2022
    Configuration menu
    Copy the full SHA
    75b3ee2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e2c5999 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2022

  1. Fix panic on x build --help

    jyn514 committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    6d2fe52 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5d62a73 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#105903 - joboet:unify_parking, r=m-ou-se

    Unify id-based thread parking implementations
    
    Multiple platforms currently use thread-id-based parking implementations (NetBSD and SGX[^1]). Even though the strategy does not differ, these are duplicated for each platform, as the id is encoded into an atomic thread variable in different ways for each platform.
    
    Since `park` is only called by one thread, it is possible to move the thread id into a separate field. By ensuring that the field is only written to once, before any other threads access it, these accesses can be unsynchronized, removing any restrictions on the size and niches of the thread id.
    
    This PR also renames the internal `thread_parker` modules to `thread_parking`, as that name now better reflects their contents. I hope this does not add too much reviewing noise.
    
    r? `@m-ou-se`
    
    `@rustbot` label +T-libs
    
    [^1]: SOLID supports this as well, I will switch it over in a follow-up PR.
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    ff3326d View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#106232 - maurer:transparent-subst, r=rcvalle

    CFI: Monomorphize transparent ADTs before typeid
    
    Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String.
    
    `#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution.
    
    Fixes rust-lang#106230
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    fad7339 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#106248 - dtolnay:revertupcastlint, r=jackh726

    Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint"
    
    This is a clean revert of rust-lang#105484.
    
    I confirmed that reverting that PR fixes the regression reported in rust-lang#106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** rust-lang#106247 (comment) has an explanation of why rust-lang#105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe.
    
    FYI `@nbdd0121` `@compiler-errors`
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    5b74a33 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#106286 - Nilstrieb:tidy-cowows, r=jyn514

    Make tidy errors red
    
    This makes it easier to see them (and makes people go owo).
    
    I also changes the error codes check to not print too many things and use `tidy_error`.
    
    r? ```@jyn514```
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    81808b7 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#106295 - GuillaumeGomez:extend-scraped-exam…

    …ples-layout-test, r=notriddle
    
    Extend scraped examples layout GUI test for position of buttons
    
    This is a regression test for rust-lang#106279.
    
    r? ````@notriddle````
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    9644684 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#106305 - jyn514:tail-args, r=Mark-Simulacrum

     bootstrap: Get rid of tail_args in stream_cargo
    
    Based on rust-lang#106303 for convenience.
    
    r? ````@Mark-Simulacrum````
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    93032e8 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#106310 - compiler-errors:old-git, r=jyn514

    Dont use `--merge-base` during bootstrap formatting subcommand
    
    I use a development image with Ubuntu 20.04 LTS, which has git 2.25.
    
    Recently, `./x.py test tidy --bless` regressed in rust-lang#105702 because it uses the `--merge-base` option on `diff-index`, which was only introduced in git 2.30 (git/git@0f5a1d4). Luckily, it can be replicated via two calls to `git merge-base` + `git diff-index`, so let's just use that.
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    96e32a4 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#106314 - jyn514:fix-panic, r=jyn514

    Fix panic on `x build --help`
    
    Fixes rust-lang#106313. This avoids trying to run `get_help` unless we actually need to see the paths that are available for the subcommand.
    
    This originally regressed in rust-lang#106166.
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    7f930b4 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#106317 - compiler-errors:restore-the-backtr…

    …aces, r=jyn514
    
    Only deduplicate stack traces for good path bugs
    
    Fixes rust-lang#106267
    
    Restores backtraces for `bug!` and `delay_span_bug` after rust-lang#106056. Only `delay_good_path_bug` needed its backtraces to be deduplicated, since it spits out the backtrace where it was created when it's being emitted.
    
    Before:
    
    ```
    error: internal compiler error: /home/ubuntu/rust2/compiler/rustc_middle/src/ty/relate.rs:638:13: var types encountered in super_relate_consts: Const { ty: usize, kind: Infer(Var(_#0c)) } Const { ty: usize, kind: Param(N/#1) }
    
    note: the compiler unexpectedly panicked. this is a bug.
    
    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
    
    note: rustc 1.68.0-dev running on x86_64-unknown-linux-gnu
    
    query stack during panic:
    #0 [typeck] type-checking `<impl at /home/ubuntu/test.rs:7:1: 7:34>::trigger`
    #1 [typeck_item_bodies] type-checking all item bodies
    #2 [analysis] running analysis passes on this crate
    end of query stack
    error: aborting due to 2 previous errors
    ```
    
    Hmm... that's a little bare.
    
    After:
    
    ```
    error: internal compiler error: /home/ubuntu/rust2/compiler/rustc_middle/src/ty/relate.rs:638:13: var types encountered in super_relate_consts: Const { ty: usize, kind: Infer(Var(_#0c)) } Const { ty: usize, kind: Param(N/#1) }
    
    thread 'rustc' panicked at 'Box<dyn Any>', /home/ubuntu/rust2/compiler/rustc_errors/src/lib.rs:1599:9
    stack backtrace:
       0:     0x7ffb5b41bdd1 - std::backtrace_rs::backtrace::libunwind::trace::h26056f81198c6594
                                   at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
       1:     0x7ffb5b41bdd1 - std::backtrace_rs::backtrace::trace_unsynchronized::hacfb345a0c6d5bb1
                                   at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
       2:     0x7ffb5b41bdd1 - std::sys_common::backtrace::_print_fmt::h18ea6016ac8030f3
                                   at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:65:5
       3:     0x7ffb5b41bdd1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he35dde201d0c2d09
                                   at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:44:22
       4:     0x7ffb5b4a0308 - core::fmt::write::h094ad263467a053c
                                   at /home/ubuntu/rust2/library/core/src/fmt/mod.rs:1208:17
       5:     0x7ffb5b43caf1 - std::io::Write::write_fmt::hd47b4e2324b4d9b7
                                   at /home/ubuntu/rust2/library/std/src/io/mod.rs:1682:15
       6:     0x7ffb5b41bbfa - std::sys_common::backtrace::_print::h43044162653a17fc
                                   at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:47:5
       7:     0x7ffb5b41bbfa - std::sys_common::backtrace::print::hc8605da258fa5aeb
                                   at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:34:9
       8:     0x7ffb5b3ffb87 - std::panicking::default_hook::{{closure}}::h9e37f23f75122a15
       9:     0x7ffb5b3ff97b - std::panicking::default_hook::h602873a063f84da2
                                   at /home/ubuntu/rust2/library/std/src/panicking.rs:286:9
      10:     0x7ffb5be192b2 - <alloc[48d7b30605060536]::boxed::Box<dyn for<'a, 'b> core[672e3947e150d6c6]::ops::function::Fn<(&'a core[672e3947e150d6c6]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[672e3947e150d6c6]::marker::Send + core[672e3947e150d6c6]::marker::Sync> as core[672e3947e150d6c6]::ops::function::Fn<(&core[672e3947e150d6c6]::panic::panic_info::PanicInfo,)>>::call
                                   at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
      11:     0x7ffb5be192b2 - rustc_driver[f5b6d32d8905ecdd]::DEFAULT_HOOK::{closure#0}::{closure#0}
                                   at /home/ubuntu/rust2/compiler/rustc_driver/src/lib.rs:1204:17
      12:     0x7ffb5b4000d3 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfd13333ca953ae8e
                                   at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
      13:     0x7ffb5b4000d3 - std::panicking::rust_panic_with_hook::h45753e10264ebe7e
                                   at /home/ubuntu/rust2/library/std/src/panicking.rs:692:13
      14:     0x7ffb5e8b3a63 - std[3330b4673efabfce]::panicking::begin_panic::<rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug>::{closure#0}
    
    [... FRAMES INTENTIONALLY OMITTED BECAUSE GITHUB GOT ANGRY ...]
    
     186:     0x7ffb5bea5554 - <std[3330b4673efabfce]::thread::Builder>::spawn_unchecked_::<rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals<rustc_interface[947706ead88047d0]::interface::run_compiler<core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}>::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#1}
                                   at /home/ubuntu/rust2/library/std/src/thread/mod.rs:549:30
     187:     0x7ffb5bea5554 - <<std[3330b4673efabfce]::thread::Builder>::spawn_unchecked_<rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals<rustc_interface[947706ead88047d0]::interface::run_compiler<core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}>::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#1} as core[672e3947e150d6c6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                                   at /home/ubuntu/rust2/library/core/src/ops/function.rs:250:5
     188:     0x7ffb5b433968 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he8b26fc22c6f51ec
                                   at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
     189:     0x7ffb5b433968 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5cf9cbe75a8c3ddc
                                   at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
     190:     0x7ffb5b41199c - std::sys::unix::thread::Thread::new::thread_start::h2d6dd4455e97d031
                                   at /home/ubuntu/rust2/library/std/src/sys/unix/thread.rs:108:17
     191:     0x7ffb5441b609 - start_thread
     192:     0x7ffb5b282133 - clone
     193:                0x0 - <unknown>
    
    note: the compiler unexpectedly panicked. this is a bug.
    
    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
    
    note: rustc 1.68.0-dev running on x86_64-unknown-linux-gnu
    
    query stack during panic:
    #0 [typeck] type-checking `<impl at /home/ubuntu/test.rs:7:1: 7:34>::trigger`
    #1 [typeck_item_bodies] type-checking all item bodies
    #2 [analysis] running analysis passes on this crate
    end of query stack
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0601`.
    ```
    compiler-errors committed Dec 31, 2022
    Configuration menu
    Copy the full SHA
    d798e22 View commit details
    Browse the repository at this point in the history