about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-04Rollup merge of #132559 - bvanjoi:fix-132534, r=compiler-errorsMatthias Krüger-8/+60
find the generic container rather than simply looking up for the assoc with const arg Fixes #132534 This issue is caused by mismatched generic parameters. Previously, it tried to find `T` in `trait X`, but after this change, it will find `T` in `fn a`. r? `@compiler-errors` as this assertion was introduced by you.
2024-11-04Rollup merge of #132544 - dianne:unstable-library-feature-backticks, ↵Matthias Krüger-431/+433
r=compiler-errors Use backticks instead of single quotes for library feature names in diagnostics This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since `DiagSymbolList` also displays symbols using backticks.
2024-11-04Rollup merge of #132486 - compiler-errors:no-binder, r=lcnrMatthias Krüger-9/+3
No need to instantiate binder in `confirm_async_closure_candidate` Removes a FIXME that is redundant. No longer needed since #122267.
2024-11-04Rollup merge of #132355 - practicalrs:fix_117638, r=SparrowLiiMatthias Krüger-3/+12
Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here https://github.com/rust-lang/rust/issues/117638 using the solution suggested in this comment https://github.com/rust-lang/rust/issues/117638#issuecomment-1800925067 Best regards, Michal
2024-11-04Auto merge of #132275 - compiler-errors:deref-effects, r=fee1-deadbors-141/+140
Register `~const` preds for `Deref` adjustments in HIR typeck This doesn't *do* anything yet, since `Deref` and `DerefMut` aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing `~const` in HIR typeck. r? fee1-dead
2024-11-04Auto merge of #132250 - nnethercote:rustc_borrowck-cleanups, r=compiler-errorsbors-385/+251
`rustc_borrowck` cleanups A bunch of cleanups I made while reading over this crate. r? `@lqd`
2024-11-04Auto merge of #132586 - workingjubilee:rollup-qrmn49a, r=workingjubileebors-1151/+286
Rollup of 4 pull requests Successful merges: - #131222 (Generate correct symbols.o for sparc-unknown-none-elf) - #132423 (remove const-support for align_offset and is_aligned) - #132565 (Reduce dependence on the target name) - #132576 (remove attribute ids from hir stats (they're simply not needed)) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-04`BorrowckDiags` tweaks.Nicholas Nethercote-13/+5
- Store a mut ref to a `BorrowckDiags` in `MirBorrowckCtxt` instead of owning it, to save having to pass ownership in and out of `promoted_mbcx`. - Use `buffer_error` in a couple of suitable places.
2024-11-04Simplify `LocalUseMapBuild`.Nicholas Nethercote-48/+14
It has four different `insert` methods, with some duplication. This commit finds the commonality and removes them all.
2024-11-04Merge `BorrowCheckContext` into `TypeChecker`.Nicholas Nethercote-173/+88
Because there is no real reason for it to be a separate struct. - It has no methods. - It's easy to confuse with the nearby `BorrowckInferContext` (which does have methods). - The `mut` ref to it in `TypeChecker` makes it seem like any of the fields within might be mutable, but only two (`all_facts` and `constraints`) actually are. - Two of the fields are `pub(crate)` but can be private. This change makes a lot of code more concise and readable.
2024-11-04Remove unnecessary qualifiers.Nicholas Nethercote-3/+3
2024-11-04Remove unnecessary `continue`.Nicholas Nethercote-2/+1
2024-11-04Remove `ToUniverseInfo` impl for `CanonicalQueryInput<CustomTypeOp>`.Nicholas Nethercote-9/+0
It's unused.
2024-11-04Merge `UniverseInfo` and `UniverseInfoInner`.Nicholas Nethercote-25/+13
It's strange to have a struct that contains a single anonymous field that is an enum. This commit merges them. This does require increasing the visibility of `TypeOfInfo` to `pub(crate)`, but that seems worthwhile.
2024-11-04Tidy up comments and some formatting.Nicholas Nethercote-78/+92
Mostly by wrapping overly long comment lines, plus a few other things.
2024-11-04Move some `use` declarations.Nicholas Nethercote-13/+12
So they're all in the one place. Also prepend with `crate::`, à la the `unqualified_local_imports` lint.
2024-11-04Fix minicore, add tests based off of itMichael Goulet-129/+97
2024-11-04Make sure to enforce ~const DerefMut on mutability fixupMichael Goulet-0/+1
2024-11-04Register const preds for Deref adjustments in HIR typeckMichael Goulet-12/+42
2024-11-04Reduce visibilities.Nicholas Nethercote-21/+23
2024-11-04find the generic container rather than simply looking up for the assoc with ↵bohan-8/+60
const arg
2024-11-03Rollup merge of #132576 - jdonszelmann:no-attrid-in-stats, r=nnethercoteJubilee-80/+76
remove attribute ids from hir stats (they're simply not needed) Turns out these are simply not needed. Yay! r? `@nnethercote`
2024-11-03Rollup merge of #132565 - bjorn3:less_target_name_dependence, r=workingjubileeJubilee-50/+18
Reduce dependence on the target name The target name can be anything with custom target specs. Matching on fields inside the target spec is much more robust than matching on the target name. Also remove the unused is_builtin target spec field.
2024-11-03Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnayJubilee-1020/+183
remove const-support for align_offset and is_aligned As part of the recent discussion to stabilize `ptr.is_null()` in const context, the general vibe was that it's okay for a const function to panic when the same operation would work at runtime (that's just a case of "dynamically detecting that something is not supported as a const operation"), but it is *not* okay for a const function to just return a different result. Following that, `is_aligned` and `is_aligned_to` have their const status revoked in this PR, since they do return actively wrong results at const time. In the future we can consider having a new intrinsic or so that can check whether a pointer is "guaranteed to be aligned", but the current implementation based on `align_offset` does not have the behavior we want. In fact `align_offset` itself behaves quite strangely in const, and that support needs a bunch of special hacks. That doesn't seem worth it. Instead, the users that can fall back to a different implementation should just use const_eval_select directly, and everything else should not be made const-callable. So this PR does exactly that, and entirely removes const support for align_offset. Closes some tracking issues by removing the associated features: Closes https://github.com/rust-lang/rust/issues/90962 Closes https://github.com/rust-lang/rust/issues/104203 Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-11-03Rollup merge of #131222 - thejpster:fix-sparc-v7-symbol-o, r=workingjubileeJubilee-1/+9
Generate correct symbols.o for sparc-unknown-none-elf This fixes #130172 by selecting the correct ELF Machine type for sparc-unknown-none-elf (which has a baseline of SPARC V7).
2024-11-04Auto merge of #132434 - tgross35:f128-tests, r=workingjubileebors-11/+16
Update `compiler-builtins` and enable f128 tests on all non-buggy platforms Update compiler_builtins to 0.1.138 and pin it. This updates to a new version of builtins that includes [1], which was the last blocker to us enabling `f128` tests on all platforms. With that, we now provide symbols necessary to work with `f128` everywhere. This means that we are no longer restricted to systems that provide `f128` symbols themselves, and can enable tests by default. There are still a handful of platforms that need to remain disabled because of bugs and some that had to get updated. Math support is still off by default since those symbols are not yet available. [1]: https://github.com/rust-lang/compiler-builtins/pull/624 try-job: test-various try-job: i686-gnu-nopt
2024-11-03Enable `f128` tests on all non-buggy platforms 🎉Trevor Gross-7/+12
With the `compiler-builtins` update to 0.1.137 [1], we now provide symbols necessary to work with `f128` everywhere. This means that we are no longer restricted to 64-bit linux, and can enable tests by default. There are still a handful of platforms that need to remain disabled because of bugs. This patch additionally disables the following: 1. MIPS [2] 2. 32-bit x86 [3] Math support is still off by default since those symbols are not yet available. [1]: https://github.com/rust-lang/rust/pull/132433 [2]: https://github.com/llvm/llvm-project/issues/96432 [3]: https://github.com/llvm/llvm-project/issues/77401
2024-11-04Auto merge of #132581 - workingjubilee:rollup-4wj318p, r=workingjubileebors-496/+1810
Rollup of 6 pull requests Successful merges: - #126136 (Call the target libdir target libdir) - #132516 (Add bad-reg inline assembly ui test for RISC-V and s390x) - #132521 (replace manual time convertions with std ones, comptime time format parsing) - #132560 (Remove outdated tidy license fixmes) - #132563 (Modify `NonZero` documentation to reference the underlying integer type) - #132574 (compiler: Directly use rustc_abi almost everywhere) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-03Update `compiler_builtins` to 0.1.138 and pin itTrevor Gross-4/+4
This updates to a new version of builtins that includes [1], which was the last blocker to us enabling `f128` tests on all platforms 🎉. With this update, also change to pinning the version with `=` rather than using the default carat versioning. This is meant to ensure that `compiler-builtins` does not get updated as part of the weekly `Cargo.lock` update, since updates to this crate need to be intentional: changes to rust-lang/rust and rust-lang/compiler-builtins sometimes need to be kept in lockstep, unlike most dependencies, and sometimes these updates can be problematic. [1]: https://github.com/rust-lang/compiler-builtins/pull/624
2024-11-03Rollup merge of #132574 - workingjubilee:abi-in-compiler, r=compiler-errorsJubilee-385/+363
compiler: Directly use rustc_abi almost everywhere Use rustc_abi instead of rustc_target where applicable. This is mostly described by the following substitutions: ```rust match path_substring { rustc_target::spec::abi::Abi => rustc_abi::ExternAbi, rustc_target::abi::call => rustc_target::callconv, rustc_target::abi => rustc_abi, } ``` A number of spot-fixes make that not quite the whole story. The main exception is in 33edc68 where I get a lot more persnickety about how things are imported, especially in `rustc_middle::ty::layout`, not just from where. This includes putting an end to a reexport of `rustc_middle::ty::ReprOptions`, for the same reason that the rest of this change is happening: reexports mostly confound things. This notably omits rustc_passes and the ast crates, as I'm still examining a question I have about how they do stability checking of `extern "Abi"` strings and if I can simplify their logic. The rustc_abi and rustc_target crates also go untouched because they will be entangled in that cleanup. r? compiler-errors
2024-11-03Rollup merge of #132563 - frectonz:master, r=AmanieuJubilee-1/+9
Modify `NonZero` documentation to reference the underlying integer type This change updates the documentation for `NonZero` integer types to explicitly reference the underlying integer type each `NonZero` variant wraps, instead of using a general "integer" term. **Before** ![image](https://github.com/user-attachments/assets/b13bda82-007b-459c-8b22-e27d79005271) **After** ![image](https://github.com/user-attachments/assets/1d7fadc7-dce3-4b84-9b8f-d2bb81c05eb7)
2024-11-03Rollup merge of #132560 - Urgau:tidy-license-deps, r=onur-ozkanJubilee-14/+0
Remove outdated tidy license fixmes ~~This PR re-enables license dependency checking for:~~ - ~~the `backtrace` submodule~~ - ~~and the `portable-simd` subtree~~ ~~The `stdarch` submodule doesn't have a `Cargo.lock` yet so we can't re-enable it.~~ This PR removes outdated tidy license fixmes, https://github.com/rust-lang/rust/pull/132560#issuecomment-2453525276. r? bootstrap
2024-11-03Rollup merge of #132521 - klensy:times, r=compiler-errorsJubilee-16/+10
replace manual time convertions with std ones, comptime time format parsing First commit replaces few manual time conversions with std ones, second makes parsing of time format at compiletime.
2024-11-03Rollup merge of #132516 - taiki-e:asm-ui, r=workingjubileeJubilee-50/+1387
Add bad-reg inline assembly ui test for RISC-V and s390x https://github.com/rust-lang/rust/pull/131341#discussion_r1826555431 > Btw, such unsupported registers are present in most architectures, but only aarch64/arm64ec, x86_64, and not yet merged [sparc/sparc64](https://github.com/rust-lang/rust/pull/132472/files#diff-02aebda3376c2b020265137f9ce2c387669ca5cfecd7d60494275c2387db5114) (and powerpc/powerpc64 by this PR) currently have ui tests for them. I plan to add tests for other arches later. Starting with RISC-V and s390x, which I'm familiar with and relatively easy to check for correctness. (Relevant rustc code are supported_types/def_regs/overlapping_regs in [compiler/rustc_target/src/asm/riscv.rs](https://github.com/rust-lang/rust/blob/588a4203508ed7c76750c96b482641261630ed36/compiler/rustc_target/src/asm/riscv.rs) and [compiler/rustc_target/src/asm/s390x.rs](https://github.com/rust-lang/rust/blob/588a4203508ed7c76750c96b482641261630ed36/compiler/rustc_target/src/asm/s390x.rs).) r? workingjubilee `@rustbot` label +A-inline-assembly
2024-11-03Rollup merge of #126136 - Noratrieb:bootstrap-naming, r=onur-ozkanJubilee-30/+41
Call the target libdir target libdir Because it's the target libdir. `--print` uses the same terminology, and it's a simple way to make it obviously different from `$sysroot/lib`.
2024-11-03Don't test new error messages with the stage 0 compilerdianne-6/+8
This commit can be reverted once the error message changes are in the stage 0 compiler.
2024-11-03Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnaybors-15/+37
Make `std::os::darwin` public I'm not sure of the reasoning behind them not being public before, but I think they should be, just like `std::os::ios` and `std::os::macos` are public. Additionally, I've merged their source code, as it was otherwise just a bunch of unnecessary duplication. Ultimately, I've done this PR to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Since you reviewed https://github.com/rust-lang/rust/pull/121419 r? davidtwco Fixes https://github.com/rust-lang/rust/issues/121640. `@rustbot` label O-tvos O-watchos O-visionos
2024-11-03use backticks instead of single quotes when reporting "use of unstable ↵dianne-425/+425
library feature" This is consistent with all other diagnostics I could find containing features and enables the use of `DiagSymbolList` for generalizing diagnostics for unstable library features to multiple features.
2024-11-03compiler: Remove unused rustc_target from Cargo.tomlsJubilee Young-5/+0
2024-11-03compiler: Replace rustc_target with abi in symbol_manglingJubilee Young-6/+3
2024-11-03compiler: Directly use rustc_abi in sessionJubilee Young-2/+2
2024-11-03compiler: Directly use rustc_abi in lintsJubilee Young-7/+6
2024-11-03compiler: Directly use rustc_abi in ty_utilsJubilee Young-21/+19
2024-11-03compiler: Directly use rustc_abi in smir againJubilee Young-58/+58
2024-11-03compiler: Directly use rustc_abi in mir_transformJubilee Young-44/+45
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-102/+93
Stop reexporting ReprOptions from middle::ty
2024-11-03compiler: Directly use rustc_abi in hir_{analysis,typeck}Jubilee Young-56/+58
2024-11-03compiler: Directly use rustc_abi in const_evalJubilee Young-32/+29
2024-11-03remove attribute ids from hir stats (they're simply not needed)Jonathan Dönszelmann-80/+76
2024-11-03Remove is_builtin target spec fieldbjorn3-24/+1
It is unused.