about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-02Adjust tests to use minicore and reblessJieyou Xu-194/+178
2024-11-02Add more core stubs to `minicore`Jieyou Xu-2/+11
`f32`, `f64` and `asm!` macro.
2024-11-02Add bad-reg inline assembly ui test for RISC-V and s390xTaiki Endo-0/+1338
2024-11-02Auto merge of #132475 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 18 commits in e75214ea4936d2f2c909a71a1237042cc0e14b07..0310497822a7a673a330a5dd068b7aaa579a265e 2024-10-25 16:34:32 +0000 to 2024-11-01 19:27:56 +0000 - Add more metadata to `rustc_fingerprint` (rust-lang/cargo#14761) - test(rustfix): switch to a simpler case for dedup-suggestions (rust-lang/cargo#14765) - chore(deps): update rust crate security-framework to v3 (rust-lang/cargo#14766) - chore(deps): update rust crate gix to 0.67.0 (rust-lang/cargo#14762) - fix(util): Respect all `..`s in `normalize_path` (rust-lang/cargo#14750) - test(doc): Resolve flaky test (rust-lang/cargo#14760) - refactor(test): Remove dead 'expect_stdout_contains_n' check (rust-lang/cargo#14759) - add unstable -Zroot-dir flag to configure the path from which rustc should be invoked (rust-lang/cargo#14752) - docs(resolver): Further v3 prep (rust-lang/cargo#14753) - fix: track version in fingerprint dep-info files (rust-lang/cargo#14751) - test: Remove unused msrv-policy (rust-lang/cargo#14748) - download targeted transitive deps of with artifact deps' target platform (rust-lang/cargo#14723) - Remove requirement for --target when invoking Cargo with -Zbuild-std (rust-lang/cargo#14317) - docs(fingerprint): document the encoding of Cargo's depinfo (rust-lang/cargo#14745) - Allow build scripts to report error messages through `cargo::error` (rust-lang/cargo#14743) - fix(publish): Downgrade version-exists error to warning on dry-run (rust-lang/cargo#14742) - fix: clean up for deprecated and removed commands (rust-lang/cargo#14739) - Deprecate `cargo verify-project` (rust-lang/cargo#14736)
2024-11-01Update cargoWeihang Lo-0/+0
2024-11-01Auto merge of #132470 - GuillaumeGomez:rollup-1a1mkmp, r=GuillaumeGomezbors-310/+837
Rollup of 14 pull requests Successful merges: - #131829 (Remove support for `-Zprofile` (gcov-style coverage instrumentation)) - #132369 (style-guide: Only use the new binop heuristic for assignments) - #132383 (Implement suggestion for never type fallback lints) - #132413 (update offset_of! docs to reflect the stabilization of nesting) - #132438 (Remove unncessary option for default rust-analyzer setting) - #132439 (Add `f16` and `f128` to `invalid_nan_comparison`) - #132444 (rustdoc: Directly use rustc_abi instead of reexports) - #132445 (Cleanup attributes around unchecked shifts and unchecked negation in const) - #132448 (Add missing backtick) - #132450 (Show actual MIR when MIR building forgot to terminate block) - #132451 (remove some unnecessary rustc_allow_const_fn_unstable) - #132455 (make const_alloc_layout feature gate only about functions that are already stable) - #132456 (Move remaining inline assembly test files into asm directory) - #132459 (feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-02Rollup merge of #132459 - RalfJung:byte_sub_ptr, r=scottmcmGuillaume Gomez-9/+66
feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr This is an API that naturally should exist as a combination of byte_offset_from and sub_ptr both existing (they showed up at similar times so this union was never made). Adding these is a logical (and perhaps final) precondition of stabilizing ptr_sub_ptr (https://github.com/rust-lang/rust/issues/95892). Original PR by ``@Gankra`` (https://github.com/rust-lang/rust/pull/121919), I am just reviving it. The 2nd commit (with a small docs tweak) is by me.
2024-11-02Rollup merge of #132456 - taiki-e:test-asm-dir, r=jieyouxuGuillaume Gomez-0/+0
Move remaining inline assembly test files into asm directory Before: ``` tests/assembly/asm/* tests/assembly/asm-comments.rs tests/codegen/asm-target-clobbers.rs tests/codegen/asm-goto.rs tests/codegen/asm-maybe-uninit.rs tests/codegen/asm-msp430-clobbers.rs tests/codegen/asm-options.rs tests/codegen/asm-clobbers.rs tests/codegen/asm-may_unwind.rs tests/codegen/asm-arm64ec-clobbers.rs tests/codegen/asm-powerpc-clobbers.rs tests/codegen/asm-sanitize-llvm.rs tests/codegen/asm-s390x-clobbers.rs tests/codegen/asm-clobber_abi.rs tests/codegen/asm-multiple-options.rs tests/codegen/global_asm.rs tests/codegen/global_asm_include.rs tests/codegen/global_asm_x2.rs tests/ui/asm/* ``` After: ``` tests/assembly/asm/* tests/codegen/asm/* tests/ui/asm/* ``` I moved the remaining standalone test files into the asm directory, and then either removed the "asm-" suffix or for x86-specific registers tests replaced the "asm-" suffix with the "x86-" suffix. (Then I noticed that there is no test for clobber_abi for already stabilized aarch64, arm, riscv, and loongarch64 asm... I don't believe there is a problem like https://github.com/rust-lang/rust/pull/131332, but I plan to add tests for them later.) r? ``@Amanieu`` ``@rustbot`` label +A-inline-assembly
2024-11-02Rollup merge of #132455 - RalfJung:const_alloc_layout, r=dtolnayGuillaume Gomez-6/+5
make const_alloc_layout feature gate only about functions that are already stable The const_alloc_layout feature gate has two kinds of functions: those that are stable, but not yet const-stable, and those that are fully unstable. I think we should split that up. So this PR makes const_alloc_layout just about functions that are already stable but waiting for const-stability; all the other functions now have their constness guarded by the gate that also guards their regular stability. Cc https://github.com/rust-lang/rust/issues/67521
2024-11-02Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable, ↵Guillaume Gomez-8/+0
r=tgross35 remove some unnecessary rustc_allow_const_fn_unstable These are either unstable functions that don't need the attribute, or the attribute refers to a feature that is already stable.
2024-11-02Rollup merge of #132450 - bjorn3:better_mir_errors, r=jieyouxuGuillaume Gomez-28/+41
Show actual MIR when MIR building forgot to terminate block This makes it significantly easier to debug bugs of this kind.
2024-11-02Rollup merge of #132448 - chengehe:master, r=NoratriebGuillaume Gomez-1/+1
Add missing backtick
2024-11-02Rollup merge of #132445 - RalfJung:const-unchecked-shifts, r=tgross35Guillaume Gomez-20/+16
Cleanup attributes around unchecked shifts and unchecked negation in const The underlying intrinsic is marked as "safe to expose on stable", so we shouldn't need any `rustc_allow_const_fn_unstable(unchecked_shifts)` anywhere. However, bootstrap rustc doesn't yet have the new const stability checks, so these changes only apply under `cfg(not(bootstrap))`.
2024-11-02Rollup merge of #132444 - workingjubilee:rustdoc-my-abi, r=GuillaumeGomezGuillaume Gomez-20/+19
rustdoc: Directly use rustc_abi instead of reexports rustc_target reexports a lot of things that are in rustc_abi, but that will be over soon and now is probably a good time to switch. Uses of rustc_target remain where they inquire about the target tuple.
2024-11-02Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxuGuillaume Gomez-30/+299
Add `f16` and `f128` to `invalid_nan_comparison` Currently `f32_nan` and `f64_nan` are used to provide the `invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`, hook these up so the new float types get the same lints.
2024-11-02Rollup merge of #132438 - chenyukang:yukang-fix-analyzer_settings, r=jieyouxuGuillaume Gomez-2/+1
Remove unncessary option for default rust-analyzer setting In favor of https://github.com/rust-lang/rust-analyzer/pull/17888
2024-11-02Rollup merge of #132413 - lolbinarycat:offset_of_nested-docs, r=workingjubileeGuillaume Gomez-5/+3
update offset_of! docs to reflect the stabilization of nesting this seems to have been missed.
2024-11-02Rollup merge of #132383 - compiler-errors:never-type-fallback-sugg, ↵Guillaume Gomez-24/+370
r=WaffleLapkin Implement suggestion for never type fallback lints r? ```@WaffleLapkin``` Just opening this up for vibes; it's not done yet. I'd still like to make this suggestable in a few more cases before merge: - [x] Try to annotate `_` -> `()` - [x] Try to annotate local variables if they're un-annotated: `let x = ...` -> `let x: () = ...` - [x] Try to annotate the self type of a `Trait::method()` -> `<() as Trait>::method()`. The only other case we may want to suggest is a missing turbofish, like `f()` -> `f::<()>()`. That may be possible, but seems overly annoying. This partly addresses https://github.com/rust-lang/rust/issues/132358; the other half of fixing that would be to make the error message a bit better, perhaps just special casing the `?` operator 🤔 I don't think I'll do that part.
2024-11-02Rollup merge of #132369 - ↵Guillaume Gomez-11/+6
joshtriplett:style-guide-binop-heuristic-assignment-only, r=calebcartwright style-guide: Only use the new binop heuristic for assignments This avoids pathological cases where chains of binops get progressively deeper.
2024-11-02Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukangGuillaume Gomez-146/+10
Remove support for `-Zprofile` (gcov-style coverage instrumentation) Tracking issue: #42524 MCP: https://github.com/rust-lang/compiler-team/issues/798 --- This PR removes the unstable `-Zprofile` flag, which enables ”gcov-style” coverage instrumentation, along with its associated `-Zprofile-emit` configuration flag. (The profile flag predates and is almost entirely separate from the stable `-Cinstrument-coverage` flag.) Notably, the `-Zprofile` flag: - Is largely untested in-tree, having only one run-make test that does not check whether its output is correct or useful. - Has no known maintainer. - Has seen no push towards stabilization. - Has at least one severe regression reported in 2022 that apparently remains unaddressed. - #100125 - Is confusingly named, since it appears to be more about coverage than performance profiling, and has nothing to do with PGO. - Is fundamentally limited by relying on counters auto-inserted by LLVM, with no knowledge of Rust beyond debuginfo.
2024-11-01Auto merge of #132276 - compiler-errors:enforce-fx-in-mir, r=fee1-deadbors-55/+186
Double-check conditional constness in MIR To prevent any unchecked `~const` bounds from leaking through during MIR lowering. If this check fails, it will eventually just delay a bug, but for now it reports errors. That error reporting may be redundant if we're calling it from code that already doesn't allow `~const` (i.e. when the `effects` and `const_trait_impl` gates are disabled), but I don't think it's that big of a deal. edit: This also makes sure that we issue a const stability error if we encounter *any* function with const conditions when `const_trait_impl` is not enabled. This ensures that that feature remains airtight.
2024-11-01rustdoc: Directly use rustc_abi instead of reexportsJubilee Young-20/+19
rustc_target reexports a lot of things that are in rustc_abi, but that will be over soon and now is probably a good time to switch. Uses of rustc_target remain where they inquire about the target tuple.
2024-11-01Completely deny calling functions with const conditions in MIR const check ↵Michael Goulet-41/+129
unless const_trait_impl is enabled This will help us make sure that we never leak any conditionally const functions into stable.
2024-11-01Double-check conditional constness in MIRMichael Goulet-29/+72
To prevent any conditional constness from leaking through during MIR lowering
2024-11-01Auto merge of #132196 - compiler-errors:probe_ty_param_bounds, r=petrochenkovbors-49/+94
Some where clause lowering simplifications Rename `PredicateFilter::SelfThatDefines` to `PredicateFilter::SelfTraitThatDefines` to make it clear that it's only concerned with converting *traits*, and make it do a bit less work when converting bounds. Also, make the predicate filter matching in `probe_ty_param_bounds_in_generics` explicit, and simply the args it receives a bit.
2024-11-01offset_from / sub_ptr docs: emphasize that pointers must be in the same ↵Ralf Jung-12/+12
allocation
2024-11-01feat(byte_sub_ptr): add ptr::byte_sub_ptrAria Beingessner-0/+57
This is an API that naturally should exist as a combination of byte_offset_from and sub_ptr both existing (they showed up at similar times so this union was never made). Adding these is a logical (and perhaps final) precondition of stabilizing ptr_sub_ptr (#95892).
2024-11-01make const_alloc_layout feature gate only about functions that are already ↵Ralf Jung-6/+5
stable the rest has their constness guarded by their usual feature gate
2024-11-01Move remaining inline assembly test files into asm directoryTaiki Endo-0/+0
2024-11-01unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, so we ↵Ralf Jung-20/+16
can get rid of a bunch of attributes
2024-11-01remove some unnecessary rustc_allow_const_fn_unstableRalf Jung-8/+0
2024-11-01Show actual MIR when MIR building forgot to terminate blockbjorn3-28/+41
This makes it significantly easier to debug bugs of this kind.
2024-11-01Add missing backtickchengehe-1/+1
2024-11-01Auto merge of #132402 - bjorn3:remove_snap_decompression, r=jieyouxu,Veykrilbors-58/+8
Remove support for decompressing dylib metadata We haven't been compressing dylib metadata for a while now. Removing decompression support will regress error messages about an incompatible rustc version being used, but dylibs are pretty rare anyway. Fixes https://github.com/rust-lang/rust-analyzer/issues/18451
2024-11-01Auto merge of #131634 - davidlattimore:lld-protected, r=Kobzolbors-0/+8
Use protected visibility when building rustc with LLD https://github.com/rust-lang/compiler-team/issues/782 I wasn't sure about having two commits in a PR, but I figured, at least initially it might make sense to discuss these commits together. Happy to squash, or move the second commit to a separate PR. I contemplated trying to enable protected visibility for more cases when LLD will be used other than just `-Zlinker-features=+lld`, but that would be more a complex change that probably still wouldn't cover all cases when LLD is used, so went with the simplest option of just checking if the linker-feature is enabled. r? lqd
2024-11-01Remove unncessary option for default rust-analyzer settingyukang-2/+1
2024-10-31Add `f16` and `f128` to `invalid_nan_comparison`Trevor Gross-30/+299
Currently `f32_nan` and `f64_nan` are used to provide the `invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`, hook these up so the new float types get the same lints.
2024-11-01Auto merge of #132435 - workingjubilee:rollup-3mgogw9, r=workingjubileebors-220/+364
Rollup of 9 pull requests Successful merges: - #131168 (Fix `target_os` for `mipsel-sony-psx`) - #132209 (Fix validation when lowering `?` trait bounds) - #132294 (Bump Fuchsia) - #132357 (Improve missing_abi lint) - #132385 (compiler: Move `rustc_target::spec::abi::Abi` to `rustc_abi::ExternAbi`) - #132403 (continue `TypingMode` refactor) - #132417 (macOS: Document the difference between Clang's `-darwin` and `-macosx` targets) - #132421 (Remove `""` case from RISC-V `llvm_abiname` match statement) - #132422 (llvm: Match new LLVM 128-bit integer alignment on sparc) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-01nitsMichael Goulet-10/+20
2024-11-01And also suggest for qpathsMichael Goulet-0/+151
2024-11-01And locals tooMichael Goulet-6/+31
2024-11-01Suggest adding self type to methodMichael Goulet-7/+55
2024-11-01Suggest annotations for never type fallbackMichael Goulet-12/+125
2024-11-01nit: stop using TypeckRootCtxtMichael Goulet-12/+11
2024-10-31Rollup merge of #132422 - maurer:sparc-layout, r=durin42Jubilee-6/+11
llvm: Match new LLVM 128-bit integer alignment on sparc LLVM continues to align more 128-bit integers to 128-bits in the data layout rather than relying on the high level language to do it. Update SPARC target files to match and add a backcompat replacement for current LLVMs. See llvm/llvm-project#106951 for details `@rustbot` label: +llvm-main r? `@durin42` (Please wait for the LLVM CI to come back before approving), creating this PR to get it tested there.
2024-10-31Rollup merge of #132421 - beetrees:riscv-abi-no-empty-string, r=workingjubileeJubilee-1/+1
Remove `""` case from RISC-V `llvm_abiname` match statement For RISC-V, `""` isn't the always the same ABI as `"ilp32"`/`"lp64"` (`""` means LLVM will infer the ABI based on the enabled target features), but `create_object_file` currently assumes that it is. Since all RISC-V targets explicitly specify their ABI since #131807, this PR removes `""` from the match arm's pattern (meaning an empty string will now fall through to the `_ => bug!` arm). r? `@workingjubilee`
2024-10-31Rollup merge of #132417 - madsmtm:document-darwin-macos-difference, r=jieyouxuJubilee-0/+5
macOS: Document the difference between Clang's `-darwin` and `-macosx` targets `rustc`'s `*-apple-darwin` targets are badly named (they should've been called `*-apple-macos`), and this causes confusion wrt. the similarly named but somewhat incompatible Clang targets. So let's document the difference to at least make things a _little_ easier on our users. ``@rustbot`` label O-macos A-docs
2024-10-31Rollup merge of #132403 - lcnr:typing-mode, r=compiler-errorsJubilee-105/+155
continue `TypingMode` refactor There are still quite a few places which (indirectly) rely on the `Reveal` of a `ParamEnv`, but we're slowly getting there r? `@compiler-errors`
2024-10-31Rollup merge of #132385 - workingjubilee:move-abi-to-rustc-abi, ↵Jubilee-25/+47
r=jieyouxu,compiler-errors compiler: Move `rustc_target::spec::abi::Abi` to `rustc_abi::ExternAbi` Lift `enum Abi` from its rather odd place in the middle of rustc_target, and make it available again from rustc_abi. You know, the crate where you would expect the enum that describes all the ABIs to be? The platform-neutral ones, at least. This will help further refactoring of how we handle ABIs in the near future[^0]. Rename `Abi` to `ExternAbi` because quite a lot of the compiler overloads the concept of "ABI" enough that the existing name is imprecise and it is often renamed _anyway_. Often this was to avoid conflicts with the *other* type formerly known as `Abi` (now named BackendRepr[^1]), but sometimes it is just for clarity, and this name seems more self-explanatory. It does get reexported, though, using its old name, to reduce the odds of merge-conflicting over the entire tree. All of `ExternAbi`'s friends come along for the ride, which costs adding some optional dependencies to the rustc_abi crate. However, all of this also allows simply moving three crates entirely off rustc_target: - rustc_hir_pretty - rustc_lint_defs - rustc_mir_build This odd selection is mostly to demonstrate a secondary motivation: The majority of the front-end of the compiler should be as target-agnostic as possible, and it is easier to assure this if they simply don't depend on the crate that describes targets. Note that I didn't migrate crates that don't benefit from it in this way yet, and I didn't survey every last crate. [^0]: This is being undertaken as part of https://github.com/rust-lang/rust/issues/119183 [^1]: https://github.com/rust-lang/rust/pull/132246
2024-10-31Rollup merge of #132357 - m-ou-se:explicit-abi, r=compiler-errorsJubilee-19/+17
Improve missing_abi lint This is for the migration lint for https://github.com/rust-lang/rfcs/pull/3722 It is not yet marked as an edition migration lint, because `Edition2027` doesn't exist yet. The lint now includes a machine applicable suggestion: ``` warning: extern declarations without an explicit ABI are deprecated --> src/main.rs:3:1 | 3 | extern fn a() {} | ^^^^^^ help: explicitly specify the C ABI: `extern "C"` | ```