about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-26Stop passing --lib to cargo testbjorn3-59/+15
This overrides the test=false flag in Cargo.toml and it shouldn't be necessary as --tests is already passed.
2025-02-26Auto merge of #137036 - jieyouxu:drivers-license, r=Kobzolbors-0/+6
Include version number of libs being built in cargo lib metadata (esp. `librustc_driver*.so`) Previously, on a non-stable channel, it's possible for two builds from different versioned sources (e.g. 1.84.0 vs 1.84.1) to produce a `librustc_driver*.so` with the same filename hashes. This causes problems with side-by-side installs wrt. linker search paths because 1.84.1 rustc bin and 1.84.0 rustc bin may try to link to the "same" `librustc_driver*.so` (same filename hash) but fail because the contents of the so is actually different. We try to mitigate this by including the version number of artifacts being built via `__CARGO_DEFAULT_LIB_METADATA` (kind of an ugly hack, but I don't think cargo has a way for us to tell cargo to use a package version override). Fixes #136701 (mitigates, really). ### Testing Tested manually[^host] by: ```bash $ cat src/version 1.86.0 $ ./x build library # w/ compiler profile, (non-stable) dev channel $ lddtree build/host/stage1/bin/rustc rustc => build/host/stage1/bin/rustc (interpreter => /lib64/ld-linux-x86-64.so.2) librustc_driver-ea1b1b2291881cc4.so => build/host/stage1/bin/../lib/librustc_driver-ea1b1b2291881cc4.so [...] ``` and observing that changing `src/version` to bump a point release causes `librustc_driver*.so` to have a different hash while sources are unmodified otherwise. ```bash $ cat src/version 1.86.1 $ ./x build library # w/ compiler profile, (non-stable) dev channel $ lddtree build/host/stage1/bin/rustc rustc => build/host/stage1/bin/rustc (interpreter => /lib64/ld-linux-x86-64.so.2) librustc_driver-746badadbcb74721.so => build/host/stage1/bin/../lib/librustc_driver-746badadbcb74721.so [...] ``` cc `@clan` `@demize` could you check that if you backport this change against 1.84.{0,1} as reported in #136701, that the produced `rustc` binary works, under the context of the Gentoo build system setup? [^host]: on a `x86_64-unknown-linux-gnu` host, no cross
2025-02-26Auto merge of #137651 - fmease:rollup-s3s7m6f, r=fmeasebors-119/+487
Rollup of 14 pull requests Successful merges: - #136576 (pass optimization level to llvm-bitcode-linker) - #137154 (Add UTF-8 validation fast paths in `Wtf8Buf`) - #137311 (Enable `f16` for MIPS) - #137320 (fix(rustdoc): Fixed stability version in rustdoc) - #137529 (remove few unused args) - #137544 (tests: Add regression test for derive token invalidation (#81099)) - #137559 (run some tests on emscripten again) - #137601 (ssa/mono: deduplicate `type_has_metadata`) - #137603 (codegen_llvm: avoid `Deref` impls w/ extern type) - #137604 (trait_sel: resolve vars in host effects) - #137609 (Complete the list of resources used in rustdoc output) - #137613 (hir_analysis: skip self type of host effect preds in variances_of) - #137614 (fix doc in library/core/src/pin.rs) - #137622 (fix attribute-related ICE when parsing macro on the rhs of a name-value attribute) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-26Rollup merge of #137622 - jdonszelmann:fix-137589, r=compiler-errorsLeón Orell Valerian Liehr-6/+87
fix attribute-related ICE when parsing macro on the rhs of a name-value attribute r? ``@oli-obk`` Closes: #137589
2025-02-26Rollup merge of #137614 - xizheyin:issue-134874, r=cuviperLeón Orell Valerian Liehr-2/+2
fix doc in library/core/src/pin.rs Fixes #134874
2025-02-26Rollup merge of #137613 - davidtwco:const-traits-variances, r=compiler-errorsLeón Orell Valerian Liehr-0/+25
hir_analysis: skip self type of host effect preds in variances_of Discovered as part of an implementation of rust-lang/rfcs#3729 - w/out this then when introducing const trait bounds: many more interesting tests change with different output, missing errors, new errors, etc related to this but they all depend on feature flags and are much more complex than this test. r? ``@oli-obk``
2025-02-26Rollup merge of #137609 - ColinPitrat:master, r=GuillaumeGomezLeón Orell Valerian Liehr-0/+21
Complete the list of resources used in rustdoc output The Nanum Barun Gothic Font was missing in the list and should clearly be mentionned. Arguably referencing the Rust logos is not really necessary as the file mentions "third party resources" but it doesn't hurt and should make things clearer for anybody who wants to publish their Rust doc.
2025-02-26Rollup merge of #137604 - davidtwco:host-effect-resolve-vars, r=compiler-errorsLeón Orell Valerian Liehr-0/+38
trait_sel: resolve vars in host effects In the standard library, the `Extend` impl for `Iterator` (specialised with `TrustedLen`) has a parameter which is constrained by a projection predicate. This projection predicate provides a value for an inference variable but - if the default bound is `const Sized` instead of `Sized` - host effect evaluation wasn't resolving variables first. Added a test that doesn't depend on a rust-lang/rfcs#3729 implementation. Adding the extra resolve can the number of errors in some tests when they gain host effect predicates, but this is not unexpected as calls to `resolve_vars_if_possible` can cause more error tainting to happen.
2025-02-26Rollup merge of #137603 - davidtwco:extern-types-no-deref, r=lcnrLeón Orell Valerian Liehr-30/+31
codegen_llvm: avoid `Deref` impls w/ extern type `rustc_codegen_llvm` relied on `Deref` impls where `Deref::Target` was or contained an extern type - in my experimental implementation of rust-lang/rfcs#3729, this isn't possible as the `Target` associated type's `?Sized` bound cannot be relaxed backwards compatibly (unless we come up with some way of doing this). In later pull requests with the rust-lang/rfcs#3729 implementation, breakage like this could only occur for nightly users relying on the `extern_types` feature. Upstreaming this to avoid needing to keep carrying this patch locally, and I think it'll necessarily need to change eventually.
2025-02-26Rollup merge of #137601 - davidtwco:deduplicate-type-has-metadata, ↵León Orell Valerian Liehr-30/+24
r=fmease,bjorn3 ssa/mono: deduplicate `type_has_metadata` The implementation of the `type_has_metadata` function is duplicated in `rustc_codegen_ssa` and `rustc_monomorphize`, so move this to `rustc_middle`.
2025-02-26Rollup merge of #137559 - folkertdev:run-more-emscripten-tests, r=fmeaseLeón Orell Valerian Liehr-21/+9
run some tests on emscripten again these were ignored because of #45351, but that issue has long been fixed. Let's see if these pass, or if there is some issue lurking still I believe this is the try-job for emscripten? probably a good idea to run that first. ~~try-job: test-various~~ try-job: dist-various-1
2025-02-26Rollup merge of #137544 - petrochenkov:deritest, r=fmeaseLeón Orell Valerian Liehr-0/+172
tests: Add regression test for derive token invalidation (#81099) Closes https://github.com/rust-lang/rust/issues/81099.
2025-02-26Rollup merge of #137529 - klensy:unused3, r=lcnrLeón Orell Valerian Liehr-24/+9
remove few unused args
2025-02-26Rollup merge of #137320 - tapanprakasht:fix-doc-version-stability, r=notriddleLeón Orell Valerian Liehr-0/+40
fix(rustdoc): Fixed stability version in rustdoc Tries to fix https://github.com/rust-lang/rust/issues/137141 Fixed by adding checks glob exports
2025-02-26Rollup merge of #137311 - martn3:enable-f16-mips, r=tgross35León Orell Valerian Liehr-1/+0
Enable `f16` for MIPS Blocked on https://github.com/rust-lang/compiler-builtins/pull/762 It seems as if `f16` works on MIPS now according to my testing on Rust master with LLVM 20, and I was asked [here](https://github.com/rust-lang/rust/pull/137167#issuecomment-2669387820) to create PRs with my changes. I only tested on the flavour of `mipsel-unknown-linux-gnu` hardware that happens to be available to me, so I can't say anything about other MIPS hardware, but from a casual skimming of the LLVM code ([1], [2]) it seems like `f16` should work on all MIPS hardware. So enable it for all MIPS hardware. [1]: https://github.com/rust-lang/llvm-project/blob/rustc/20.1-2025-02-13/llvm/lib/Target/Mips/MipsISelLowering.h#L370 [2]: https://github.com/rust-lang/llvm-project/blob/rustc/20.1-2025-02-13/llvm/lib/CodeGen/TargetLoweringBase.cpp#L1367-L1388 `@rustbot` label +O-MIPS +F-f16_and_f128 +S-blocked Tracking issue for f16: https://github.com/rust-lang/rust/issues/116909 r? `@tgross35`
2025-02-26Rollup merge of #137154 - thaliaarchi:wtf8-fast-paths, r=ChrisDentonLeón Orell Valerian Liehr-3/+27
Add UTF-8 validation fast paths in `Wtf8Buf` This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in https://github.com/rust-lang/rust/pull/96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8). r? `@ChrisDenton`
2025-02-26Rollup merge of #136576 - usamoi:pass-more-llbc, r=fmeaseLeón Orell Valerian Liehr-2/+2
pass optimization level to llvm-bitcode-linker optimization level is not passed to llbc, which should be a mistake
2025-02-26Auto merge of #136921 - Kobzol:gcc-build, r=onur-ozkanbors-62/+55
Build GCC on CI Previously, we have downloaded a specific commit of GCC and prebuilt it inside Docker using the `build-gccjit.sh` script. This PR removes that scripts and uses the bootstrap GCC step. This allows us to use the `src/gcc` submodule for determining which GCC should be built, and it also moves the logic closer to LLVM, which is also built by bootstrap. A few things to note: - The `sccache` option is currently in the `llvm` block, so the GCC build uses `llvm.ccache`, which is a bit weird :) We could either add `gcc.ccache`, or (what I think would be better) to just move `ccache` to the `build` section, as I don't think that it will be necessary to use ccache for LLVM, but not for GCC. - When the GCC codegen backend is built, it needs to depend on a step that first builds GCC. This is currently done in a hacky way. The proper solution is to create a separate step for the GCC codegen backend, but that is a larger change. Let me know what you think. r? `@onur-ozkan` try-job: i686-msvc-1 try-job: x86_64-mingw-1
2025-02-25Auto merge of #137594 - RalfJung:miri-sync, r=RalfJungbors-298/+715
Miri subtree update r? `@ghost` try-job: x86_64-gnu-aux
2025-02-25Auto merge of #137608 - fmease:rollup-h4siso6, r=fmeasebors-385/+245
Rollup of 8 pull requests Successful merges: - #137370 (adjust_abi: make fallback logic for ABIs a bit easier to read) - #137444 (Improve behavior of `IF_LET_RESCOPE` around temporaries and place expressions) - #137464 (Fix invalid suggestion from type error for derive macro) - #137539 ( Add rustdoc-gui regression test for #137082 ) - #137576 (Don't doc-comment BTreeMap<K, SetValZST, A>) - #137595 (remove `simd_fpow` and `simd_fpowi`) - #137600 (type_ir: remove redundant part of comment) - #137602 (feature: fix typo in attribute description) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-25fix #137589Jana Dönszelmann-6/+87
2025-02-25disable float non-determinism for now to be able to complete the syncRalf Jung-36/+47
2025-02-25Auto merge of #137611 - fmease:rollup-ln673ux, r=fmeasebors-42/+221
Rollup of 6 pull requests Successful merges: - #135480 (Don't require method impls for methods with `Self:Sized` bounds for impls for unsized types) - #137360 (Use `as_chunks` in `analyze_source_file_sse2`) - #137460 (downgrade bootstrap `cc`) - #137515 (Update `compiler-builtins` to 0.1.148) - #137522 (use stage 2 on cargo and clippy tests when possible) - #137597 (Revert accidental cargo submodule update) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-25fix doc in library/core/src/pin.rsxizheyin-2/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-25Rollup merge of #137597 - oli-obk:push-unkusxkoqrus, r=KobzolLeón Orell Valerian Liehr-0/+0
Revert accidental cargo submodule update This was accidentally introduced in #135726
2025-02-25Rollup merge of #137522 - onur-ozkan:137215-follow-ups, r=KobzolLeón Orell Valerian Liehr-6/+99
use stage 2 on cargo and clippy tests when possible Follow-up for #137215. For more context, read the discussion starting from https://github.com/rust-lang/rust/pull/137215#issuecomment-2674395959. r? Kobzol (Feel free to re-r if you are not available).
2025-02-25Rollup merge of #137515 - tgross35:update-builtins, r=tgross35León Orell Valerian Liehr-6/+6
Update `compiler-builtins` to 0.1.148 Includes `f16` symbols on MIPS [1], updates for `libm` [2], and reapplies the patch that drops the `public_test_deps!` macro [3]. [1]: https://github.com/rust-lang/compiler-builtins/pull/762 [2]: https://github.com/rust-lang/compiler-builtins/pull/765 [3]: https://github.com/rust-lang/compiler-builtins/pull/766 try-job: aarch64-gnu try-job: i686-mingw-1 try-job: i686-mingw-2 try-job: test-various try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: x86_64-rust-for-linux
2025-02-25Rollup merge of #137460 - onur-ozkan:downgrade-cc, r=jieyouxuLeón Orell Valerian Liehr-3/+5
downgrade bootstrap `cc` Current `cc` version causing bootstrap to fail on custom targets. See https://github.com/rust-lang/cc-rs/issues/1317 for more context. Fixes (after beta and stable backports): https://github.com/rust-lang/rust/issues/137064 and https://github.com/rust-lang/rust/issues/135271
2025-02-25Rollup merge of #137360 - real-eren:rustc_span/use-chunks-exact, r=NoratriebLeón Orell Valerian Liehr-7/+5
Use `as_chunks` in `analyze_source_file_sse2` Follow-up to #136460. Uses a slightly cleaner method of iterating over chunks of bytes.
2025-02-25Rollup merge of #135480 - oli-obk:sized-method-on-unsized-impl, r=lcnrLeón Orell Valerian Liehr-20/+106
Don't require method impls for methods with `Self:Sized` bounds for impls for unsized types Similarly to how #112319 doesn't require specifying associated types with `Self: Sized` bounds on `dyn Trait`, we now don't require assoc items with `Self: Sized` bounds to be in impls of for unsized types. Additionally we lint assoc items with `Self: Sized` bounds that are in such impls: ```rust trait Foo { fn foo() where Self: Sized; } impl Foo for () { fn foo() {} } impl Foo for i32 {} //~^ ERROR: not all trait items implemented, missing: `foo` impl Foo for dyn std::fmt::Debug {} #[deny(dead_code)] impl Foo for dyn std::fmt::Display { fn foo() {} //~^ ERROR this item cannot be used as its where bounds are not satisfied } ``` Note that this works with the same `Self: Sized` specific logic we already have for `dyn Trait`, so no new capabilities like avoiding assoc items with `Self: Copy` bounds on impls for `String` or such are added here. Specifying `where ConcreteType: Sized` in a trait and implementing the trait for `ConcreteType` also does not work, it *must* be exactly `Self: Sized`.
2025-02-25Update information about NanumBarunGothicColin Pitrat-1/+11
2025-02-25Rollup merge of #137602 - davidtwco:force-inline-description, r=fmeaseLeón Orell Valerian Liehr-5/+5
feature: fix typo in attribute description The force inlining attribute isn't is never used with `#![..]` attribute syntax, only `#[..]` syntax.
2025-02-25Rollup merge of #137600 - davidtwco:predicate-polarity-comment, r=fmeaseLeón Orell Valerian Liehr-2/+0
type_ir: remove redundant part of comment This comment refers to a `PredicatePolarity::Reserved` which no longer exists.
2025-02-25Rollup merge of #137595 - folkertdev:remove-simd-pow-powi, r=RalfJungLeón Orell Valerian Liehr-280/+13
remove `simd_fpow` and `simd_fpowi` Discussed in https://github.com/rust-lang/rust/issues/137555 These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic. r? `@RalfJung`
2025-02-25Rollup merge of #137576 - goffrie:setvalzst, r=lcnrLeón Orell Valerian Liehr-1/+1
Don't doc-comment BTreeMap<K, SetValZST, A> This otherwise shows up in documentation as an empty impl block (worse, at the *top* of the docs above the public impls).
2025-02-25Rollup merge of #137539 - GuillaumeGomez:copy-content-tests, r=notriddleLeón Orell Valerian Liehr-3/+10
Add rustdoc-gui regression test for #137082 Fixes https://github.com/rust-lang/rust/issues/137082. Added new commands in `browser-ui-test` allowing us to add a regression test for #137082 and also another to copy code examples content. r? `@notriddle`
2025-02-25Rollup merge of #137464 - chenyukang:yukang-fix-136343, r=estebankLeón Orell Valerian Liehr-5/+44
Fix invalid suggestion from type error for derive macro Fixes #136343 r? `@estebank` I didn't use `from_expansion` to avoid it because of testcase `tests/ui/typeck/issue-110017-format-into-help-deletes-macro.rs`: https://github.com/chenyukang/rust/blob/11959a8b6e75d2c55500a703070a248342d29549/tests/ui/typeck/issue-110017-format-into-help-deletes-macro.rs#L34-L37 This type error could come up with a proper fix.
2025-02-25Rollup merge of #137444 - compiler-errors:drop-lint, r=oli-obkLeón Orell Valerian Liehr-78/+146
Improve behavior of `IF_LET_RESCOPE` around temporaries and place expressions Heavily reworks the `IF_LET_RESCOPE` to be more sensitive around 1. temporaries that get consumed/terminated and therefore should not trigger the lint, and 2. borrows of place expressions, which are not temporary values. Fixes #137411
2025-02-25Rollup merge of #137370 - RalfJung:x86-abi-fallback, r=SparrowLiiLeón Orell Valerian Liehr-11/+26
adjust_abi: make fallback logic for ABIs a bit easier to read I feel like the match guards here make this unnecessarily harder to follow.
2025-02-25Auto merge of #133832 - madsmtm:apple-symbols.o, r=DianQKbors-9/+202
Make `#[used]` work when linking with `ld64` To make `#[used]` work in static libraries, we use the `symbols.o` trick introduced in https://github.com/rust-lang/rust/pull/95604. However, the linker shipped with Xcode, ld64, works a bit differently from other linkers; in particular, [it completely ignores undefined symbols by themselves](https://github.com/apple-oss-distributions/ld64/blob/ld64-954.16/src/ld/parsers/macho_relocatable_file.cpp#L2455-L2468), and only consider them if they have relocations (something something atoms something fixups, I don't know the details). So to make the `symbols.o` file work on ld64, we need to actually insert a relocation. That's kinda cumbersome to do though, since the relocation must be valid, and hence must point to a valid piece of machine code, and is hence very architecture-specific. Fixes https://github.com/rust-lang/rust/issues/133491, see that for investigation. --- Another option would be to pass `-u _foo` to the final linker invocation. This has the problem that `-u` causes the linker to not be able to dead-strip the symbol, which is undesirable. (If we did this, we would possibly also want to do it by putting the arguments in a file by itself, and passing that file via ``@`,` e.g. ``@undefined_symbols.txt`,` similar to https://github.com/rust-lang/rust/issues/52699, though that [is only supported since Xcode 12](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#Linking), and I'm not sure we wanna bump that). Various other options that are probably all undesirable as they affect link time performance: - Pass `-all_load` to the linker. - Pass `-ObjC` to the linker (the Objective-C support in the linker has different code paths that load more of the binary), and instrument the binaries that contain `#[used]` symbols. - Pass `-force_load` to libraries that contain `#[used]` symbols. Failed attempt: Embed `-u _foo` in the object file with `LC_LINKER_OPTION`, akin to https://github.com/rust-lang/rust/issues/121293. Doesn't work, both because `ld64` doesn't read that from archive members unless it already has a reason to load the member (which is what this PR is trying to make it do), and because `ld64` only support the `-l`, `-needed-l`, `-framework` and `-needed_framework` flags in there. --- TODO: - [x] Support all Apple architectures. - [x] Ensure that this works regardless of the actual type of the symbol. - [x] Write up more docs. - [x] Wire up a few proper tests. `@rustbot` label O-apple
2025-02-25Complete the list of resources used in rustdoc outputColin Pitrat-0/+11
2025-02-25remove unused field from VariantDef::new and convert debug to instrumentklensy-9/+1
2025-02-25Revert accidental cargo submodule updateOli Scherer-0/+0
2025-02-25disable a potentially bogus test on MiriRalf Jung-0/+1
2025-02-25remove `simd_fpow` and `simd_fpowi`Folkert de Vries-280/+13
2025-02-25Don't require method impls for methods with `Self:Sized` bounds for impls ↵Oli Scherer-20/+106
for unsized types
2025-02-25Merge pull request #4206 from RalfJung/rustupRalf Jung-6032/+6897
Rustup
2025-02-25Merge from rustcRalf Jung-6031/+6896
2025-02-25Preparing for merge from rustcRalf Jung-1/+1
2025-02-25Auto merge of #137571 - tgross35:rollup-i1tcnv1, r=tgross35bors-57/+51
Rollup of 8 pull requests Successful merges: - #134655 (Stabilize `hash_extract_if`) - #135933 (Explain how Vec::with_capacity is faithful) - #136668 (Stabilize `core::str::from_utf8_mut` as `const`) - #136775 (Update `String::from_raw_parts` safety requirements) - #137109 (stabilize extract_if) - #137349 (Implement `read_buf` for zkVM stdin) - #137493 (configure.py: don't instruct user to run nonexistent program) - #137516 (remove some unnecessary rustc_const_unstable) r? `@ghost` `@rustbot` modify labels: rollup