about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-12-03Merge pull request #18555 from ChayimFriedman2/issue-17321Lukas Wirth-4/+80
fix: Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-12-03Auto merge of #133792 - lqd:jemallocup, r=Mark-Simulacrumbors-4/+6
switch `jemalloc-sys` back to `tikv-jemalloc-sys`, and update to 0.6.0 Some context: - we used to use jemalloc bindings from https://github.com/gnzlbg/jemallocator, since #55238 - that crate was abandoned, picked up as a fork in https://github.com/tikv/jemallocator, so we switched to that in #83152. - then they were able to publish to the original `jemalloc-sys` bindings crate, and `jemalloc-sys` and `tikv-jemalloc-sys` became the same thing -- so I switched back to the OG crate in #96790 - they're now having publishing problems again: I've been waiting for https://github.com/tikv/jemallocator/pull/96 for the `jemalloc-sys` 0.6.0 update for a few months, but `tikv-jemalloc-sys` is already updated to 0.6.0. A perf run showed some improvements, so this PR switches back to `tikv-jemalloc-sys` to update to 0.6.0.
2024-12-03Only show status bar item in relevant filesDavid Richey-1/+56
2024-12-03Update LLVM to 19.1.5DianQK-0/+0
2024-12-03Auto merge of #104342 - mweber15:add_file_location_to_more_types, r=wesleywiserbors-0/+7
Require `type_map::stub` callers to supply file information This change attaches file information (`DIFile` reference and line number) to struct debug info nodes. Before: ``` ; foo.ll ... !5 = !DIFile(filename: "<unknown>", directory: "") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !5, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "4cb373851db92e732c4cb5651b886dd0") ... ``` After: ``` ; foo.ll ... !3 = !DIFile(filename: "foo.rs", directory: "/home/matt/src/rust98678", checksumkind: CSK_SHA1, checksum: "bcb9f08512c8f3b8181ef4726012bc6807bc9be4") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !3, line: 3, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "9e5968c7af39c148acb253912b7f409f") ... ``` Fixes #98678 r? `@wesleywiser`
2024-12-03switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0Rémy Rakic-4/+6
2024-12-03Advertise completions and inlay hints resolve server capabilities based on ↵Kirill Bulatov-22/+45
the client capabilities.
2024-12-03miri: Adapt for `breakpoint` becoming safeJosh Triplett-5/+3
2024-12-03CI: use free runners for i686-gnu jobsMarcoIeni-26/+77
2024-12-03./x miri: fix sysroot buildRalf Jung-0/+4
2024-12-03Rollup merge of #132723 - jieyouxu:sysroot-dance-dance-revolution, r=onur-ozkanMatthias Krüger-45/+96
Unify `sysroot_target_{bin,lib}dir` handling Follow-up to https://github.com/rust-lang/rust/pull/131405#discussion_r1826558962 where `sysroot_target_bindir` had to do some dancing because the sysroot ensure logic embedded in `sysroot_target_libdir` returned `$sysroot/$relative_lib/rustlib/$target/lib` and not the `rustlib` parent `$sysroot/$relative_lib/rustlib/`. This PR pulls out the sysroot ensure logic into a helper, and return `$sysroot/$relative_lib/rustlib/` instead so `sysroot_target_bindir` doesn't have to do parent traversal from the path returned from `sysroot_target_libdir`, and also make them easier to follow in that they are now clearly closely related based on the common target sysroot ensure logic.
2024-12-03Auto merge of #133770 - GuillaumeGomez:rollup-l62iyyx, r=GuillaumeGomezbors-43/+67
Rollup of 10 pull requests Successful merges: - #131713 (Stabilize `const_maybe_uninit_write`) - #133535 (show forbidden_lint_groups in future-compat reports) - #133610 (Move `Const::{from_anon_const,try_from_lit}` to hir_ty_lowering) - #133701 (Use c"lit" for CStrings without unwrap) - #133704 (fix ICE when promoted has layout size overflow) - #133705 (add "profiler" and "optimized-compiler-builtins" option coverage for ci-rustc) - #133710 (Reducing `target_feature` check-cfg merge conflicts) - #133732 (Fix `-Zdump-mir-dataflow`) - #133746 (Change `AttrArgs::Eq` to a struct variant) - #133763 (Fix `f16::midpoint` const feature gate) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-03document -Zrandomize-layout in the unstable bookThe 8472-0/+23
2024-12-02Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxuGuillaume Gomez-6/+6
Change `AttrArgs::Eq` to a struct variant Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808 Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
2024-12-02Rollup merge of #133710 - Urgau:target_feature-merge-conflitcs, r=jieyouxuGuillaume Gomez-0/+2
Reducing `target_feature` check-cfg merge conflicts It was rightfully pointed in https://github.com/rust-lang/rust/pull/133099#discussion_r1862490542 that the expected values for the `target_feature` cfg are regularly updated and unfortunately the check-cfg tests for it are very merge-conflict prone. This PR aims at drastically reducing the likely-hood of those, by normalizing the "and X more" diagnostic, as well as making the full expected list multi-line instead of being on a single one. cc `@RalfJung` r? `@jieyouxu`
2024-12-02Rollup merge of #133705 - onur-ozkan:profiler-check, r=jieyouxuGuillaume Gomez-24/+51
add "profiler" and "optimized-compiler-builtins" option coverage for ci-rustc Adds "profiler" and "optimized-compiler-builtins" option coverage in CI-rustc config compatibility check. Resolves #133675
2024-12-02Rollup merge of #133701 - kornelski:c-str, r=workingjubileeGuillaume Gomez-13/+8
Use c"lit" for CStrings without unwrap I've reviewed uses of `CString::new("lit")`. Some could be changed to `c"lit"`. Some could be changed to `c"lit".to_owned()`, avoiding an `unwrap()`. Many `CString` documentation examples could be simplified. I deliberately haven't changed all the examples to use the exact same expression, so that they can demonstrate many ways of creating `CString`s. I've left UI tests mostly unchanged, because `c""` requires edition 2021, but most UI tests use 2015, and I didn't want to accidentally change what the tests are testing.
2024-12-02Auto merge of #133747 - lqd:osx-aarch64-1cgu, r=Kobzolbors-0/+1
build `rustc` with 1 CGU on `aarch64-apple-darwin` Distribute `aarch64-apple-darwin` artifacts built with `rust.codegen-units=1`, like we already do on Linux/Windows/macOS Intel. 1. Performance results (only wall-time on mac as usual) - I only did some `ripgrep` check builds (the revision from rustc-perf), because we had noticeable wins in wall-time there back then on linux. It's a ~2-4% (mostly 3%) improvement on local builds. ```console Benchmark 1: cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q Time (mean ± σ): 5.800 s ± 0.087 s [User: 16.048 s, System: 2.294 s] Range (min … max): 5.725 s … 6.028 s 10 runs Benchmark 2: cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q Time (mean ± σ): 5.551 s ± 0.037 s [User: 15.451 s, System: 2.252 s] Range (min … max): 5.477 s … 5.602 s 10 runs Summary 'cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q' ran 1.04 ± 0.02 times faster than 'cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q' ``` ```console Benchmark 1: CARGO_INCREMENTAL=0 cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q Time (mean ± σ): 5.743 s ± 0.030 s [User: 16.005 s, System: 2.249 s] Range (min … max): 5.720 s … 5.792 s 5 runs Benchmark 2: CARGO_INCREMENTAL=0 cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q Time (mean ± σ): 5.469 s ± 0.055 s [User: 15.244 s, System: 2.110 s] Range (min … max): 5.404 s … 5.524 s 5 runs Summary 'CARGO_INCREMENTAL=0 cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q' ran 1.05 ± 0.01 times faster than 'CARGO_INCREMENTAL=0 cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q' ``` ```console Benchmark 1: CARGO_INCREMENTAL=0 cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q -j1 Time (mean ± σ): 15.092 s ± 0.049 s [User: 11.969 s, System: 1.665 s] Range (min … max): 15.052 s … 15.165 s 5 runs Benchmark 2: CARGO_INCREMENTAL=0 cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q -j1 Time (mean ± σ): 14.623 s ± 0.035 s [User: 11.520 s, System: 1.619 s] Range (min … max): 14.593 s … 14.682 s 5 runs Summary 'CARGO_INCREMENTAL=0 cargo +41f40c97bbff6c8642f5510d0be283551b095b70 check -q -j1' ran 1.03 ± 0.00 times faster than 'CARGO_INCREMENTAL=0 cargo +caa81728c37f5ccfa9a0979574b9272a67f8a286 check -q -j1' ``` 2. Effects on code size on `aarch64-apple-darwin`: it's a 13.24% reduction on `librustc_driver.dylib` - [before](https://ci-artifacts.rust-lang.org/rustc-builds/caa81728c37f5ccfa9a0979574b9272a67f8a286/rustc-nightly-aarch64-apple-darwin.tar.xz): 173452888 (57.3 MB compressed). - [after](https://ci-artifacts.rust-lang.org/rustc-builds/41f40c97bbff6c8642f5510d0be283551b095b70/rustc-nightly-aarch64-apple-darwin.tar.xz): 150471368 (55.2 MB compressed, -3.7% here). 3. Effects on CI - the [1st try build](https://github.com/rust-lang-ci/rust/actions/runs/12118946198/job/33784512526) took 1h31 - the [2nd try build](https://github.com/rust-lang-ci/rust/actions/runs/12121452825/job/33792429553) took 1h28 - I don't know how long the builder usually takes
2024-12-02rustdoc: Rename set_back_info to restore_module_data.Alona Enraght-Moony-18/+18
2024-12-02Use c"lit" for CStrings without unwrapKornel-13/+8
2024-12-02Allow fn pointers comparisons lint in UI testsUrgau-0/+4
2024-12-02Drop uplifted `clippy::fn_address_comparisons`Urgau-170/+79
2024-12-02Update booksrustbot-0/+0
2024-12-02Gate async fn trait bound modifier on async_trait_boundsMichael Goulet-2/+2
2024-12-02Rollup merge of #133751 - lcnr:no-trait-solving-on-type, r=compiler-errorsGuillaume Gomez-4/+4
remove `Ty::is_copy_modulo_regions` Using these functions is likely incorrect if an `InferCtxt` is available, I moved this function to `TyCtxt` (and added it to `LateContext`) and added a note to the documentation that one should prefer `Infer::type_is_copy_modulo_regions` instead. I didn't yet move `is_sized` and `is_freeze`, though I think we should move these as well. r? `@compiler-errors` cc #132279
2024-12-02Rollup merge of #133745 - GuillaumeGomez:default-ids-match, r=notriddleGuillaume Gomez-60/+56
Remove static HashSet for default IDs list Follow-up of https://github.com/rust-lang/rust/pull/133345. Let's see how it impacts performance. r? `@notriddle`
2024-12-02Rollup merge of #133736 - jieyouxu:needs-target-has-atomic, r=compiler-errorsGuillaume Gomez-5/+106
Add `needs-target-has-atomic` directive Before this PR, the test writer has to specify platforms and architectures by hand for targets that have differing atomic width support. `#[cfg(target_has_atomic="...")]` is not quite the same because (1) you may have to specify additional matchers manually which has to be maintained individually, and (2) the `#[cfg]` blocks does not communicate to compiletest that a test would be ignored for a given target. This PR implements a `//@ needs-target-has-atomic` directive which admits a comma-separated list of required atomic widths that the target must satisfy in order for the test to run. ``` //@ needs-target-has-atomic: 8, 16, ptr ``` See <https://github.com/rust-lang/rust/issues/87377>. This PR supersedes #133095 and is co-authored by `@kei519,` because it was somewhat subtle, and it turned out easier to implement than to review. rustc-dev-guide docs PR: https://github.com/rust-lang/rustc-dev-guide/pull/2154
2024-12-02Rollup merge of #133725 - jyn514:remove-compare-output-subset, r=jieyouxuGuillaume Gomez-18/+4
Remove `//@ compare-output-lines-by-subset` There was only ever one test which used this flag, and it was removed in https://github.com/rust-lang/rust/pull/132244. I think this is a bad flag that should never have been added; comparing by subset makes the test failures extremely hard to debug. Any test that needs complicated output filtering like this should just use run-make instead. Note that this does not remove the underlying comparison code, because it's still used if `runner` is set. I don't quite understand what's going on there, but since we still test on other platforms and in CI that the full output is accurate, I think it will be easier to debug than a test that uses compare-by-subset unconditionally. rustc-dev-guide update PR: https://github.com/rust-lang/rustc-dev-guide/pull/2151
2024-12-02Rollup merge of #133715 - aDotInTheVoid:rdj-static, r=GuillaumeGomezGuillaume Gomez-14/+33
rustdoc-json: Include safety of `static`s `static`s in an `extern` block can have an associated safety annotation ["because there is nothing guaranteeing that the bit pattern at the static’s memory is valid for the type it is declared with"](https://doc.rust-lang.org/reference/items/external-blocks.html#statics). Rustdoc already knows this and displays in for HTML. This PR also includes it in JSON. Inspired by https://github.com/obi1kenobi/cargo-semver-checks/issues/975 which needs this, but it's probably useful in other places. r? `@GuillaumeGomez.` Possibly easier to review commit-by-commit.
2024-12-02Rollup merge of #133603 - dtolnay:precedence, r=lcnrGuillaume Gomez-25/+24
Eliminate magic numbers from expression precedence Context: see https://github.com/rust-lang/rust/pull/133140. This PR continues on backporting Syn's expression precedence design into rustc. Rustc's design used mysterious integer quantities represented variously as `i8` or `usize` (e.g. `PREC_CLOSURE = -40i8`), a special significance around `0` that is never named, and an extra `PREC_FORCE_PAREN` precedence level that does not correspond to any expression. Syn's design uses a C-like enum with variants that clearly correspond to specific sets of expression kinds. This PR is a refactoring that has no intended behavior change on its own, but it unblocks other precedence work that rustc's precedence design was poorly suited to accommodate. - Asymmetrical precedence, so that a pretty-printer can tell `(return 1) + 1` needs parens but `1 + return 1` does not. - Squashing the `Closure` and `Jump` cases into a single precedence level. - Numerous remaining false positives and false negatives in rustc pretty-printer's parenthesization of macro metavariables, for example in `$e < rhs` where $e is `lhs as Thing<T>`. FYI `@fmease` &mdash; you don't need to review if rustbot picks someone else, but you mentioned being interested in the followup PRs.
2024-12-02Merge pull request #18561 from markmurphydev/macro_name_raw_variableLukas Wirth-0/+28
Add macro expansion test for raw variable names
2024-12-02remove `Ty::is_copy_modulo_regions`lcnr-4/+4
2024-12-02Merge pull request #18587 from Veykril/push-urrlrursyrwsLukas Wirth-1/+17
fix: Fix syntax fixup inserting unnecessary semicolons
2024-12-02fix: Fix syntax fixup inserting unnecessary semicolonsLukas Wirth-1/+17
2024-12-02Auto merge of #133728 - jhpratt:rollup-k1i60pg, r=jhprattbors-63/+46
Rollup of 4 pull requests Successful merges: - #133589 (Remove `hir::ArrayLen`) - #133672 (Remove a bunch of unnecessary const stability noise) - #133678 (Stabilize `ptr::fn_addr_eq`) - #133727 (Update mailmap) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-02Fix debug configuration querying not inheriting environmentLukas Wirth-154/+42
2024-12-02build `rustc` with 1 CGU on `aarch64-apple-darwin`Rémy Rakic-0/+1
2024-12-02Remove static HashSet for default IDs listGuillaume Gomez-60/+56
2024-12-02Change `AttrArgs::Eq` into a struct variantOli Scherer-6/+6
2024-12-02include LLDB and GDB visualizers in MSVC distributionWalnut-14/+14
2024-12-02Add `needs-target-has-atomic` directive许杰友 Jieyou Xu (Joe)-5/+106
Before this commit, the test writer has to specify platforms and architectures by hand for targets that have differing atomic width support. `#[cfg(target_has_atomic)]` is not quite the same because (1) you may have to specify additional matchers manually which has to be maintained individually, and (2) the `#[cfg]` blocks does not communicate to compiletest that a test would be ignored for a given target. This commit implements a `//@ needs-target-has-atomic` directive which admits a comma-separated list of required atomic widths that the target must satisfy in order for the test to run. ``` //@ needs-target-has-atomic: 8, 16, ptr ``` See <https://github.com/rust-lang/rust/issues/87377>. Co-authored-by: kei519 <masaki.keigo.q00@kyoto-u.jp>
2024-12-02add "optimized-compiler-builtins" option coverage for ci-rustconur-ozkan-6/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-02Unify `sysroot_target_{bin,lib}dir` handlingJieyou Xu-45/+96
2024-12-02Spell out `git submodule deinit -f --all` (#2153)许杰友 Jieyou Xu (Joe)-0/+8
2024-12-02Explain how to deal with exploded git submodules (#2152)许杰友 Jieyou Xu (Joe)-0/+21
2024-12-01Rollup merge of #133589 - voidc:remove-array-len, r=boxyuwuJacob Pratt-63/+46
Remove `hir::ArrayLen` This refactoring removes `hir::ArrayLen`, replacing it with `hir::ConstArg`. To represent inferred array lengths (previously `hir::ArrayLen::Infer`), a new variant `ConstArgKind::Infer` is added. r? `@BoxyUwU`
2024-12-01Remove `//@ compare-output-lines-by-subset`jyn-18/+4
There was only ever one test which used this flag, and it was removed in https://github.com/rust-lang/rust/pull/132244. I think this is a bad flag that should never have been added; comparing by subset makes the test failures extremely hard to debug. Any test that needs complicated output filtering like this should just use run-make instead. Note that this does not remove the underlying comparison code, because it's still used if `runner` is set. I don't quite understand what's going on there, but since we still test on other platforms and in CI that the full output is accurate, I think it will be easier to debug than a test that uses compare-by-subset unconditionally.
2024-12-01Rollup merge of #133712 - RalfJung:rust_analyzer_settings, r=jieyouxuJacob Pratt-0/+4
rust_analyzer_settings: force use of 'nightly' toolchain The cranelift folder contains a rust-toolchain file. That means when RA opens `compiler/rustc_codegen_cranelift/Cargo.toml`, it will try to use that toolchain or fail. (Maybe that toolchain gets auto-installed for others? On my system, it just fails, but I also run vscodium in a sandbox.) However, it shouldn't be necessary to use more than one toolchain for the rustc workspace. So we can set the `RUSTUP_TOOLCHAIN` variable on the server side to force the same toolchain to be used everywhere. Suggested by `@ChayimFriedman2` in https://github.com/rust-lang/rust-analyzer/issues/18585.
2024-12-01Auto merge of #133345 - GuillaumeGomez:stop-cloning-context, ↵bors-285/+355
r=notriddle,aDotInTheVoid Stop cloning `Context` so much This is a first step for https://github.com/rust-lang/rust/issues/82381. It's already big enough so I'll continue in a follow-up once this PR is merged. Next step will be to get rid of `SharedContext` by inlining it directly into `Context`. cc `@camelid` r? `@notriddle`
2024-12-01rust_analyzer_settings: force use of 'nightly' toolchainRalf Jung-0/+4