about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-04Rollup merge of #138026 - celinval:chores-item-has-body, r=compiler-errorsJubilee-47/+57
Make CrateItem::body() function return an option When we initially created `CrateItem`, it would only represent items that contain a body. That is no longer the case, for now, make this explicit by expanding the APIs to retrieve the item body. This is related to https://github.com/rust-lang/project-stable-mir/issues/34 r? `@oli-obk`
2025-03-04Rollup merge of #138019 - obi1kenobi:pg/pretty-print-more-attrs, ↵Jubilee-0/+141
r=compiler-errors Pretty-print `#[deprecated]` attribute in HIR. Pretty-print `#[deprecated]` attribute in a form closer to how it might appear in Rust source code, rather than using a `Debug`-like representation. Consider the following Rust code: ```rust #[deprecated] pub struct PlainDeprecated; #[deprecated = "here's why this is deprecated"] pub struct DirectNote; #[deprecated(since = "1.2.3", note = "here's why this is deprecated")] pub struct SinceAndNote; ``` Here's the previous output: ``` #[attr="Deprecation{deprecation: Deprecation{since: Unspecifiednote: suggestion: }span: }")] struct PlainDeprecated; #[attr="Deprecation{deprecation: Deprecation{since: Unspecifiednote: here's why this is deprecatedsuggestion: }span: }")] struct DirectNote; #[attr="Deprecation{deprecation: Deprecation{since: NonStandard(1.2.3)note: here's why this is deprecatedsuggestion: }span: }")] struct SinceAndNote; ``` Here's the new output: ```rust #[deprecated] struct PlainDeprecated; #[deprecated = "here's why this is deprecated"] struct DirectNote; #[deprecated(since = "1.2.3", note = "here's why this is deprecated"] struct SinceAndNote; ``` Also includes a test for `#[diagnostic::(..)]` attributes, though their behavior is not changed here. I already wrote the test, so I figured it probably won't hurt to have it. Related to discussion in #137645. r? `@jdonszelmann`
2025-03-04Rollup merge of #137996 - safinaskar:2025-03-04-revert-parallel, ↵Jubilee-5/+6
r=compiler-errors Revert "compiler/rustc_data_structures/src/sync/worker_local.rs: delete "unsafe impl Sync"" Revert "compiler/rustc_data_structures/src/sync/worker_local.rs: delete "unsafe impl Sync"" This reverts commit 02406903b0c26440428580a4bbaf30da973c5b23. See https://github.com/rust-lang/rust/pull/136858#discussion_r1977482593 cc "Parallel Rustc Front-end" https://github.com/rust-lang/rust/issues/113349 r? SparrowLii ``@rustbot`` label: +WG-compiler-parallel ``@rustbot`` label: +C-cleanup
2025-03-04Rollup merge of #137993 - tmiasko:deduce-comment, r=compiler-errorsJubilee-29/+0
Remove obsolete comment from DeduceReadOnly The situation described in the comment does arise in practice now and described panic is long gone.
2025-03-04Rollup merge of #137991 - tgross35:avr-book-links, r=jieyouxuJubilee-1/+2
Add `avr-none` to SUMMARY.md and platform-support.md This was missed this in the implementation PR, so update the links here.
2025-03-04Rollup merge of #137986 - fuyangpengqi:master, r=AmanieuJubilee-3/+3
Fix some typos Fix some typos
2025-03-04Rollup merge of #137981 - lolbinarycat:rustdoc-js-less-expect-error, r=notriddleJubilee-45/+41
rustdoc search: increase strictness of typechecking r? `@notriddle` The signature of `makePrimitiveElement` is now more accurate. I believe the intent of the code is that `name` cannot be null if `bindingName.name` is null, and I believe typescript is expressive enough to encode this, but I'm not quite sure how, or if this would be desirable. I'm also introducing mapped types into `rustdoc.d.ts`, but I think it's worth it in order to avoid keeping two interfaces in sync. I may add more commits onto this to remove more ``@ts-expect-error`` instances.
2025-03-04Rollup merge of #137975 - Zalathar:needs-hir, r=compiler-errorsJubilee-8/+0
Remove unused `PpMode::needs_hir` This method was added in #99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in #136603, which presumably avoids the problem in a more principled way.
2025-03-04Rollup merge of #137963 - Eclips4:fix-E0373, r=compiler-errorsJubilee-2/+2
Add ``dyn`` keyword to `E0373` examples Closes #137962
2025-03-04Rollup merge of #137949 - jieyouxu:update-install, r=ChrisDentonJubilee-3/+7
Update MSVC INSTALL.md instructions to recommend VS 2022 + recent Windows 10/11 SDK This is generally iffy because we don't consistently [document the exact minimum versions of build tools required to build a given Rust toolchain](https://github.com/rust-lang/rust/issues/129307). cc #129307, *maybe* rustup docs are outdated? Anyway, I updated this because I was on a slightly older VS toolchain and I couldn't `./x build library` on MSVC (even though maybe a month ago I could) due to CI `rustc_llvm` using stuff from newer Windows 11 SDK maybe. I updated the VS toolchain + Windows 11 SDK, and then I could build. I'm not 100% sure the requirements here are accurate. It might be too high? r? ````@ChrisDenton````
2025-03-04Rollup merge of #137923 - scottmcm:fix-postorder-size-hint, r=tmiaskoJubilee-26/+11
Simplify `<Postorder as Iterator>::size_hint` The current version is sometimes malformed (cc #137919); let's see if we can get away with a loose but trivially-correct one.
2025-03-04Rollup merge of #137913 - compiler-errors:struct-field-default-generic, ↵Jubilee-19/+112
r=BoxyUwU Allow struct field default values to reference struct's generics Right now, the default field value feature (https://github.com/rust-lang/rust/issues/132162) lowers anon consts whose types may reference ADT params that the const doesn't inherit. This PR fixes this, so that these defaults can reference ADTs' generics, and sets the `generics_of` parenting up correctly. There doesn't seem to be a good reason not to support this, since the anon const has a well-defined type from the field, and the anon const doesn't interact with the type system like generic parameter defaults do. r? `````@boxyuwu````` or reassign I could also make this into an error if this seems problematic (https://github.com/rust-lang/rust/compare/master...compiler-errors:rust:default-field-value-implicit-param?expand=1)...... but I'd rather make this work and register an open question on the tracking issue about validating that this is well-vetted. Fixes #137896
2025-03-04Rollup merge of #137912 - compiler-errors:no-missing-lifetime-recovery, ↵Jubilee-180/+36
r=oli-obk Do not recover missing lifetime with random in-scope lifetime Suppresses a ton of stray errors, since this recovery doesn't really make sense anymore now that we have a dedicated `ReError` kind. r? oli-obk or reassign
2025-03-04Rollup merge of #137850 - slanterns:box_uninit_write, r=ibraheemdevJubilee-4/+1
Stabilize `box_uninit_write` Closes: https://github.com/rust-lang/rust/issues/129397.
2025-03-04Rollup merge of #137829 - cramertj:stabilize-split-off, r=jhprattJubilee-28/+7
Stabilize [T]::split_off... methods This was previously known as the slice_take feature. Closes #62280
2025-03-05Pretty-print `#[deprecated]` attribute in HIR.Predrag Gruevski-0/+141
2025-03-04Make CrateItem::body() function return an optionCelina G. Val-47/+57
When we initially created `CrateItem`, it would only represent items that contain a body. That is no longer the case, for now, make this explicit by expanding the APIs to retrieve the item body. This is related to https://github.com/rust-lang/project-stable-mir/issues/34
2025-03-04Auto merge of #135186 - camelid:const-path-multi, r=BoxyUwUbors-148/+602
mgca: Lower all const paths as `ConstArgKind::Path` When `#![feature(min_generic_const_args)]` is enabled, we now lower all const paths in generic arg position to `hir::ConstArgKind::Path`. We then lower assoc const paths to `ty::ConstKind::Unevaluated` since we can no longer use the anon const expression lowering machinery. In the process of implementing this, I factored out `hir_ty_lowering` code that is now shared between lowering assoc types and assoc consts. This PR also introduces a `#[type_const]` attribute for trait assoc consts that are allowed as const args. However, we still need to implement code to check that assoc const definitions satisfy `#[type_const]` if present (basically is it a const path or a monomorphic anon const). r? `@BoxyUwU`
2025-03-04search.js: remove incorrect outdated commentbinarycat-2/+0
2025-03-04search.js: give RawSearchIndexCrate.a an index signaturebinarycat-4/+2
2025-03-04search.js: allow empty result arraysbinarycat-4/+3
2025-03-04search.js: give buildIndex a proper return typebinarycat-2/+5
some of the fields of rustdoc.Row were confusing null and undefined.
2025-03-04search.js: give local `where` a typebinarycat-2/+1
2025-03-04give local mgens a typebinarycat-2/+1
2025-03-04search.js: give pathSplitter a type signaturebinarycat-1/+5
2025-03-04search.js: second argument of convertNameToId is optionalbinarycat-2/+1
2025-03-04search.js: local variable `extra` is an array, annotate it as such.binarycat-2/+2
2025-03-04don't use double quotesbinarycat-1/+1
2025-03-04fix whitespacebinarycat-6/+6
2025-03-04Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3bors-207/+839
Support raw-dylib link kind on ELF raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time. I was inspired by Björn's comments in https://internals.rust-lang.org/t/bundle-zig-cc-in-rustup-by-default/22096/27 Tracking issue: #135694 r? bjorn3 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-03-04mgca: Lower all const paths as `ConstArgKind::Path`Noah Lev-148/+602
When `#![feature(min_generic_const_args)]` is enabled, we now lower all const paths in generic arg position to `hir::ConstArgKind::Path`. We then lower assoc const paths to `ty::ConstKind::Unevaluated` since we can no longer use the anon const expression lowering machinery. In the process of implementing this, I factored out `hir_ty_lowering` code that is now shared between lowering assoc types and assoc consts. This PR also introduces a `#[type_const]` attribute for trait assoc consts that are allowed as const args. However, we still need to implement code to check that assoc const definitions satisfy `#[type_const]` if present (basically is it a const path or a monomorphic anon const).
2025-03-04Revert "compiler/rustc_data_structures/src/sync/worker_local.rs: delete ↵Askar Safin-5/+6
"unsafe impl Sync"" This reverts commit 02406903b0c26440428580a4bbaf30da973c5b23.
2025-03-04Remove obsolete comment from DeduceReadOnlyTomasz Miąsko-29/+0
The situation described in the comment does arise in practice now and described panic is long gone.
2025-03-04Add `avr-none` to SUMMARY.md and platform-support.mdTrevor Gross-1/+2
This was missed this in the implementation PR, so update the links here.
2025-03-04Fix some typosfuyangpengqi-3/+3
Signed-off-by: fuyangpengqi <995764973@qq.com>
2025-03-04ParserQueryElement.typeFilter MAY be a string, OR number.binarycat-4/+2
ideally we would encode that it is a string before convertTypeFilterOnElem is called, and a number after, but i'm not sure that's possible without significant refactoring.
2025-03-04rustdoc search: give buildTypeMapIndex a conditional return typebinarycat-16/+10
we encode "if the argument is a non-empty string, this will never return null" into the type signature.
2025-03-03rustdoc search: increase strictness of typecheckingbinarycat-6/+11
2025-03-03Also simplify `Preorder`'s `size_hint`Scott McMurray-15/+5
2025-03-04Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgrbors-4949/+7272
Rollup of 12 pull requests Successful merges: - #135767 (Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies) - #137852 (Remove layouting dead code for non-array SIMD types.) - #137863 (Fix pretty printing of unsafe binders) - #137882 (do not build additional stage on compiler paths) - #137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset") - #137902 (Make `ast::TokenKind` more like `lexer::TokenKind`) - #137921 (Subtree update of `rust-analyzer`) - #137922 (A few cleanups after the removal of `cfg(not(parallel))`) - #137939 (fix order on shl impl) - #137946 (Fix docker run-local docs) - #137955 (Always allow rustdoc-json tests to contain long lines) - #137958 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-04Remove unused `PpMode::needs_hir`Zalathar-8/+0
2025-03-04Allow struct field default values to reference struct's genericsMichael Goulet-19/+112
2025-03-03Auto merge of #137927 - matthiaskrgr:rollup-yj463ns, r=matthiaskrgrbors-410/+3606
Rollup of 9 pull requests Successful merges: - #132388 (Implement `#[cfg]` in `where` clauses) - #134900 (Fix parsing of ranges after unary operators) - #136938 (Remove `:` from `stack-protector-heuristics-effect.rs` Filecheck Pattern) - #137054 (Make phantom variance markers transparent) - #137525 (Simplify parallelization in test-float-parse) - #137618 (Skip `tidy` in pre-push hook if the user is deleting a remote branch) - #137741 (Stop using `hash_raw_entry` in `CodegenCx::const_str`) - #137849 (Revert "Remove Win SDK 10.0.26100.0 from CI") - #137862 (ensure we always print all --print options in help) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-03Add ``dyn`` keywordKirill Podoprigora-2/+2
2025-03-04Update MSVC INSTALL.md instructions to recommend VS 2022 + recent Windows ↵Jieyou Xu-3/+7
10/11 SDK
2025-03-03Rollup merge of #137958 - aDotInTheVoid:aDotInTheVoid-patch-2, r=jieyouxuMatthias Krüger-2/+2
triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search This happened because `test/rustdoc-js` is a prefix of `test/rustdoc-json`, and triagebot works on prefixes. Maybe this should be fixed in triagebot, but this works now. This happened on #137956 and #137955.
2025-03-03Rollup merge of #137955 - Noratrieb:rustdoc-json-long-lines, ↵Matthias Krüger-76/+17
r=aDotInTheVoid,jieyouxu Always allow rustdoc-json tests to contain long lines The rustdoc-json test syntax often requires very long lines, so the checks for long lines aren't really useful. `@aDotInTheVoid` told me she'd like this and r? jieyouxu you're gonna tell me that the implementation is terrible. at least the performance seems reasonable: 2.5s after and 2.5s before.
2025-03-03Rollup merge of #137946 - ehuss:ci-docker-readme, r=KobzolMatthias Krüger-2/+2
Fix docker run-local docs This fixes the docker run-local docs to have a valid cargo command.
2025-03-03Rollup merge of #137939 - speedy-lex:shl-fix, r=NoratriebMatthias Krüger-1/+1
fix order on shl impl this doesn't fix any bugs, it makes shl_impl_all! look more consistent with the other impl's in core/ops/bit.rs
2025-03-03Rollup merge of #137922 - Zalathar:sharded, r=SparrowLiiMatthias Krüger-74/+61
A few cleanups after the removal of `cfg(not(parallel))` I noticed a few small things that are no longer needed after the removal of `cfg(not(parallel))` in #132282. One of the later changes adjusts several imports, so viewing the changes individually is recommended. r? SparrowLii (or reroll)