about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-03Flatten the option check in `lower_pattern_range_endpoint`Zalathar-31/+28
2025-02-02Auto merge of #136448 - matthiaskrgr:rollup-pdim5di, r=matthiaskrgrbors-1180/+775
Rollup of 7 pull requests Successful merges: - #134272 (Remove rustc_encodable_decodable feature) - #136283 (Update encode_utf16 to mention it is native endian) - #136394 (Clean up MonoItem::instantiation_mode) - #136402 (diagnostics: fix borrowck suggestions for if/while let conditionals) - #136415 (Highlight clarifying information in "expected/found" error) - #136422 (Convert two `rustc_middle::lint` functions to `Span` methods.) - #136434 (rustc_allowed_through_unstable_modules: require deprecation message) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-02Rollup merge of #136434 - ↵Matthias Krüger-125/+107
RalfJung:rustc_allowed_through_unstable_modules-deprecation-required, r=compiler-errors rustc_allowed_through_unstable_modules: require deprecation message This changes the `#[rustc_allowed_through_unstable_modules]` attribute so that a deprecation message (ideally directing people towards the stable path) is required.
2025-02-02Rollup merge of #136422 - nnethercote:convert-lint-functions, r=NoratriebMatthias Krüger-278/+179
Convert two `rustc_middle::lint` functions to `Span` methods. `rustc_middle` is a huge crate and it's always good to move stuff out of it. There are lots of similar methods already on `Span`, so these two functions, `in_external_macro` and `is_from_async_await`, fit right in. The diff is big because `in_external_macro` is used a lot by clippy lints. r? ``@Noratrieb``
2025-02-02Rollup merge of #136415 - estebank:highlight-clarification, r=compiler-errorsMatthias Krüger-27/+160
Highlight clarifying information in "expected/found" error When the expected and found types have the same textual representation, we add clarifying in parentheses. We now visually highlight it in the output. Detect a corner case where the clarifying information would be the same for both types and skip it, as it doesn't add anything useful. ![Screenshot of the rustc highlighted output on the terminal](https://github.com/user-attachments/assets/aa4b9433-5332-4941-b2c2-1a43e5cadff7)
2025-02-02Rollup merge of #136402 - notriddle:notriddle/let-expr-detector, ↵Matthias Krüger-18/+227
r=compiler-errors diagnostics: fix borrowck suggestions for if/while let conditionals This code detects the case where one of the borrows is inside the let init expr while the other end is not. If that happens, we don't want to suggest adding a semicolon, because it won't work. Fixes #133941
2025-02-02Rollup merge of #136394 - saethlin:clean-up-instantiation-mode, ↵Matthias Krüger-42/+79
r=compiler-errors Clean up MonoItem::instantiation_mode More progress on cleaning up and documenting instantiation mode selection. This should have no behavior changes at all, it just rearranges the code inside `MonoItem::instantiation_mode` to a more logical flow and I've tried to explain every choice the implementation is making.
2025-02-02Rollup merge of #136283 - hkBst:patch-31, r=workingjubileeMatthias Krüger-12/+13
Update encode_utf16 to mention it is native endian Fixes #83102
2025-02-02Rollup merge of #134272 - RalfJung:destabilize-rustc_encodable_decodable, ↵Matthias Krüger-678/+10
r=oli-obk Remove rustc_encodable_decodable feature This has been shown in future-compat reports since Rust 1.79 (https://github.com/rust-lang/rust/pull/116016), released June 2024. Let's see if crater still finds any issues. Part of https://github.com/rust-lang/rust/issues/134301. Cc ``@rust-lang/libs-api``
2025-02-02Auto merge of #136376 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 12 commits in cecde95c119a456c30e57d3e4b31fff5a7d83df4..0e3d73849ab8cbbab3ec5c65cbd555586cb21339 2025-01-24 17:15:24 +0000 to 2025-02-01 20:14:40 +0000 - Revert "Conditionally mark the `test` cfg as a well known cfg (rust-lang/cargo#15007)" (rust-lang/cargo#15132) - Don't suggest `cargo login` when using incompatible credental providers (rust-lang/cargo#15124) - chore: Update clap_complete (rust-lang/cargo#15121) - Move the changelog to the cargo book (rust-lang/cargo#15119) - Conditionally mark the `test` cfg as a well known cfg (rust-lang/cargo#15007) - fix broken links in the Cargo book (rust-lang/cargo#15109) - Fix a typo and touch up documentation (rust-lang/cargo#15108) - Fix shared_std_dependency_rebuild running on Windows (rust-lang/cargo#15111) - Fix warnings on Windows (rust-lang/cargo#15112) - fix(login): Deprecate CLI token (rust-lang/cargo#15057) - Update tests to fix nightly errors (rust-lang/cargo#15110) - Fix comment on Ord for SourceId (rust-lang/cargo#15103)
2025-02-02Auto merge of #136433 - matthiaskrgr:rollup-co27itw, r=matthiaskrgrbors-1131/+725
Rollup of 7 pull requests Successful merges: - #133266 (ci: fix explanation why LLVM download is disabled for windows-gnu) - #136133 (Fix sentence in process::abort) - #136279 (Rename `tcx.ensure()` to `tcx.ensure_ok()`, and improve the associated docs) - #136328 (Rework "long type names" printing logic) - #136358 (`#[optimize(none)]` implies `#[inline(never)]`) - #136368 (Make comma separated lists of anything easier to make for errors) - #136412 (Tweak fn pointer suggestion span) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-02rustc_allowed_through_unstable_modules: require deprecation messageRalf Jung-125/+107
2025-02-02Rollup merge of #136412 - estebank:fn-ptr-cast-suggestion, r=jieyouxuMatthias Krüger-16/+11
Tweak fn pointer suggestion span Use a more targeted span when suggesting casting an `fn` item to an `fn` pointer. ``` error[E0308]: cannot coerce functions which must be inlined to function pointers --> $DIR/cast.rs:10:33 | LL | let _: fn(isize) -> usize = callee; | ------------------ ^^^^^^ cannot coerce functions which must be inlined to function pointers | | | expected due to this | = note: expected fn pointer `fn(_) -> _` found fn item `fn(_) -> _ {callee}` = note: fn items are distinct from fn pointers help: consider casting to a fn pointer | LL | let _: fn(isize) -> usize = callee as fn(isize) -> usize; | +++++++++++++++++++++ ``` ``` error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:42:30 | LL | let d: &fn(u32) -> u32 = foo; | --------------- ^^^ expected `&fn(u32) -> u32`, found fn item | | | expected due to this | = note: expected reference `&fn(_) -> _` found fn item `fn(_) -> _ {foo}` help: consider using a reference | LL | let d: &fn(u32) -> u32 = &foo; | + ``` Previously we'd point at the whole expression for replacement, instead of marking what was being added. We could also modify the suggestions for `&(name as fn())`, but for that we require storing more accurate spans than we have now.
2025-02-02Rollup merge of #136368 - estebank:listify, r=fee1-deadMatthias Krüger-148/+88
Make comma separated lists of anything easier to make for errors Provide a new function `listify`, meant to be used in cases similar to `pluralize!`. When you have a slice of arbitrary elements that need to be presented to the user, `listify` allows you to turn that into a list of comma separated strings. This reduces a lot of redundant logic that happens often in diagnostics.
2025-02-02Rollup merge of #136358 - clubby789:opt-none-noinline, r=saethlinMatthias Krüger-1/+26
`#[optimize(none)]` implies `#[inline(never)]` Fixes #136329
2025-02-02Rollup merge of #136328 - estebank:long-ty-path, r=jieyouxu,lqdMatthias Krüger-740/+331
Rework "long type names" printing logic Make it so more type-system types can be printed in a shortened version (like `Predicate`s). Centralize printing the information about the "full type name path". Make the "long type path" for the file where long types are written part of `Diag`, so that it becomes easier to keep track of it, and ensure it will always will be printed out last in the diagnostic by making its addition to the output implicit. Tweak the shortening of types in "expected/found" labels. Remove dead file `note.rs`.
2025-02-02Rollup merge of #136279 - Zalathar:ensure-ok, r=oli-obkMatthias Krüger-206/+262
Rename `tcx.ensure()` to `tcx.ensure_ok()`, and improve the associated docs This is all based on my archaeology for https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60TyCtxtEnsure.60. The main renamings are: - `tcx.ensure()` → `tcx.ensure_ok()` - `tcx.ensure_with_value()` → `tcx.ensure_done()` - Query modifier `ensure_forwards_result_if_red` → `return_result_from_ensure_ok` Hopefully these new names are a better fit for the *actual* function and purpose of these query call modes.
2025-02-02Rollup merge of #136133 - hkBst:patch-23, r=ibraheemdevMatthias Krüger-8/+4
Fix sentence in process::abort
2025-02-02Rollup merge of #133266 - mati865:windows-gnu-llvm-download, r=KobzolMatthias Krüger-12/+3
ci: fix explanation why LLVM download is disabled for windows-gnu Continuation of https://github.com/rust-lang/rust/pull/132781
2025-02-02Auto merge of #136238 - marcoieni:free-disk-refactor, r=Kobzolbors-30/+64
ci: refactor how directories are removed in free-disk-space disk try-job: aarch64-gnu
2025-02-02Convert two `rustc_middle::lint` functions to `Span` methods.Nicholas Nethercote-278/+179
`rustc_middle` is a huge crate and it's always good to move stuff out of it. There are lots of similar methods already on `Span`, so these two functions, `in_external_macro` and `is_from_async_await`, fit right in. The diff is big because `in_external_macro` is used a lot by clippy lints.
2025-02-02Highlight clarifying information in "expected/found" errorEsteban Küber-27/+160
When the expected and found types have the same textual representation, we add clarifying in parentheses. We now visually highlight it in the output. Detect a corner case where the clarifying information would be the same for both types and skip it, as it doesn't add anything useful.
2025-02-02Tweak fn pointer suggestion spanEsteban Küber-16/+11
Use a more targeted span when suggesting casting an `fn` item to an `fn` pointer. ``` error[E0308]: cannot coerce functions which must be inlined to function pointers --> $DIR/cast.rs:10:33 | LL | let _: fn(isize) -> usize = callee; | ------------------ ^^^^^^ cannot coerce functions which must be inlined to function pointers | | | expected due to this | = note: expected fn pointer `fn(_) -> _` found fn item `fn(_) -> _ {callee}` = note: fn items are distinct from fn pointers help: consider casting to a fn pointer | LL | let _: fn(isize) -> usize = callee as fn(isize) -> usize; | +++++++++++++++++++++ ``` ``` error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:42:30 | LL | let d: &fn(u32) -> u32 = foo; | --------------- ^^^ expected `&fn(u32) -> u32`, found fn item | | | expected due to this | = note: expected reference `&fn(_) -> _` found fn item `fn(_) -> _ {foo}` help: consider using a reference | LL | let d: &fn(u32) -> u32 = &foo; | + ``` Previously we'd point at the whole expression for replacement, instead of marking what was being added. We could also modify the suggestions for `&(name as fn())`, but for that we require storing more accurate spans than we have now.
2025-02-01diagnostics: fix borrowck suggestions for if/while let conditionalsMichael Howell-18/+227
This code detects the case where one of the borrows is inside the let init expr while the other end is not. If that happens, we don't want to suggest adding a semicolon, because it won't work.
2025-02-01Update cargoWeihang Lo-0/+0
2025-02-01Auto merge of #136389 - matthiaskrgr:rollup-x453dy9, r=matthiaskrgrbors-149/+774
Rollup of 6 pull requests Successful merges: - #130514 (Implement MIR lowering for unsafe binders) - #135684 (docs: Documented Send and Sync requirements for Mutex + MutexGuard) - #136307 (Implement all mix/max functions in a (hopefully) more optimization amendable way) - #136360 (Stabilize `once_wait`) - #136364 (document that ptr cmp is unsigned) - #136374 (Add link attribute for Enzyme's LLVMRust FFI) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-01Clean up MonoItem::instantiation_modeBen Kimock-42/+79
2025-02-01Rollup merge of #136374 - saethlin:enzyme-linkage, r=oli-obkMatthias Krüger-2/+7
Add link attribute for Enzyme's LLVMRust FFI Since https://github.com/rust-lang/rust/pull/133429 landed, the compiler doesn't build with `-Zcross-crate-inline-threshold=always`. I don't expect anyone else to test or fix issues with that goofy configuration, so I'm fixing it. This PR adds a link attribute just like https://github.com/rust-lang/rust/pull/118142 for all the new LLVMRust functions. They were actually added in https://github.com/rust-lang/rust/pull/130060 but weren't used until just now.
2025-02-01Rollup merge of #136364 - hkBst:ptr_cmp_docs, r=tgross35Matthias Krüger-3/+8
document that ptr cmp is unsigned Fixes #77497
2025-02-01Rollup merge of #136360 - slanterns:once_wait, r=tgross35Matthias Krüger-7/+3
Stabilize `once_wait` Closes: https://github.com/rust-lang/rust/issues/127527. `@rustbot` label: +T-libs-api r? libs-api
2025-02-01Rollup merge of #136307 - WaffleLapkin:minminmin, r=scottmcmMatthias Krüger-33/+137
Implement all mix/max functions in a (hopefully) more optimization amendable way Previously the graph was like this: ``` min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp) ^ | min_by_key ``` now it looks like this: ``` min -> Ord::min -> `<=` <- min_by_key min_by -> `Ordering::is_le` of `compare()` ``` (`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`) I'm not sure how to test this, but it should probably be easier for the backend to optimize. r? `@scottmcm` cc https://github.com/rust-lang/rust/issues/115939#issuecomment-2622161134
2025-02-01Rollup merge of #135684 - ranger-ross:mutex-docs, r=joboetMatthias Krüger-2/+30
docs: Documented Send and Sync requirements for Mutex + MutexGuard This an attempt to continue where #123225 left off. I did some light clean up from the work done in that PR. I also documented the `!Send` + `Sync` implementations for `MutexGuard` to the best of my knowledge. Let me know if I got anything wrong :smile: fixes #122856 cc: ``@IoaNNUwU`` r? ``@joboet``
2025-02-01Rollup merge of #130514 - compiler-errors:unsafe-binders, r=oli-obkMatthias Krüger-102/+589
Implement MIR lowering for unsafe binders This is the final bit of the unsafe binders puzzle. It implements MIR, CTFE, and codegen for unsafe binders, and enforces that (for now) they are `Copy`. Later on, I'll introduce a new trait that relaxes this requirement to being "is `Copy` or `ManuallyDrop<T>`" which more closely models how we treat union fields. Namely, wrapping unsafe binders is now `Rvalue::WrapUnsafeBinder`, which acts much like an `Rvalue::Aggregate`. Unwrapping unsafe binders are implemented as a MIR projection `ProjectionElem::UnwrapUnsafeBinder`, which acts much like `ProjectionElem::Field`. Tracking: - https://github.com/rust-lang/rust/issues/130516
2025-02-01document ptr comparison being by addressMarijn Schouten-3/+8
2025-02-01Fix sentence in process::abortMarijn Schouten-8/+4
2025-02-01Auto merge of #136136 - marcoieni:ubuntu-24, r=Kobzolbors-2/+2
ci: use ubuntu 24 on free runners try-job: aarch64-gnu try-job: aarch64-gnu-debug
2025-02-01docs: Documented Send and Sync requirements for Mutex + MutexGuardRoss Sullivan-2/+30
2025-02-01Auto merge of #136371 - matthiaskrgr:rollup-0b880v3, r=matthiaskrgrbors-620/+997
Rollup of 7 pull requests Successful merges: - #135840 (omit unused args warnings for intrinsics without body) - #135900 (Manually walk into WF obligations in `BestObligation` proof tree visitor) - #136163 (Fix off-by-one error causing slice::sort to abort the program) - #136266 (fix broken release notes id) - #136314 (Use proper type when applying deref adjustment in const) - #136348 (miri: make float min/max non-deterministic) - #136351 (Add documentation for derive(CoercePointee)) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Add link attribute for Enzyme's FFIBen Kimock-2/+7
2025-02-01Mark the tcx-ensure wrapper types with `#[must_use]`Zalathar-0/+2
2025-02-01Use an explicit type when discarding the result of `tcx.ensure_ok()`Zalathar-5/+9
2025-02-01Rename `ensure_forwards_result_if_red` to `return_result_from_ensure_ok`Zalathar-22/+34
2025-02-01Rename `tcx.ensure_with_value()` to `tcx.ensure_done()`Zalathar-25/+37
2025-02-01Rename `tcx.ensure()` to `tcx.ensure_ok()`Zalathar-160/+186
2025-02-01Auto merge of #135768 - jieyouxu:migrate-symbol-mangling-hashed, r=Noratriebbors-81/+178
tests: Port `symbol-mangling-hashed` to rmake.rs Part of #121876. This PR supersedes #128567 and is co-authored with `@lolbinarycat.` ### Summary This PR ports `tests/run-make/symbol-mangling-hashed` to rmake.rs. Notable differences when compared to the Makefile version includes: - It's no longer limited to linux + x86_64 only. In particular, this now is exercised on darwin and windows (esp. msvc) too. - The test uses `object` crate to be more precise in the filtering, and avoids relying on parsing the human-readable `nm` output for *some* `nm` in the given environment (which isn't really a thing on msvc anyway, and `llvm-nm` doesn't handle msvc dylibs AFAICT). - Dump the symbols satisfying various criteria on test failure to make it hopefully less of a pain to debug if it ever fails in CI. ### Review advice - Best reviewed commit-by-commit. - I'm not *super* sure about the msvc logic, would benefit from a MSVC (PE/COFF) expert taking a look. --- try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various
2025-02-01Rollup merge of #136351 - Darksonn:coerce-pointee-docs, r=compiler-errorsMatthias Krüger-1/+189
Add documentation for derive(CoercePointee) Part of [RFC 3621][rfc] tracked by #123430. This text is heavily based on the guide-level explanation from the RFC. ``@rustbot`` label F-derive_coerce_pointee [rfc]: https://rust-lang.github.io/rfcs/3621-derive-smart-pointer.html
2025-02-01Rollup merge of #136348 - RalfJung:miri-float-min-max, r=oli-obkMatthias Krüger-6/+64
miri: make float min/max non-deterministic This makes Miri match the documentation that landed in https://github.com/rust-lang/rust/pull/136296. r? ``@oli-obk``
2025-02-01Rollup merge of #136314 - compiler-errors:const-deref-adj, r=fee1-deadMatthias Krüger-9/+33
Use proper type when applying deref adjustment in const When applying a deref adjustment to some type `Wrap<T>` which derefs to `T`, we were checking that `T: ~const Deref`, not `Wrap<T>: ~const Deref` like we should have been. r? project-const-traits Fixes #136273 Fixes #135210 -- I just deleted the test since the regression test is uninteresting
2025-02-01Rollup merge of #136266 - cyrgani:patch-1, r=Mark-SimulacrumMatthias Krüger-2/+1
fix broken release notes id
2025-02-01Rollup merge of #136163 - uellenberg:driftsort-off-by-one, r=Mark-SimulacrumMatthias Krüger-8/+32
Fix off-by-one error causing slice::sort to abort the program Fixes #136103. Based on the analysis by ``@jonathan-gruber-jg`` and ``@orlp.``