about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-09-27Auto merge of #138907 - GuillaumeGomez:rfc-3631, ↵bors-25/+93
r=fmease,camelid,Manishearth,lolbinarycat Implement RFC 3631: add rustdoc doc_cfg features Implementation of https://github.com/rust-lang/rfcs/pull/3631. This implementation actually resulted in a lot of simplifications: * All `cfg` computation is now done in one place: `propagate_doc_cfg.rs`. Because (trait) `impl`s are not retrieved at the same time as the other items, we cannot perform this computation in the clean process, it needs to be after. * Because there is `cfg` inheritance, we can keep track of them in one place (in `propagate_doc_cfg.rs`), meaning we don't need to copy an item's attributes to its children anymore. Only exception: impl items. For them we clone only `cfg` attributes. * `propagate_doc_cfg.rs` is also now much simpler, much less need to keep track of parents, since everything we need is handled by the new `CfgInfo` type. * I also suspect that `Cfg::simplify_with` could either be removed or at least used directly into `propagate_doc_cfg.rs` when we compute `cfg`s. Considering how big the PR already is, I'll do it in a follow-up. I didn't remove the `doc_cfg*` features in this PR because some dependencies used in `rustc` (like `stdarch`) are using it, so we need to have a nightly released with this PR before I can switch to the new feature. r? ghost
2025-09-27Auto merge of #146829 - cjgillot:jump-threading-loop-dominator, r=dianqkbors-17/+25
JumpThreading: Avoid computing dominators to identify loop headers. JumpThreading tries to avoid threading through loop headers to avoid creating irreducible CFGs. However, computing dominators is expensive, and accounts up to 20 % of the runtime of the JumpThreading pass for some cases like serde. This PR proposes to approximate according to the post-order traversal order. We define a "maybe" loop header as a block which is visited after its predecessor in post-order.
2025-09-27Remove `doc_auto_cfg` feature as wellGuillaume Gomez-2/+2
2025-09-27Improve code and fix typoGuillaume Gomez-36/+17
2025-09-27Apply first review round suggestionsGuillaume Gomez-2/+5
2025-09-27Remove `doc_cfg_hide` featureGuillaume Gomez-3/+0
2025-09-27Improve code and better check `doc(cfg(...))` attributesGuillaume Gomez-3/+24
2025-09-27Add code documentation, improve code and improve error messageGuillaume Gomez-7/+4
2025-09-27Put back the `doc_cfg` code behind a nightly featureGuillaume Gomez-0/+1
2025-09-27Strenghten checks for `doc(auto_cfg(show/hide))` attributesGuillaume Gomez-1/+23
2025-09-27Implement RFC 3631Guillaume Gomez-18/+64
2025-09-27Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxubors-30/+18
Bump bootstrap compiler to 1.91 beta https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2025-09-27Auto merge of #147074 - matthiaskrgr:rollup-sm3owsd, r=matthiaskrgrbors-289/+329
Rollup of 10 pull requests Successful merges: - rust-lang/rust#145113 (resolve: Do not finalize shadowed bindings) - rust-lang/rust#146523 (Demote both armebv7r-none-* targets.) - rust-lang/rust#146704 (port `#[debugger_visualizer]` to the new attribute system) - rust-lang/rust#146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu) - rust-lang/rust#146778 (Use standard attribute logic for allocator shim) - rust-lang/rust#146849 (Reduce some uses of `LegacyBang`) - rust-lang/rust#147016 (fix doc comments to be more standard) - rust-lang/rust#147027 (Add new `tyalias` intra-doc link disambiguator) - rust-lang/rust#147031 (mbe: Simplify check_redundant_vis_repetition) - rust-lang/rust#147058 (Ignore more failing ui tests for GCC backend) Failed merges: - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-26Apply cfg(bootstrap) replacementMark Rousskov-16/+4
2025-09-26Update CURRENT_RUSTC_VERSION post-bumpMark Rousskov-14/+14
2025-09-26Handle self-loops too.Camille Gillot-3/+5
2025-09-26Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnrMatthias Krüger-6/+6
mbe: Simplify check_redundant_vis_repetition Eliminate a use of `map_or` in favor of a match. Inline some variable definitions that don't add clarity, and that prevent short-circuiting.
2025-09-26Rollup merge of #147016 - hkBst:whitespace-1, r=nnethercoteMatthias Krüger-23/+5
fix doc comments to be more standard
2025-09-26Rollup merge of #146849 - joshtriplett:macro-reduce-legacy-bang, r=petrochenkovMatthias Krüger-22/+19
Reduce some uses of `LegacyBang` - **Switch `dummy_bang` from `LegacyBang` to `Bang`** - **mbe: Switch dummy extension used for errors from `LegacyBang` to `Bang`**
2025-09-26Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726Matthias Krüger-114/+126
Use standard attribute logic for allocator shim Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here). This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
2025-09-26Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkovMatthias Krüger-7/+21
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced. Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1. The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`. Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-26Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkovMatthias Krüger-109/+143
port `#[debugger_visualizer]` to the new attribute system
2025-09-26Rollup merge of #146523 - thejpster:demote-armebv7r-targets, r=jackh726Matthias Krüger-2/+2
Demote both armebv7r-none-* targets. OK, slightly more controversial than https://github.com/rust-lang/rust/pull/146520 and https://github.com/rust-lang/rust/pull/146522 - I'd like to drop the bare-metal **big-endian** Armv7-R targets down to Tier 3. The reason is simple - we cannot test them in https://github.com/rust-embedded/cortex-ar/. This because QEMU support for Big Endian Armv7-R is broken. I tried quite hard, but all the strings I printed with semihosting came out byte swapped (or "etybawa depp") because of how QEMU kludges the access to memory in big-endian mode. The target also has only a single maintainer. Although, if ````@chrisnc```` wants to put up a case for keeping it at Tier 2 though, I'm happy to hear it! This PR wil be rebased once https://github.com/rust-lang/rust/pull/146419 completes the queue.
2025-09-26Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnrMatthias Krüger-6/+7
resolve: Do not finalize shadowed bindings I.e. do not mark them as used, or non-speculatively loaded, or similar. Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-26reviewlcnr-7/+13
2025-09-26allow method calls on opaqueslcnr-32/+216
2025-09-26use `try_structurally_resolve_type` for method receiverlcnr-2/+3
We'll still error due to the `opt_bad_ty` of `method_autoderef_steps`. This slightly worsens the span of `infer_var.method()` which is now the same as for `Box::new(infer_var).method()`. Unlike `structurally_resolve_type`, `probe_op` does not check whether the infcx is already tainted, so this results in 2 previously not emitted errors.
2025-09-26remove unnecessary structurally resolvelcnr-3/+1
`autoderef` already resolved and `method_autoderef_steps` makes sure we won't encounter an inference variable
2025-09-26predefined opaques to `method_autoderef_steps`lcnr-15/+63
2025-09-26predefined opaques use `List`lcnr-77/+16
2025-09-26fix doc comments to be more standardMarijn Schouten-23/+5
2025-09-26Auto merge of #147054 - matthiaskrgr:rollup-660g92w, r=matthiaskrgrbors-41/+136
Rollup of 7 pull requests Successful merges: - rust-lang/rust#146283 (Resolve: (Ref)Cell wrappers to deny mutation during spec resolution.) - rust-lang/rust#146453 (Add general arm-linux.md platform doc.) - rust-lang/rust#146991 (const_caller_location to use real Span instead of `DUMMY_SP`) - rust-lang/rust#146994 (Add `clippy::unconditional_recursion` to `./x clippy ci`) - rust-lang/rust#147038 (Rename verbosity functions in bootstrap) - rust-lang/rust#147047 (rustdoc: put the toolbar on the all item index) - rust-lang/rust#147049 (std: fix warning in VEXos stdio module) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-26Rollup merge of #146991 - cachebag:span-caller-location, r=RalfJungMatthias Krüger-1/+1
const_caller_location to use real Span instead of `DUMMY_SP` Clarifying usage of DUMMY_SP
2025-09-26Rollup merge of #146283 - LorrensP-2158466:resolve-cm-cell, r=petrochenkovMatthias Krüger-40/+135
Resolve: (Ref)Cell wrappers to deny mutation during spec resolution. Introduces wrappers around `Cell` and `RefCell` that only allow mutation when we are not in speculative resolution. This is preparatory work for rust-lang/rust#145108. It would allow us to make `ImportData` and `ModuleData` sync and send safe. r? ``@petrochenkov``
2025-09-26Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkovbors-20/+0
Extended temporary argument to format_args!() in all cases Fixes https://github.com/rust-lang/rust/issues/145880 by removing the special case.
2025-09-26JumpThreading: Avoid computing dominators to identify loop headers.Camille Gillot-17/+23
2025-09-25Auto merge of #146919 - lcnr:yeet-fast-path, r=fee1-deadbors-13/+1
remove incorrect fast path Using `tcx.is_copy_modulo_regions` drops information from the current `typing_env`. Writing a regression test for this is really hard. We need to prove `Copy` of something that doesn't directly reference a coroutine or an opaque, but does so indirectly. cc rust-lang/rust#146813.
2025-09-25Auto merge of #147037 - matthiaskrgr:rollup-xtgqzuu, r=matthiaskrgrbors-8/+6
Rollup of 8 pull requests Successful merges: - rust-lang/rust#116882 (rustdoc: hide `#[repr]` if it isn't part of the public ABI) - rust-lang/rust#135771 ([rustdoc] Add support for associated items in "jump to def" feature) - rust-lang/rust#141032 (avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`) - rust-lang/rust#142401 (Add proper name mangling for pattern types) - rust-lang/rust#146293 (feat: non-panicking `Vec::try_remove`) - rust-lang/rust#146859 (BTreeMap: Don't leak allocators when initializing nodes) - rust-lang/rust#146924 (Add doc for `NonZero*` const creation) - rust-lang/rust#146933 (Make `render_example_with_highlighting` return an `impl fmt::Display`) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-25const_caller_location: edit FIXME to explain use of `DUMMY_SP`Akrm Al-Hakimi-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-25resolve: Do not finalize shadowed bindingsVadim Petrochenkov-6/+7
I.e. do not mark them as used, or non-speculative loaded, or similar. Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-25Auto merge of #146697 - cjgillot:invalidate-patch, r=lcnrbors-15/+21
Avoid invalidating CFG caches from MirPatch::apply. Small effort to reduce invalidating CFG caches.
2025-09-25Introduce and use CmCell during import resolution.LorrensP-2158466-40/+135
2025-09-25Rollup merge of #142401 - oli-obk:pattern-mango, r=petrochenkovMatthias Krüger-8/+6
Add proper name mangling for pattern types requires adding demangler support first https://github.com/rust-lang/rustc-demangle/pull/81 needed for https://github.com/rust-lang/rust/pull/136006#discussion_r2139792593 as otherwise we will have symbol collisions
2025-09-25mbe: Simplify check_redundant_vis_repetitionJosh Triplett-6/+6
Eliminate a use of `map_or` in favor of a match. Inline some variable definitions that don't add clarity, and that prevent short-circuiting.
2025-09-25Auto merge of #147019 - Zalathar:rollup-boxzbmo, r=Zalatharbors-84/+273
Rollup of 14 pull requests Successful merges: - rust-lang/rust#145067 (RawVecInner: add missing `unsafe` to unsafe fns) - rust-lang/rust#145277 (Do not materialise X in [X; 0] when X is unsizing a const) - rust-lang/rust#145973 (Add `std` support for `armv7a-vex-v5`) - rust-lang/rust#146667 (Add an attribute to check the number of lanes in a SIMD vector after monomorphization) - rust-lang/rust#146735 (unstably constify float mul_add methods) - rust-lang/rust#146737 (f16_f128: enable some more tests in Miri) - rust-lang/rust#146766 (Add attributes for #[global_allocator] functions) - rust-lang/rust#146905 (llvm: update remarks support on LLVM 22) - rust-lang/rust#146982 (Remove erroneous normalization step in `tests/run-make/linker-warning`) - rust-lang/rust#147005 (Small string formatting cleanup) - rust-lang/rust#147007 (Explicitly note `&[SocketAddr]` impl of `ToSocketAddrs`) - rust-lang/rust#147008 (bootstrap.py: Respect build.jobs while building bootstrap tool) - rust-lang/rust#147013 (rustdoc: Fix documentation for `--doctest-build-arg`) - rust-lang/rust#147015 (Use `LLVMDisposeTargetMachine`) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-25Rollup merge of #147015 - Zalathar:dispose-tm, r=lqdStuart Cook-8/+3
Use `LLVMDisposeTargetMachine` After bumping the minimum LLVM version to 20 (rust-lang/rust#145071), we no longer need to run any custom code when disposing of a TargetMachine, so we can just use the upstream LLVM-C function.
2025-09-25Rollup merge of #147005 - GuillaumeGomez:string-formatting-cleanup, ↵Stuart Cook-5/+3
r=jdonszelmann Small string formatting cleanup This PR is mostly useless. I was going through this file, saw that and corrected it. That's pretty much it. Feel free to close it if it's a bother.
2025-09-25Rollup merge of #146905 - durin42:llvm-22-bitstream-remarks, r=nikicStuart Cook-0/+13
llvm: update remarks support on LLVM 22 LLVM change dfbd76bda01e removed separate remark support entirely, but it turns out we can just drop the parameter and everything appears to work fine. Fixes rust-lang/rust#146912 as far as I can tell (the test passes.)
2025-09-25Rollup merge of #146766 - nikic:global-alloc-attr, r=nnethercoteStuart Cook-3/+13
Add attributes for #[global_allocator] functions Emit `#[rustc_allocator]` etc. attributes on the functions generated by the `#[global_allocator]` macro, which will emit LLVM attributes like `"alloc-family"`. If the module with the global allocator participates in LTO, this ensures that the attributes typically emitted on the allocator declarations are not lost if the definition is imported. There is a similar issue when the allocator shim is used, but I've opted not to fix that case in this PR, because doing that cleanly is somewhat gnarly. Related to https://github.com/rust-lang/rust/issues/145995.
2025-09-25Rollup merge of #146735 - Qelxiros:const_mul_add, r=tgross35,RalfJungStuart Cook-0/+54
unstably constify float mul_add methods Tracking issue: rust-lang/rust#146724 r? `@tgross35`