about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-06-13Tier 2 std support must always be knownChris Denton-1/+1
2024-06-13Auto merge of #126396 - fmease:rollup-3j7f6wk, r=fmeasebors-87/+277
Rollup of 6 pull requests Successful merges: - #126347 (Simplify `try_*`'s signature on `Iterator`) - #126348 (Improve error message if dependency installation in tidy fails) - #126366 (Add a new trait to retrieve StableMir definition Ty) - #126370 (compiletest: Stricter parsing of `//@ normalize-*` headers) - #126379 (interpret: update doc comment for find_closest_untracked_caller_location) - #126384 (add tracking issue for is_none_or) Failed merges: - #126388 (const-eval: make lint scope computation consistent) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-13Rollup merge of #126384 - RalfJung:is_none_or, r=workingjubileeLeón Orell Valerian Liehr-1/+1
add tracking issue for is_none_or This was forgotten in https://github.com/rust-lang/rust/pull/126328. Cc https://github.com/rust-lang/rust/issues/126383
2024-06-13Rollup merge of #126379 - RalfJung:find_closest_untracked_caller_location, ↵León Orell Valerian Liehr-3/+7
r=oli-obk interpret: update doc comment for find_closest_untracked_caller_location Also add a doc comment to cur_span. r? `@compiler-errors`
2024-06-13Rollup merge of #126370 - Zalathar:normalize, r=oli-obkLeón Orell Valerian Liehr-61/+74
compiletest: Stricter parsing of `//@ normalize-*` headers I noticed some problems with the existing parser for these headers: - It is extremely lax, and basically ignores everything other than the text between two pairs of double-quote characters. - Unlike other name-value headers, it doesn't even check for a colon after the header name, so the test suite contains a mixture of with-colon and without-colon normalization rules. - If parsing fails, the header is silently ignored. The latter is especially bad for platform-specific normalization rules, because the lack of normalization probably won't be noticed until the test mysteriously fails in one of the full CI jobs.
2024-06-13Rollup merge of #126366 - celinval:issue-0080-def-ty, r=oli-obkLeón Orell Valerian Liehr-10/+177
Add a new trait to retrieve StableMir definition Ty We implement the trait only for definitions that should have a type. It's possible that I missed a few definitions, but we can add them later if needed. Fixes https://github.com/rust-lang/project-stable-mir/issues/80
2024-06-13Rollup merge of #126348 - Kobzol:venv-debug-error, r=albertlarsan68León Orell Valerian Liehr-2/+7
Improve error message if dependency installation in tidy fails Should help with easier debugging of issues occuring during [venv installation](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/PR.20CI.20broken) of `tidy` dependencies.
2024-06-13Rollup merge of #126347 - slanterns:try_simplify, r=scottmcmLeón Orell Valerian Liehr-10/+11
Simplify `try_*`'s signature on `Iterator` Inspired by https://github.com/rust-lang/rust/pull/126249#issuecomment-2161859295. r? `@scottmcm` (Seems there's no need to explicitly use `<Self as Iterator>::Item`? I only find this occurrence across the whole file.)
2024-06-13add tracking issue for is_none_orRalf Jung-1/+1
2024-06-13Auto merge of #126197 - jieyouxu:rmake-must-use, r=Kobzolbors-2/+48
run-make: annotate library with `#[must_use]` and enforce `unused_must_use` in rmake.rs This PR adds `#[must_use]` annotations to functions of the `run_make_support` library where it makes sense, and adjusts compiletest to compile rmake.rs with `-Dunused_must_use`. The rationale is that it's highly likely that unused `#[must_use]` values in rmake.rs test files are bugs. For example, unused fs/io results are often load-bearing to the correctness of the test and often unchecked fs/io results allow the test to silently pass where it would've failed if the result was checked. This PR is best reviewed commit-by-commit. try-job: test-various try-job: x86_64-msvc
2024-06-13interpret: update doc comment for find_closest_untracked_caller_locationRalf Jung-3/+7
2024-06-13Auto merge of #126374 - workingjubilee:rollup-tz0utfr, r=workingjubileebors-275/+557
Rollup of 10 pull requests Successful merges: - #125674 (Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format) - #125688 (Walk into alias-eq nested goals even if normalization fails) - #126142 (Harmonize using root or leaf obligation in trait error reporting) - #126303 (Urls to docs in rust_hir) - #126328 (Add Option::is_none_or) - #126337 (Add test for walking order dependent opaque type behaviour) - #126353 (Move `MatchAgainstFreshVars` to old solver) - #126356 (docs(rustc): Improve discoverable of Cargo docs) - #126358 (safe transmute: support `Single` enums) - #126362 (Make `try_from_target_usize` method public) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-12Rollup merge of #126362 - artemagvanian:patch-1, r=celinvalJubilee-1/+1
Make `try_from_target_usize` method public There is now no way to create a TyConst from an integer, so I propose making this method public unless there was a reason for keeping it otherwise.
2024-06-12Rollup merge of #126358 - jswrenn:fix-125811, r=compiler-errorsJubilee-59/+81
safe transmute: support `Single` enums Previously, the implementation of `Tree::from_enum` incorrectly treated enums with `Variants::Single` and `Variants::Multiple` identically. This is incorrect for `Variants::Single` enums, which delegate their layout to that of a variant with a particular index (or no variant at all if the enum is empty). This flaw manifested first as an ICE. `Tree::from_enum` attempted to compute the tag of variants other than the one at `Variants::Single`'s `index`, and fell afoul of a sanity-checking assertion in `compiler/rustc_const_eval/src/interpret/discriminant.rs`. This assertion is non-load-bearing, and can be removed; the routine its in is well-behaved even without it. With the assertion removed, the proximate issue becomes apparent: calling `Tree::from_variant` on a variant that does not exist is ill-defined. A sanity check the given variant has `FieldShapes::Arbitrary` fails, and the analysis is (correctly) aborted with `Err::NotYetSupported`. This commit corrects this chain of failures by ensuring that `Tree::from_variant` is not called on variants that are, as far as layout is concerned, nonexistent. Specifically, the implementation of `Tree::from_enum` is now partitioned into three cases: 1. enums that are uninhabited 2. enums for which all but one variant is uninhabited 3. enums with multiple inhabited variants `Tree::from_variant` is now only invoked in the third case. In the first case, `Tree::uninhabited()` is produced. In the second case, the layout is delegated to `Variants::Single`'s index. Fixes #125811
2024-06-12Rollup merge of #126356 - epage:check-cfg, r=UrgauJubilee-2/+9
docs(rustc): Improve discoverable of Cargo docs In preparing Cargo's blog post for 1.80, I tried to find the documentation for the lint configuration and I couldn't. The link is only visible from the lint itself, which isn't where I started, and the side bar, which was collapsed for me. The first place I went was the docs for `unexpected_cfgs` because this is configuration for that lint. If using lint configuration were a one off, I could see skipping it here. However, when we discussed this with at least one T-compiler member, there was interest in using this for other lints in the future. To that end, it seems like we should be exposing this with the lint itself. The second place I checked was the `check-cfg` documentation. This now has a call out for the sub-page.
2024-06-12Rollup merge of #126353 - compiler-errors:move-match, r=lcnrJubilee-7/+5
Move `MatchAgainstFreshVars` to old solver Small change I noticed when trying to uplift the relations to the new trait solver.
2024-06-12Rollup merge of #126337 - oli-obk:nested_gat_opaque, r=lcnrJubilee-0/+48
Add test for walking order dependent opaque type behaviour r? ```@lcnr``` adding the test for your comment here: https://github.com/rust-lang/rust/pull/122366/files#r1521124754
2024-06-12Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubileeJubilee-11/+41
Add Option::is_none_or ACP: https://github.com/rust-lang/libs-team/issues/212
2024-06-12Rollup merge of #126303 - sancho20021:patch-1, r=compiler-errorsJubilee-0/+14
Urls to docs in rust_hir <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-12Rollup merge of #126142 - compiler-errors:trait-ref-split, r=jackh726Jubilee-119/+163
Harmonize using root or leaf obligation in trait error reporting When #121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation. Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation. This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓 r? ``@estebank`` Fixes #126129
2024-06-12Rollup merge of #125688 - compiler-errors:alias-reporting, r=lcnrJubilee-40/+114
Walk into alias-eq nested goals even if normalization fails Somewhat broken due to the fact that we don't handle aliases well, nor do we handle ambiguities well. Still want to put up this incremental piece, since it improves type errors for projections whose trait refs are not satisfied. r? lcnr
2024-06-12Rollup merge of #125674 - Oneirical:another-day-another-test, r=jieyouxuJubilee-36/+81
Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc
2024-06-13Auto merge of #125165 - Oneirical:pgo-branch-weights, r=jieyouxubors-42/+215
Migrate `run-make/pgo-branch-weights` to `rmake` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). This is a scary one and I expect things to break. Set as draft, because this isn't ready. - [x] There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run... > // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works // properly. Since we only have GCC on the CI ignore the test for now." EDIT: This is specific to Windows-gnu. - [x] The Makefile has this line: ``` ifneq (,$(findstring x86,$(TARGET))) COMMON_FLAGS=-Clink-args=-fuse-ld=gold ``` I honestly can't tell whether this is checking if the target IS x86, or IS NOT. EDIT: It's checking if it IS x86. - [x] I don't know why the Makefile was trying to pass an argument directly in the Makefile instead of setting that "aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc" input as a variable in the Rust program directly. I changed that, let me know if that was wrong. - [x] Trying to rewrite `cat "$(TMPDIR)/interesting.ll" | "$(LLVM_FILECHECK)" filecheck-patterns.txt` resulted in some butchery. For starters, in `tools.mk`, LLVM_FILECHECK corrects its own backslashes on Windows distributions, but there is no further mention of it, so I assume this is a preset environment variable... but is it really? Then, the command itself uses a Standard Input and a passed input file as an argument simultaneously, according to the [documentation](https://llvm.org/docs/CommandGuide/FileCheck.html#synopsis). try-job: aarch64-gnu
2024-06-13compiletest: Stricter parsing of `//@ normalize-*` headersZalathar-51/+63
2024-06-13safe transmute: support `Variants::Single` enumsJack Wrenn-59/+81
Previously, the implementation of `Tree::from_enum` incorrectly treated enums with `Variants::Single` and `Variants::Multiple` identically. This is incorrect for `Variants::Single` enums, which delegate their layout to that of a variant with a particular index (or no variant at all if the enum is empty). This flaw manifested first as an ICE. `Tree::from_enum` attempted to compute the tag of variants other than the one at `Variants::Single`'s `index`, and fell afoul of a sanity-checking assertion in `compiler/rustc_const_eval/src/interpret/discriminant.rs`. This assertion is non-load-bearing, and can be removed; the routine its in is well-behaved even without it. With the assertion removed, the proximate issue becomes apparent: calling `Tree::from_variant` on a variant that does not exist is ill-defined. A sanity check the given variant has `FieldShapes::Arbitrary` fails, and the analysis is (correctly) aborted with `Err::NotYetSupported`. This commit corrects this chain of failures by ensuring that `Tree::from_variant` is not called on variants that are, as far as layout is concerned, nonexistent. Specifically, the implementation of `Tree::from_enum` is now partitioned into three cases: 1. enums that are uninhabited 2. enums for which all but one variant is uninhabited 3. enums with multiple inhabited variants `Tree::from_variant` is now only invoked in the third case. In the first case, `Tree::uninhabited()` is produced. In the second case, the layout is delegated to `Variants::Single`'s index. Fixes #125811
2024-06-13compiletest: Move `static_regex!` into `compiletest::util`Zalathar-10/+11
2024-06-12Rebase falloutMichael Goulet-9/+10
2024-06-13Add urls to rust lang referenceAleksandr Pak-0/+14
2024-06-12Stop passing traitref/traitpredicate by refMichael Goulet-38/+33
2024-06-12Stop passing both trait pred and trait refMichael Goulet-16/+18
2024-06-12Bless and add ICE regression testMichael Goulet-0/+36
2024-06-12Harmonize use of leaf and root obligation in trait error reportingMichael Goulet-64/+74
2024-06-12Add a new trait to retrieve StableMir definition TyCelina G. Val-10/+177
We implement the trait only for definitions that should have a type. It's possible that I missed a few definitions, but we can add them later if needed.
2024-06-12Auto merge of #125069 - amandasystems:scc-refactor, r=nikomatsakisbors-337/+670
Extend SCC construction to enable extra functionality Do YOU feel like your SCC construction doesn't do enough? Then I have a patch for you! SCCs can now do *everything*! Well, almost. This patch has been extracted from #123720. It specifically enhances `Sccs` to allow tracking arbitrary commutative properties (think min/max mappings on nodes vs arbitrary closures) of strongly connected components, including - reachable values (max/min) - SCC-internal values (max/min) This helps with among other things universe computation. We can now identify SCC universes as a reasonably straightforward "find max/min" operation during SCC construction. This is also included in this patch. It's also more or less zero-cost; don't use the new features, don't pay for them. This commit also vastly extends the documentation of the SCCs module, which I had a very hard time following. It may or may not have gotten easier to read for someone else. I believe this logic can also be used in leak check, but haven't checked. Ha. ha. Ha.
2024-06-12Make `try_from_target_usize` method publicArtem Agvanian-1/+1
There is now no way to create a TyConst from an integer, so I propose making this method public unless there was a reason for keeping it otherwise.
2024-06-12Also passthrough for projection clausesMichael Goulet-18/+15
2024-06-12better error message for normalizes-to ambiguitiesMichael Goulet-10/+26
2024-06-12Walk into alias-eq nested goals even if normalization failsMichael Goulet-22/+83
2024-06-12docs(rustc): De-emphasize --cfg/--check-cfg noteEd Page-3/+3
At the suggestion of @Urgau
2024-06-12Auto merge of #126345 - compiler-errors:rollup-lue8u92, r=compiler-errorsbors-113/+251
Rollup of 8 pull requests Successful merges: - #125869 (Add `target_env = "p1"` to the `wasm32-wasip1` target) - #126019 (Add TODO comment to unsafe env modification) - #126036 (Migrate `run-make/short-ice` to `rmake`) - #126276 (Detect pub structs never constructed even though they impl pub trait with assoc constants) - #126282 (Ensure self-contained linker is only enabled on dev/nightly ) - #126317 (Avoid a bunch of booleans in favor of Result<(), ErrorGuaranteed> as that more robustly proves that an error has been emitted) - #126324 (Adjust LoongArch64 data layouts for LLVM update) - #126340 (Fix outdated predacates_of.rs comments) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-12docs(rustc): Link unexpected_cfgs to the Cargo.toml docsEd Page-0/+4
This is the first time we have a lint with configuration exposed in `Cargo.toml`. When this was done, interest was expressed in using this for other cases in the future. To this end, we need to make the documentation for the lint configuration discoverable from the documentation for that lint.
2024-06-12Move MatchAgainstFreshVars to old solverMichael Goulet-7/+5
2024-06-12docs(rustc): Help users to check-cfg Cargo docsEd Page-0/+3
2024-06-13Simplify `try_*` on `Iterator`Slanterns-10/+11
2024-06-12Improve error message if dependency installation in tidy failsJakub Beránek-2/+7
2024-06-12Rollup merge of #126340 - fee1-dead-contrib:fix-predicates_of-comments, ↵Michael Goulet-5/+4
r=compiler-errors Fix outdated predacates_of.rs comments <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-12Rollup merge of #126324 - zmodem:loongarch, r=nikicMichael Goulet-4/+12
Adjust LoongArch64 data layouts for LLVM update The data layout was changed in LLVM 19: llvm/llvm-project#93814
2024-06-12Rollup merge of #126317 - oli-obk:recursive_rpit4, r=compiler-errorsMichael Goulet-48/+51
Avoid a bunch of booleans in favor of Result<(), ErrorGuaranteed> as that more robustly proves that an error has been emitted pulled out of https://github.com/rust-lang/rust/pull/126316 This PR cannot have any effect on compilation. All it does is shift a `Ty::new_misc_error` to a `span_delayed_bug` and preserve the `ErrorGuaranteed` in all other cases
2024-06-12Rollup merge of #126282 - lqd:contain-the-self-contained-linker, ↵Michael Goulet-1/+3
r=Mark-Simulacrum Ensure self-contained linker is only enabled on dev/nightly This is a version of #126278 for the master branch. It should be no-op _here_, compared to beta. I'll r? `@Mark-Simulacrum` like the other one.
2024-06-12Rollup merge of #126276 - mu001999-contrib:dead/enhance, r=fee1-deadMichael Goulet-2/+80
Detect pub structs never constructed even though they impl pub trait with assoc constants Extend dead code analysis to impl items of pub assoc constants. <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->