about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-09-25Rollup merge of #130734 - Luv-Ray:fix_vfe, r=lcnrMatthias Krüger-51/+61
Fix: ices on virtual-function-elimination about principal trait Extract `load_vtable` function to ensure the `virtual_function_elimination` option is always checked. It's okay not to use `llvm.type.checked.load` to load the vtable if there is no principal trait. Fixes #123955 Fixes #124092
2024-09-25Rollup merge of #130595 - no1wudi:master, r=ibraheemdevMatthias Krüger-22/+225
Initial std library support for NuttX This PR add the initial libstd support for NuttX platform (Tier 3), currently it depends on https://github.com/rust-lang/libc/pull/3909 which provide the essential libc definitions.
2024-09-25Rollup merge of #130549 - biabbas:riscv32_wrs_vxworks, r=nnethercoteMatthias Krüger-5/+66
Add RISC-V vxworks targets Risc-V 32 and RISC-V 64 targets are to be added in the target list.
2024-09-25Vxworks riscv target specs: remove redundant zicsr featureB I Mohammed Abbas-4/+4
2024-09-25Auto merge of #130807 - tgross35:rollup-p304vzf, r=tgross35bors-560/+872
Rollup of 7 pull requests Successful merges: - #130234 (improve compile errors for invalid ptr-to-ptr casts with trait objects) - #130752 (Improve assembly test for CMSE ABIs) - #130764 (Separate collection of crate-local inherent impls from error tracking) - #130788 (Pin memchr to 2.5.0 in the library rather than rustc_ast) - #130789 (add InProgress ErrorKind gated behind io_error_inprogress feature) - #130793 (Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure) - #130798 (rustdoc: inherit parent's stability where applicable) Failed merges: - #130735 (Simple validation for unsize coercion in MIR validation) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-24Rollup merge of #130798 - lukas-code:doc-stab, r=notriddleTrevor Gross-9/+82
rustdoc: inherit parent's stability where applicable It is currently not possible for a re-export to have a different stability (https://github.com/rust-lang/rust/issues/30827). Therefore the standard library uses a hack when moving items like `std::error::Error` or `std::net::IpAddr` into `core` by marking the containing module (`core::error` / `core::net`) as unstable or stable in a later version than the items the module contains. Previously, rustdoc would always show the *stability as declared* for an item rather than the *stability as publicly reachable* (i.e. the features required to actually access the item), which could be confusing when viewing the docs. This PR changes it so that we show the stability of the first unstable parent or the most recently stabilized parent instead, to hopefully make things less confusing. fixes https://github.com/rust-lang/rust/issues/130765 screenshots: ![error in std](https://github.com/user-attachments/assets/2ab9bdb9-ed81-4e45-a832-ac7d3ba1be3f) ![error in core](https://github.com/user-attachments/assets/46f46182-5642-4ac5-b92e-0b99a8e2496d)
2024-09-24Rollup merge of #130793 - jieyouxu:mention-crashes-verbose, r=matthiaskrgrTrevor Gross-4/+5
Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure Fixes https://github.com/rust-lang/rust/issues/130776. r? `@matthiaskrgr` (or compiler/bootstrap)
2024-09-24Rollup merge of #130789 - aviramha:add_inprogress, r=NoratriebTrevor Gross-0/+8
add InProgress ErrorKind gated behind io_error_inprogress feature Follow up on https://github.com/rust-lang/libs-team/issues/92#issuecomment-2371666560
2024-09-24Rollup merge of #130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-SimulacrumTrevor Gross-4/+8
Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: https://github.com/rust-lang/rust/issues/127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
2024-09-24Rollup merge of #130764 - compiler-errors:inherent, r=estebankTrevor Gross-144/+136
Separate collection of crate-local inherent impls from error tracking #119895 changed the return type of the `crate_inherent_impls` query from `CrateInherentImpls` to `Result<CrateInherentImpls, ErrorGuaranteed>` to avoid needing to use the non-parallel-friendly `track_errors()` to track if an error was reporting from within the query... This was mostly fine until #121113, which stopped halting compilation when we hit an `Err(ErrorGuaranteed)` in the `crate_inherent_impls` query. Thus we proceed onwards to typeck, and since a return type of `Result<CrateInherentImpls, ErrorGuaranteed>` means that the query can *either* return one of "the list inherent impls" or "error has been reported", later on when we want to assemble method or associated item candidates for inherent impls, we were just treating any `Err(ErrorGuaranteed)` return value as if Rust had no inherent impls defined anywhere at all! This leads to basically every inherent method call failing with an error, lol, which was reported in #127798. This PR changes the `crate_inherent_impls` query to return `(CrateInherentImpls, Result<(), ErrorGuaranteed>)`, i.e. returning the inherent impls collected *and* whether an error was reported in the query itself. It firewalls the latter part of that query into a new `crate_inherent_impls_validity_check` just for the `ensure()` call. This fixes #127798.
2024-09-24Rollup merge of #130752 - tdittr:cmse-assembly-tests, r=jieyouxuTrevor Gross-5/+81
Improve assembly test for CMSE ABIs Tracking issues: #75835 #81391 This ensures the code-gen for these ABIs does not change silently. There is a small chance that this code-gen might change, however even GCC (https://godbolt.org/z/16arxab5x and https://godbolt.org/z/16arxab5x) generates almost the same assembly for these ABIs. I hope the notes in the comments should help fix the tests if it ever breaks.
2024-09-24Rollup merge of #130234 - lukas-code:ptr-cast-errors, r=WaffleLapkinTrevor Gross-394/+552
improve compile errors for invalid ptr-to-ptr casts with trait objects This is a follow-up to https://github.com/rust-lang/rust/pull/120248 to improve some of its error messages. 1. Make the borrowcheck error for "type annotation requires that x must outlive y" actually point at the type annotation, i.e. the type `T` in a `x as T` cast. This makes the error more consistent with other errors caused by type annotation in other places, such as ```text error: lifetime may not live long enough --> src/lib.rs:4:12 | 3 | fn bar(a: &i32) { | - let's call the lifetime of this reference `'1` 4 | let b: &'static i32 = a; | ^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static` ``` 2. Don't say "cast" when we actually mean "coercion" and give borrowcheck errors from actual casts (which is currently just the check added in https://github.com/rust-lang/rust/pull/120248) a higher priority than ones from coercions. This can improve the errors for ptr-to-ptr cast between trait objects because they are are lowered as an upcast "unsizing" coercion if possible (which may be the identity upcast) followed by the actual cast. 3. Bring back the old "casting X as Y is invalid" message for type mismatch in the principals and reword the "vtable kinds may not match" message to more accurately describe the pointer metadata and not refer to "vtables" if the metadata is unknown. fixes https://github.com/rust-lang/rust/issues/130030 r? `@WaffleLapkin` but feel free to reassign
2024-09-24Auto merge of #130739 - jieyouxu:stage0_run_make, r=Kobzolbors-103/+78
Fix cargo staging for run-make tests Follow-up to https://github.com/rust-lang/rust/pull/130642#issuecomment-2366891866 to make sure that when ``` $ COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0 ``` is used, bootstrap cargo is used in order to avoid building stage 1 rustc. Note that run-make tests are usually not written with `--stage 0` in mind and some tests may rely on stage1 rustc (nightly) behavior, and it is expected that some tests will fail under this invocation. This PR also fixes `tool::Cargo` staging in compiletest when preparing for `run-make` test mode, by chopping off a stage from the `compiler` passed to `tool::Cargo` such that when the user invokes with stage `N` ``` ./x test run-make --stage N ``` the `run-make` test suite will be tested against the cargo built by stage `N` compiler. Let's take `N=1`, i.e. `--stage 1`, without chopping off a stage, previously `./x test run-make --stage 1` will cause stage 1 rustc + std to be built, then stage 2 rustc, and cargo will be produced by the stage 2 rustc, which is clearly not what we want. By chopping off a stage, it means that cargo will be produced by the stage 1 rustc. cc #119946, #59864. See discussions regarding the tool staging at https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/.E2.9C.94.20stage1.20run-make.20tests.20now.20need.20stage2.20rustc.20built.20for.20c.2E.2E.2E.
2024-09-24update doc commentLukas Markeffsky-2/+4
2024-09-24improve errors for invalid pointer castsLukas Markeffsky-74/+121
2024-09-24be even more precise about "cast" vs "coercion"Lukas Markeffsky-231/+289
2024-09-24replace "cast" with "coercion" where applicableLukas Markeffsky-29/+38
This changes the remaining span for the cast, because the new `Cast` category has a higher priority (lower `Ord`) than the old `Coercion` category, so we no longer report the region error for the "unsizing" coercion from `*const Trait` to itself.
2024-09-24use more accurate spans for user type ascriptionsLukas Markeffsky-38/+52
2024-09-24add another testLukas Markeffsky-1/+14
2024-09-24unify dyn* coercions with other pointer coercionsLukas Markeffsky-55/+70
2024-09-24Auto merge of #129587 - Voultapher:opt-for-size-variants-of-sort-impls, ↵bors-59/+202
r=cuviper Add `optimize_for_size` variants for stable and unstable sort as well as select_nth_unstable - Stable sort uses a simple merge-sort that re-uses the existing - rather gnarly - merge function. - Unstable sort jumps directly to the branchless heapsort fallback. - select_nth_unstable jumps directly to the median_of_medians fallback, which is augmented with a custom tiny smallsort and partition impl. Some code is duplicated but de-duplication would bring it's own problems. For example `swap_if_less` is critical for performance, if the sorting networks don't inline it perf drops drastically, however `#[inline(always)]` is also a poor fit, if the provided comparison function is huge, it gives the compiler an out to only instantiate `swap_if_less` once and call it. Another aspect that would suffer when making `swap_if_less` pub, is having to cfg out dozens of functions in in smallsort module. Part of https://github.com/rust-lang/rust/issues/125612 r​? `@Kobzol`
2024-09-24rustdoc: inherit parent's stability where applicableLukas Markeffsky-9/+82
2024-09-24add InProgress ErrorKind gated behind io_error_inprogress featureAviram Hassan-0/+8
Co-authored-by: David Tolnay <dtolnay@gmail.com> Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com>
2024-09-24Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure许杰友 Jieyou Xu (Joe)-4/+5
2024-09-24Pin memchr to 2.5.0 in the library rather than rustc_astTrevor Gross-4/+8
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: https://github.com/rust-lang/rust/issues/127890 [1]
2024-09-24Auto merge of #130775 - jieyouxu:revert-129047, r=nagisabors-422/+103
Revert "Apply EarlyOtherwiseBranch to scalar value #129047" This reverts PR #129047, commit a772336fb3fbd1fe4493077fcfe04e0221296a99, reversing changes made to 702987f75b74f789ba227ee04a3d7bb1680c2309. cc `@DianQK` and `@cjgillot` as the PR author and reviewer of #129047 respectively. It seems [Apply EarlyOtherwiseBranch to scalar value #129047](https://github.com/rust-lang/rust/pull/129047) may have lead to several nightly regressions: - https://github.com/rust-lang/rust/issues/130769 - https://github.com/rust-lang/rust/issues/130774 - https://github.com/rust-lang/rust/issues/130771 Example test that would ICE with changes in #129047 (this test is included in this PR): ```rs //@ compile-flags: -C opt-level=3 //@ check-pass use std::task::Poll; pub fn poll(val: Poll<Result<Option<Vec<u8>>, u8>>) { match val { Poll::Ready(Ok(Some(_trailers))) => {} Poll::Ready(Err(_err)) => {} Poll::Ready(Ok(None)) => {} Poll::Pending => {} } } ``` Since this is a mir-opt ICE that seems to quite easy to trigger with real-world crates being affected, let's revert for now and reland the mir-opt after these are fixed.
2024-09-24Fix toolsMichael Goulet-19/+9
2024-09-24Separate collection of crate-local inherent impls from error reportingMichael Goulet-125/+127
2024-09-24Auto merge of #130389 - Luv-Ray:LLVMMDNodeInContext2, r=nikicbors-91/+66
llvm: replace some deprecated functions `LLVMMDStringInContext` and `LLVMMDNodeInContext` are deprecated, replace them with `LLVMMDStringInContext2` and `LLVMMDNodeInContext2`. Also replace `Value` with `Metadata` in some function signatures for better consistency.
2024-09-24Update `run-make` tests to use `cargo` wrapper cmd许杰友 Jieyou Xu (Joe)-97/+58
2024-09-24Fix `run-make-support` to respect per-stage cargo许杰友 Jieyou Xu (Joe)-2/+3
2024-09-24Fix tool cargo being off-by-one from rustc staging许杰友 Jieyou Xu (Joe)-0/+8
Previously if you pass compiler stage 1 to `tool::Cargo`, it will build stage2 rustc and give you back a cargo built with stage2 rustc, which is not what we want. This commit adds a hack that chops off a stage from the compiler passed to `tool::Cargo`, meaning that we will get a cargo built with stage 1 compiler, avoiding unnecessary and incorrect build of stage2 rustc and the cargo built by that.
2024-09-24Add regression test for #130769许杰友 Jieyou Xu (Joe)-0/+18
2024-09-24Auto merge of #130738 - bjoernager:const-make-ascii, r=jhprattbors-6/+20
Mark `make_ascii_uppercase` and `make_ascii_lowercase` in `[u8]` and `str` as const. Relevant tracking issue: #130698 This PR extends #130697 and #130713 to the similar methods in byte slices (`[u8]`) and string slices (`str`). For the `str` methods, this simply requires adding the `const` specifier to the function signatures. The `[u8]` methods, however, require (at least a temporary) reimplementation due to the use of iterators and `for` loops.
2024-09-24Revert "Auto merge of #129047 - DianQK:early_otherwise_branch_scalar, ↵许杰友 Jieyou Xu (Joe)-422/+85
r=cjgillot" This reverts commit a772336fb3fbd1fe4493077fcfe04e0221296a99, reversing changes made to 702987f75b74f789ba227ee04a3d7bb1680c2309. It seems Apply EarlyOtherwiseBranch to scalar value #129047 may have lead to several nightly regressions: - https://github.com/rust-lang/rust/issues/130769 - https://github.com/rust-lang/rust/issues/130774 - https://github.com/rust-lang/rust/issues/130771 And since this is a mir-opt ICE that seems to quite easy to trigger with real-world crates being affected, let's revert for now and reland the mir-opt later.
2024-09-24Pass bootstrap cargo when `--stage 0` and `COMPILETST_FORCE_STAGE0`许杰友 Jieyou Xu (Joe)-4/+9
And stop passing `BOOTSTRAP_CARGO` as an env var, instead the provided cargo should go through `--cargo-path.`
2024-09-24Initial std library support for NuttXHuang Qi-22/+225
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-24Mark and implement 'make_ascii_uppercase' and 'make_ascii_lowercase' in ↵Gabriel Bjørnager Jensen-6/+20
'[u8]' and 'str' as const;
2024-09-24Auto merge of #130768 - compiler-errors:rollup-8ncjy55, r=compiler-errorsbors-506/+794
Rollup of 7 pull requests Successful merges: - #129545 (rustdoc: redesign toolbar and disclosure widgets) - #130618 (Skip query in get_parent_item when possible.) - #130727 (Check vtable projections for validity in miri) - #130750 (Add new Tier-3 target: `loongarch64-unknown-linux-ohos`) - #130758 (Revert "Add recursion limit to FFI safety lint") - #130759 (Update books) - #130762 (stabilize const_intrinsic_copy) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-23Rollup merge of #130762 - RalfJung:const_intrinsic_copy, r=dtolnayMichael Goulet-31/+20
stabilize const_intrinsic_copy Fixes https://github.com/rust-lang/rust/issues/80697 This stabilizes ```rust mod ptr { pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize); pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize); } impl *const T { pub const unsafe fn copy_to(self, dest: *mut T, count: usize); pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize); } impl *mut T { pub const unsafe fn copy_to(self, dest: *mut T, count: usize); pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize); pub const unsafe fn copy_from(self, src: *const T, count: usize); pub const unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize); } impl <T> NonNull<T> { pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize); pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize); pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize); pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize); } ``` In particular, this reverts https://github.com/rust-lang/rust/pull/117905, which reverted https://github.com/rust-lang/rust/pull/97276. The `NonNull` methods are not listed in the tracking issue, they were added to this feature gate in https://github.com/rust-lang/rust/pull/124498. The existing [FCP](https://github.com/rust-lang/rust/issues/80697#issuecomment-1022585839) does not cover them. They are however entirely identical to the `*mut` methods and already stable outside `const`. ``@rust-lang/libs-api`` please let me know if FCP will be required for the `NonNull` methods.
2024-09-23Rollup merge of #130759 - rustbot:docs-update, r=ehussMichael Goulet-0/+0
Update books ## rust-lang/book 5 commits in e7d217be2a75ef1753f0988d6ccaba4d7e376259..99cf75a5414fa8adbe3974bd0836661ca901708f 2024-09-23 16:18:39 UTC to 2024-09-11 18:38:03 UTC - translations: remove broken link (rust-lang/book#4036) - Update build instructions: include mdbook plugins (rust-lang/book#4032) - Add `cargo init` usage suggestion to 1.3 (rust-lang/book#4025) - Use immutable borrow of `TcpStream` when creating `BufReader` (rust-lang/book#4024) - Upgrade to Rust 1.81 (rust-lang/book#4031) ## rust-lang/edition-guide 1 commits in b3ca7ade0f87d7e3fb538776defc5b2cc4188172..c7ebae25cb4801a31b6f05353f6d85bfa6feedd1 2024-09-22 08:47:02 UTC to 2024-09-22 08:47:02 UTC - Update static_mut_refs now that it is a lint (rust-lang/edition-guide#322) ## rust-lang/reference 10 commits in 687faf9958c52116d003b41dfd29cc1cf44f5311..24fb2687cdbc54fa18ae4acf5d879cfceca77b2c 2024-09-22 09:07:12 UTC to 2024-09-10 19:24:17 UTC - do not talk about the 'address of a constant' (rust-lang/reference#1624) - Add spec identifier syntax to interior-mutability.md (rust-lang/reference#1585) - Add spec identifier syntax to input-format.md (rust-lang/reference#1584) - Document limitations on block doc comments (rust-lang/reference#1602) - Places based on misaligned pointers: also mention 'static's as a possible base for place projections (rust-lang/reference#1606) - type-layout: mention that call ABI compatibility is a separate concern (rust-lang/reference#1608) - stabilize `const_extern_fn` (rust-lang/reference#1596) - const_eval: update for const_mut_refs and const_refs_to_cell stabilization (rust-lang/reference#1590) - fix: unclosed tag `sup` (rust-lang/reference#1612) - Fix improper documentation on casting non_exhaustive enums (rust-lang/reference#1607) ## rust-lang/rustc-dev-guide 13 commits in 0ed9229f5b6f7824b333beabd7e3d5ba4b9bd971..555f3de2fa0d61c4294b74d245f1cbad6fcbf589 2024-09-23 12:51:33 UTC to 2024-09-10 07:32:10 UTC - chore: add missing `.` (rust-lang/rustc-dev-guide#2074) - Add remark on required free disk space (rust-lang/rustc-dev-guide#2073) - fix broken links (rust-lang/rustc-dev-guide#2063) - Add advice about submitting potentially hard-to-review PRs (rust-lang/rustc-dev-guide#2036) - Edit a sentence for clarity (rust-lang/rustc-dev-guide#2071) - Emphasize how to run a single tool test (rust-lang/rustc-dev-guide#2070) - Remove chalk is owned by WG-traits (rust-lang/rustc-dev-guide#2068) - Fix conditions lowering text for enums with no fields (rust-lang/rustc-dev-guide#2066) - update proof tree chapter (rust-lang/rustc-dev-guide#2054) - Add docs for JS tests (rust-lang/rustc-dev-guide#2048) - Reflect `x.py test`'s `--rustc-args` option being renamed to `--compiletest-rustc-args` (rust-lang/rustc-dev-guide#2062) - we standardized on this more reliable command (rust-lang/rustc-dev-guide#2061) - Fix Typo and Remove Outdated Line About C Variadics (rust-lang/rustc-dev-guide#2060)
2024-09-23Rollup merge of #130758 - compiler-errors:ctype-recursion-limit, r=jieyouxuMichael Goulet-50/+50
Revert "Add recursion limit to FFI safety lint" It's not necessarily clear if warning when we hit the recursion limit is the right thing to do, first of all. **More importantly**, this PR was implemented incorrectly in the first place; it was not decrementing the recursion limit when stepping out of a type, so it would trigger when a ctype has more than RECURSION_LIMIT fields *anywhere* in the type's set of recursively reachable fields. Reverts #130598 Reopens #130310 Fixes #130757
2024-09-23Rollup merge of #130750 - heiher:loong-linux-ohos-tier3, r=jieyouxuMichael Goulet-0/+37
Add new Tier-3 target: `loongarch64-unknown-linux-ohos` MCP: https://github.com/rust-lang/compiler-team/issues/784
2024-09-23Rollup merge of #130727 - compiler-errors:objects, r=RalfJungMichael Goulet-87/+143
Check vtable projections for validity in miri Currently, miri does not catch when we transmute `dyn Trait<Assoc = A>` to `dyn Trait<Assoc = B>`. This PR implements such a check, and fixes https://github.com/rust-lang/miri/issues/3905. To do this, we modify `GlobalAlloc::VTable` to contain the *whole* list of `PolyExistentialPredicate`, and then modify `check_vtable_for_type` to validate the `PolyExistentialProjection`s of the vtable, along with the principal trait that was already being validated. cc ``@RalfJung`` r? ``@lcnr`` or types I also tweaked the diagnostics a bit. --- **Open question:** We don't validate the auto traits. You can transmute `dyn Foo` into `dyn Foo + Send`. Should we check that? We currently have a test that *exercises* this as not being UB: https://github.com/rust-lang/rust/blob/6c6d210089e4589afee37271862b9f88ba1d7755/src/tools/miri/tests/pass/dyn-upcast.rs#L14-L20 I'm not actually sure if we ever decided that's actually UB or not 🤔 We could perhaps still check that the underlying type of the object (i.e. the concrete type that was unsized) implements the auto traits, to catch UB like: ```rust fn main() { let x: &dyn Trait = &std::ptr::null_mut::<()>(); let _: &(dyn Trait + Send) = std::mem::transmute(x); //~^ this vtable is not allocated for a type that is `Send`! } ```
2024-09-23Rollup merge of #130618 - m-ou-se:skip-query, r=compiler-errorsMichael Goulet-1/+4
Skip query in get_parent_item when possible. For HirIds with a non-zero item local id, `self.parent_owner_iter(hir_id).next()` just returns the same HirId with the item local id set to 0, but also does a query to retrieve the Node which is ignored here, which seems wasteful.
2024-09-23Rollup merge of #129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomezMichael Goulet-337/+540
rustdoc: redesign toolbar and disclosure widgets Fixes #77899 Fixes #90310 ## Preview | before | after | ------ | ----- | ![image](https://github.com/user-attachments/assets/ebeec185-3a72-481d-921e-a9a885f348d9) | ![image](https://github.com/user-attachments/assets/08735a65-99d1-4523-ab77-ddb164c0a5db) | ![image](https://github.com/user-attachments/assets/ae8e0f24-49cb-445d-b9bd-cec9c57b94e7) | ![image](https://github.com/user-attachments/assets/ba484f94-b031-41fc-b8a8-6cd81be8fb6b) | ![image](https://github.com/user-attachments/assets/8c2cc041-a138-4950-a12e-3d529c8a5339) | ![image](https://github.com/user-attachments/assets/e7f010bd-19e2-4711-85bf-3fd00c3e5647) | ![image](https://github.com/user-attachments/assets/e2b63785-971c-489e-b069-eb85f6a30620) | ![image](https://github.com/user-attachments/assets/b65eea16-d6a3-4aa3-8a27-6ded74009010) | ![image](https://github.com/user-attachments/assets/1c7b0901-a61a-4325-9d01-9d8b14b476aa) | ![image](https://github.com/user-attachments/assets/d4a485db-d9f1-4a62-94bc-a3d125ea6dc1) | N/A | ![image](https://github.com/user-attachments/assets/7add0a2a-7fd7-483d-87ee-51ee45a2fe5d) | ![image](https://github.com/user-attachments/assets/334f50bc-9f8d-42d9-a7df-95058f7cdfd5) | ![image](https://github.com/user-attachments/assets/451fcc22-b034-453c-ae4b-b948fd6bd779) | ![image](https://github.com/user-attachments/assets/132f720c-802a-466d-bd55-c7a4750acdc3) | ![image](https://github.com/user-attachments/assets/177b7921-06c5-467d-87d3-9cdf88c4e50b) https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html ## Description This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. CC <https://github.com/rust-lang/rust/pull/113074#issuecomment-1677469680> and ``@jsha`` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs. This is aimed at avoiding any line wrapping at desktop sizes. ## Prior art This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like :arrow_left: I can understand why, but words are great when icons fail. ![image](https://github.com/user-attachments/assets/9a4a0498-232d-4d60-87b9-f601f4515254)
2024-09-24Auto merge of #127117 - Urgau:non_local_def-syntactic, r=BoxyUwUbors-956/+186
Rework `non_local_definitions` lint to only use a syntactic heuristic This PR reworks the `non_local_definitions` lint to only use a syntactic heuristic, i.e. not use a type-system logic for whenever an `impl` is local or not. Instead the new logic wanted by T-lang in https://github.com/rust-lang/rust/issues/126768#issuecomment-2192634762, which is to consider every paths in `Self` and `Trait` and to no longer use the type-system inference trick. `@rustbot` labels +L-non_local_definitions Fixes #126768
2024-09-23Check vtable projections for validity in miriMichael Goulet-87/+143
2024-09-23Auto merge of #130620 - onur-ozkan:update-make-prepare, r=Kobzolbors-22/+14
remove workaround for make prepare and use dry-run build instead Removes an annoying hard-coded logic. try-job: x86_64-msvc
2024-09-23stabilize const_intrinsic_copyRalf Jung-31/+20