Skip to content

Rollup of 6 pull requests #143081

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

Closed
wants to merge 12 commits into from

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jun 27, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 12 commits June 26, 2025 03:01
…wly added ones

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
non-exhaustive list of changes:
* rustdoc.Results has a max_dist field
* improve typechecking around pathDist and addIntoResults
* give handleNameSearch a type signature
* typecheck sortQ
* currentCrate is string and not optional
* searchState is referenced as a global, not through window
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.
…s-type, r=GuillaumeGomez

Rustdoc js: even more typechecking improvements

I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff.  Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string.

r? `@notriddle`
…piler-errors

Report infer ty errors during hir ty lowering

This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.

r? `@compiler-errors`
…=jdonszelmann

Port `#[used]` to new attribute parsing infrastructure

Ports `used` to the new attribute parsing infrastructure for rust-lang#131229 (comment)

r? `@jdonszelmann`
codegen_fn_attrs: make comment more precise

Follow-up to rust-lang#142854.

r? `@oli-obk` or `@workingjubilee`
…-obk

Remove support for `dyn*` from the compiler

This PR removes support for `dyn*` (rust-lang#102425), which are a currently un-RFC'd experiment that was opened a few years ago to explore a component that we thought was necessary for AFIDT (async fn in dyn trait).

It doesn't seem like we are going to need `dyn*` types -- even in an not-exposed-to-the-user way[^1] -- for us to implement AFIDT. Given that AFIDT was the original motivating purpose of `dyn*` types, I don't really see a compelling reason to have to maintain their implementation in the compiler.

[^1]: Compared to, e.g., generators whih are an unstable building block we use to implement stable syntax like `async {}`.

We've learned quite a lot from `dyn*`, but I think at this point its current behavior leads to more questions than answers. For example, `dyn*` support today remains somewhat fragile; it ICEs in many cases where the current "normal" `dyn Trait` types rely on their unsizedness for their vtable-based implementation to be sound I wouldn't be surprised if it's unsound in other ways, though I didn't play around with it too much. See the examples below.

```rust
#![feature(dyn_star)]

trait Foo {
    fn hello(self);
}

impl Foo for usize {
    fn hello(self) {
        println!("hello, world");
    }
}

fn main() {
    let x: dyn* Foo = 1usize;
    x.hello();
}
```

And:

```rust
#![feature(dyn_star)]

trait Trait {
    type Out where Self: Sized;
}

fn main() {
    let x: <dyn* Trait as Trait>::Out;
}
```

...and probably many more problems having to do with the intersection of dyn-compatibility and `Self: Sized` bounds that I was too lazy to look into like:
* GATs
* Methods with invalid signatures
* Associated consts

Generally, `dyn*` types also end up getting in the way of working with [normal `dyn` types](rust-lang#102425 (comment)) to an extent that IMO outweighs the benefit of experimentation.

I recognize that there are probably other, more creative usages of `dyn*` that are orthogonal to AFIDT. However, I think any work along those lines should first have to think through some of the more fundamental interactions between `dyn*` and dyn-compatibility before we think about reimplementing them in the type system.

---

I'm planning on removing the `DynKind` enum and the `PointerLike` built-in trait from the compiler after this PR lands.

Closes rust-lang#102425.

cc `@eholk` `@rust-lang/lang` `@rust-lang/types`

Closes rust-lang#116979.
Closes rust-lang#119694.
Closes rust-lang#134591.
Closes rust-lang#104800.
Only args in main diag are saved and restored without removing the newly added ones

cc rust-lang#142724

Here's a more simplified approach, since we'll be storing and restoring the main diagnostic's arg, removing args newly added isn't needed in the derive subdiagnostic implementation. `remove_arg` is helpful only for manual implementation of subdiagnostic.

r? `@oli-obk`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-search Area: Rustdoc's search feature A-tidy Area: The tidy tool A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 27, 2025
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit 508b576 has been approved by GuillaumeGomez

It is now in the queue for this repository.

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

bors commented Jun 27, 2025

⌛ Testing commit 508b576 with merge 25297a4...

bors added a commit that referenced this pull request Jun 27, 2025
Rollup of 6 pull requests

Successful merges:

 - #142270 (Rustdoc js: even more typechecking improvements)
 - #142420 (Report infer ty errors during hir ty lowering)
 - #142818 (Port `#[used]` to new attribute parsing infrastructure)
 - #143020 (codegen_fn_attrs: make comment more precise)
 - #143036 (Remove support for `dyn*` from the compiler)
 - #143060 (Only args in main diag are saved and restored without removing the newly added ones)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests\run-make\short-ice stdout ----

error: rmake recipe failed to complete
status: exit code: 101
command: "D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\run-make\\short-ice\\rmake.exe"
stdout: none
--- stderr -------------------------------

thread 'main' panicked at D:\a\rust\rust\tests\run-make\short-ice\rmake.rs:38:5:
assertion `left == right` failed: Full backtrace should contain the short backtrace markers.
---
   2:     0x7ff83e7435f1 - std::io::IoSlice::as_slice::hf133b84bc1bf2ea0
   3:     0x7ff83e74ee65 - std::sys::backtrace::lock::hf58268436babb6bb
   4:     0x7ff83e754e70 - std::panicking::default_hook::hf139035ee70ac3b4
   5:     0x7ff83e754b90 - std::panicking::default_hook::hf139035ee70ac3b4
   6:     0x7ff8351ea04e - RNvXss_NtCs8ihDNBtOpc6_5alloc5boxedINtB5_3BoxNCNvCs1Z7DJrGyrMg_17rustc_driver_impl16install_ice_hooks_0EINtNtNtCs78waLBhLUl9_4core3ops8function2FnTRDG0_IB1F_TRL1_INtNtCs5Ylj9LpBSHE_3std5panic13PanicHookInfoL0_EEEp6OutputuNtNtB1L_6marker4SendNtB3z_4SyncEL_R
   7:     0x7ff83e755b87 - std::panicking::rust_panic_with_hook::h71508d98dda8a7fb
   8:     0x7ff83e755792 - <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box::hff53ddd5d1259972
   9:     0x7ff83e74f9ff - std::sys::backtrace::__rust_end_short_backtrace::h87b246d8433e9451
  10:     0x7ff83e75531e - __rustc[59dda79527c8b695]::rust_begin_unwind
  11:     0x7ff83ea78281 - core::panicking::panic_fmt::h4490464e5f14468c
  12:     0x7ff83e1f4831 - <rustc_errors[9ec2d12b600d3343]::DiagCtxtInner>::emit_diagnostic
  13:     0x7ff83e1f34d9 - <rustc_errors[9ec2d12b600d3343]::DiagCtxtInner>::emit_diagnostic
  14:     0x7ff835687f65 - <rustc_type_ir[c8684ec78579fb2]::solve::QueryInput<rustc_middle[6e2ac0cb57fbd015]::ty::context::TyCtxt, rustc_middle[6e2ac0cb57fbd015]::ty::predicate::Predicate> as core[53223c9313a8d4b9]::fmt::Debug>::fmt
  15:     0x7ff83e1f23e8 - <rustc_errors[9ec2d12b600d3343]::DiagCtxtInner>::emit_diagnostic
  16:     0x7ff83e1f06d1 - <rustc_errors[9ec2d12b600d3343]::DiagCtxtHandle>::emit_diagnostic
  17:     0x7ff83e25264c - <rustc_span[89eec620654c66fb]::ErrorGuaranteed as rustc_errors[9ec2d12b600d3343]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7ff839f11871 - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_repeat_exprs
  19:     0x7ff839f0a839 - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_repeat_exprs
  20:     0x7ff839ebf070 - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::try_overloaded_call_traits
  21:     0x7ff839fb20f7 - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_kind
  22:     0x7ff839ed8b1f - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_coercible_to_type
  23:     0x7ff839fa693e - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_with_expectation
  24:     0x7ff839f18dba - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_repeat_exprs
  25:     0x7ff839fa8493 - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_kind
  26:     0x7ff839ed8b1f - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_coercible_to_type
  27:     0x7ff839fa693e - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_expr_with_expectation
  28:     0x7ff839edabaf - <rustc_hir_typeck[e7cb28adca191664]::fn_ctxt::FnCtxt>::check_return_or_body_tail
  29:     0x7ff839e21081 - rustc_hir_typeck[e7cb28adca191664]::check::check_fn
  30:     0x7ff839cd4df2 - rustc_hir_typeck[e7cb28adca191664]::upvar::should_do_rust_2021_incompatible_closure_captures_analysis
  31:     0x7ff83c7db0a5 - rustc_query_impl[2c8bf379669bc8da]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c8bf379669bc8da]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6e2ac0cb57fbd015]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7ff83c7419a7 - rustc_query_impl[2c8bf379669bc8da]::query_impl::items_of_instance::get_query_incr::__rust_end_short_backtrace
  33:     0x7ff83c605aab - RINvNtNtCslMfx28xKx4b_18rustc_query_system5query8plumbing17try_execute_queryINtCs3P7uWtAYLoc_16rustc_query_impl13DynamicConfigINtNtCsbPbktcw74nF_21rustc_data_structures9vec_cache8VecCacheNtNtCsbQdbajEe8K5_10rustc_span6def_id10LocalDefIdINtNtNtCs9spOyJWE3nR
  34:     0x7ff83c914c2d - rustc_query_impl[2c8bf379669bc8da]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7ff83a4a9019 - <u8 as <[_]>::to_vec_in::ConvertVec>::to_vec::<alloc[609db0491f8c2db4]::alloc::Global>
  36:     0x7ff83a496c15 - RINvNtNtCsbPbktcw74nF_21rustc_data_structures4sync8parallel15par_for_each_inRNtNtCsbQdbajEe8K5_10rustc_span6def_id10LocalDefIdRSB1d_NCINvMs1_NtNtCs9spOyJWE3nR_12rustc_middle3hir3mapNtNtNtB2j_2ty7context6TyCtxt19par_hir_body_ownersNCNvCs1FibMTXNGlj_18rustc_
  37:     0x7ff83a24bed8 - rustc_hir_analysis[1367bac1fa0f789b]::check_crate
  38:     0x7ff8355ee309 - rustc_interface[fecf6ea5641028c0]::passes::analysis
  39:     0x7ff83c7db6b3 - rustc_query_impl[2c8bf379669bc8da]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c8bf379669bc8da]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6e2ac0cb57fbd015]::query::erase::Erased<[u8; 0usize]>>
  40:     0x7ff83c742844 - rustc_query_impl[2c8bf379669bc8da]::query_impl::items_of_instance::get_query_incr::__rust_end_short_backtrace
  41:     0x7ff83c54abf4 - RINvNtNtCslMfx28xKx4b_18rustc_query_system5query8plumbing17try_execute_queryINtCs3P7uWtAYLoc_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs9spOyJWE3nR_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  42:     0x7ff83c90bdbe - rustc_query_impl[2c8bf379669bc8da]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  43:     0x7ff835230860 - RINvMs2_NtNtCs5Ylj9LpBSHE_3std6thread5localINtB6_8LocalKeyINtNtCs78waLBhLUl9_4core4cell4CellPuEE4withNCINvNtNtNtCs9spOyJWE3nR_12rustc_middle2ty7context3tls13enter_contextNCINvMsj_B1I_NtB1I_10GlobalCtxt5enterNCNCINvNtCslSlE8MzNW4S_15rustc_interface6passes28
  44:     0x7ff83528dcda - RINvMsn_NtNtCs9spOyJWE3nR_12rustc_middle2ty7contextNtB6_6TyCtxt18create_global_ctxtINtNtCs78waLBhLUl9_4core6option6OptionNtNtCslSlE8MzNW4S_15rustc_interface7queries6LinkerENCNCINvNtB1Z_6passes28create_and_enter_global_ctxtB1j_NCNCNvCs1Z7DJrGyrMg_17rustc_dr
  45:     0x7ff83530c3af - rustc_interface[fecf6ea5641028c0]::passes::create_and_enter_global_ctxt::<(), rustc_driver_impl[17216a0f1e987a0e]::run_compiler::{closure#0}::{closure#1}>
  46:     0x7ff8351e9ca7 - RNvXsq_NtCs8ihDNBtOpc6_5alloc5boxedINtB5_3BoxDG_INtNtNtCs78waLBhLUl9_4core3ops8function6FnOnceTRL0_NtNtCseB4VxYHyP7y_13rustc_session7session7SessionNtNtNtCs9spOyJWE3nR_12rustc_middle2ty7context10CurrentGcxINtNtB7_4sync3ArcNtNtCsbPbktcw74nF_21rustc_data_str
  47:     0x7ff83530a3dc - rustc_interface[fecf6ea5641028c0]::passes::create_and_enter_global_ctxt::<core[53223c9313a8d4b9]::option::Option<rustc_interface[fecf6ea5641028c0]::queries::Linker>, rustc_driver_impl[17216a0f1e987a0e]::run_compiler::{closure#0}::{closure#2}>
  48:     0x7ff8352e4a2e - RINvMs_Cs8kV7jBAtOC0_10scoped_tlsINtB5_9ScopedKeyNtCsbQdbajEe8K5_10rustc_span14SessionGlobalsE3setNCNCNCINvNtCslSlE8MzNW4S_15rustc_interface4util26run_in_thread_with_globalsNCINvB1H_31run_in_thread_pool_with_globalsNCINvNtB1J_9interface12run_compileruNCNvC
  49:     0x7ff8351caf0b - RINvNtNtCs5Ylj9LpBSHE_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCslSlE8MzNW4S_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCs1Z7DJrGyrMg_17rustc_driver_i
  50:     0x7ff8351ce14a - <std[459315a9e64f6cb4]::path::PathBuf as core[53223c9313a8d4b9]::hash::Hash>::hash::<rustc_stable_hash[21ecbe8e84c4c2bd]::stable_hasher::StableHasher<rustc_stable_hash[21ecbe8e84c4c2bd]::sip128::SipHasher128>>
  51:     0x7ff83e75b338 - std::sys::pal::windows::thread::Thread::new::haa747e87e971fcde
  52:     0x7ff891c5e8d7 - BaseThreadInitThunk
  53:     0x7ff891e3c34c - RtlUserThreadStart

error: the compiler unexpectedly panicked. this is a bug.
---

note: compiler flags: -Z treat-err-as-bug=1

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack

  left: 3
 right: 5
---
test result: FAILED. 311 passed; 1 failed; 85 ignored; 0 measured; 6 filtered out; finished in 228.37s

Some tests failed in compiletest suite=run-make mode=run-make host=x86_64-pc-windows-msvc target=x86_64-pc-windows-msvc
Build completed unsuccessfully in 2:25:24
make: *** [Makefile:112: ci-msvc-py] Error 1
  local time: Fri Jun 27 12:55:13 CUT 2025
  network time: Fri, 27 Jun 2025 12:55:13 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

💔 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 Jun 27, 2025
@compiler-errors
Copy link
Member

I'm a bit more suspicious of #143060 than the dyn* PR, so if your next rollup fails it's probably that one.

@GuillaumeGomez GuillaumeGomez deleted the rollup-zxqitnw branch June 27, 2025 16:28
@GuillaumeGomez
Copy link
Member Author

Noted, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-search Area: Rustdoc's search feature A-tidy Area: The tidy tool A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants