about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-04Remove `dep_node` comment duplication.Nicholas Nethercote-71/+26
`rustc_middle` and `rustc_query_system` both have a file called `dep_node.rs` with a big comment at the top, and the comments are very similar. The one in `rustc_query_system` looks like the original, and the one in `rustc_middle` is a copy with some improvements. This commit removes the comment from `rustc_middle` and updates the one in `rustc_query_system` to include the improvements. I did it this way because `rustc_query_system` is the crate that defines `DepNode`, and so seems like the right place for the comment.
2025-02-04Remove unused features from `rustc_middle`.Nicholas Nethercote-2/+0
2025-02-02Auto merge of #136454 - matthiaskrgr:rollup-ewejzmp, r=matthiaskrgrbors-734/+1935
Rollup of 8 pull requests Successful merges: - #136145 (Test validity of pattern types) - #136339 (CompileTest: Add Directives to Ignore `arm-unknown-*` Targets) - #136403 (Fix malformed error annotations in a UI test) - #136414 (Shorten error message for callable with wrong return type) - #136425 (Move `rustc_middle::infer::unify_key`) - #136426 (Explain why we retroactively change a static initializer to have a different type) - #136445 (Couple of cleanups to DiagCtxt and EarlyDiagCtxt) - #136452 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-02Rollup merge of #136452 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-568/+1477
Miri subtree update r? `@ghost` Unblocks https://github.com/rust-lang/rust/pull/122408 from the Miri side
2025-02-02Rollup merge of #136445 - bjorn3:diag_ctxt_cleanup, r=oli-obkMatthias Krüger-111/+63
Couple of cleanups to DiagCtxt and EarlyDiagCtxt
2025-02-02Rollup merge of #136426 - oli-obk:push-nkpuulwurykn, r=compiler-errorsMatthias Krüger-2/+8
Explain why we retroactively change a static initializer to have a different type I keep getting confused about it and in turn confused `@GuillaumeGomez` while trying to explain it badly
2025-02-02Rollup merge of #136425 - nnethercote:mv-rustc_middle-infer, r=lcnrMatthias Krüger-18/+14
Move `rustc_middle::infer::unify_key` `rustc_infer` is a much better place for it. r? `@lcnr`
2025-02-02Rollup merge of #136414 - estebank:expected-return-type, r=oli-obkMatthias Krüger-31/+29
Shorten error message for callable with wrong return type ``` error: expected `{closure@...}` to return `Ret`, but it returns `Other` ``` instead of ``` error: expected `{closure@...}` to be a closure that returns `Ret`, but it returns `Other` ```
2025-02-02Rollup merge of #136403 - fmease:fix-a-ui-test, r=oli-obkMatthias Krüger-2/+2
Fix malformed error annotations in a UI test The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with `//` instead of `//`@`` when unknown directive names weren't rejected since they could just as well be part of prose: As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either `fn` or `mod`. This allowed a malformed error annotation of the form `//`@[…]~^^^`` to go undetected & unexercised (as it's placed below `fn main() {`). Obviously a character other than ``@`` would've mangled the error annotation, too (but it might've caught the reviewer's eye). I specifically found this file because I ran `rg '^(fn|mod)[\s\S]*?//`@'` tests/ui --multiline -trust` to check how footgun-y that "special feature" of compiletest is.
2025-02-02Rollup merge of #136339 - veera-sivarajan:ignore-arm-unknown-headers, r=jieyouxuMatthias Krüger-0/+4
CompileTest: Add Directives to Ignore `arm-unknown-*` Targets In #134626, I want to ignore `arm-unknown-*` targets because the LLVM IR for those looks very different compared to other targets: https://rust.godbolt.org/z/ssYMhdv4x. I can use `ignore-arm` but, I think, it would exclude large number of Apple devices. So this PR adds a few directives to ignore `arm-unknown-*` targets specifically.
2025-02-02Rollup merge of #136145 - oli-obk:push-wxvpklmkppqz, r=RalfJungMatthias Krüger-2/+338
Test validity of pattern types r? `@RalfJung` pulled out of #136006 so we don't have to rely on libcore types excercising this code path There's nothing to fix. `rustc_layout_scalar_valid_range_start` structs just failed their validation on their value instead of their fields' value, causing a diff where moving to pattern types adds an additional `.0` field access to the validation error
2025-02-02update lockfileRalf Jung-23/+130
2025-02-02Merge pull request #4142 from joboet/apple-futexRalf Jung-53/+626
shim Apple's futex primitives
2025-02-02Maintain a list of types permitted per patternOli Scherer-2/+211
2025-02-02Check the base type of pattern types for validity firstOli Scherer-6/+5
2025-02-02shim Apple's futex primitivesjoboet-53/+626
This is necessary to unblock rust-lang/rust#122408. The documentation for these is available [here](https://developer.apple.com/documentation/os/os_sync_wait_on_address?language=objc). Because the futex wait operations (`os_sync_wait_on_address` et al.) return the number of remaining waiters after returning, this required some changes to the common futex infrastructure, which I've changed to take a callback instead of precalculating the return values.
2025-02-02Test validity of pattern typesOli Scherer-0/+128
2025-02-02Merge pull request #4172 from RalfJung/miri_get_backtraceRalf Jung-51/+14
miri_get_backtrace: stop supporting the v0 protocol
2025-02-02Merge pull request #4174 from RalfJung/read-write-callbackRalf Jung-138/+158
files: make read/write take callback to store result
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-02files: make write take callback to store result, rather than writing to ↵Ralf Jung-69/+72
'dest' directly
2025-02-02files: make read take callback to store result, rather than writing to ↵Ralf Jung-69/+86
'dest' directly
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-02Replace ParseSess::set_dcx with DiagCtxt::set_emitterbjorn3-8/+8
Replacing the error emitter doesn't accidentally clear the error count.
2025-02-02Use fallback fluent bundle from inner emitter in SilentEmitterbjorn3-28/+6
2025-02-02Slightly simplify DiagCtxt::make_silentbjorn3-37/+25
2025-02-02Some cleanups around EarlyDiagCtxtbjorn3-40/+26
All callers of EarlyDiagCtxt::early_error now emit a fatal error.
2025-02-02Merge pull request #4173 from RalfJung/rustupRalf Jung-802/+1838
Rustup
2025-02-02fix use of deprecated rand APIRalf Jung-1/+1
2025-02-02Merge from rustcRalf Jung-801/+1837
2025-02-02Preparing for merge from rustcRalf Jung-1/+1
2025-02-02miri_get_backtrace: stop supporting the v0 protocolRalf Jung-51/+14
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-02Move `unify_key` module.Nicholas Nethercote-14/+14
From `rustc_middle::infer` to `rustc_infer::infer`. Because everything in it is only used within `rustc_infer`, and no longer needs to be `pub`. Plus it's always good to make the huge `rustc_middle` crate smaller.