| Age | Commit message (Collapse) | Author | Lines |
|
`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.
|
|
|
|
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
|
|
Miri subtree update
r? `@ghost`
Unblocks https://github.com/rust-lang/rust/pull/122408 from the Miri side
|
|
Couple of cleanups to DiagCtxt and EarlyDiagCtxt
|
|
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
|
|
Move `rustc_middle::infer::unify_key`
`rustc_infer` is a much better place for it.
r? `@lcnr`
|
|
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`
```
|
|
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.
|
|
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.
|
|
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
|
|
|
|
shim Apple's futex primitives
|
|
|
|
|
|
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.
|
|
|
|
miri_get_backtrace: stop supporting the v0 protocol
|
|
files: make read/write take callback to store result
|
|
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
|
|
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.
|
|
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``
|
|
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.

|
|
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
|
|
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.
|
|
Update encode_utf16 to mention it is native endian
Fixes #83102
|
|
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``
|
|
'dest' directly
|
|
'dest' directly
|
|
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)
|
|
Replacing the error emitter doesn't accidentally clear the error count.
|
|
|
|
|
|
All callers of EarlyDiagCtxt::early_error now emit a fatal error.
|
|
Rustup
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
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.
|
|
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.
|
|
`#[optimize(none)]` implies `#[inline(never)]`
Fixes #136329
|
|
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`.
|
|
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.
|
|
Fix sentence in process::abort
|
|
ci: fix explanation why LLVM download is disabled for windows-gnu
Continuation of https://github.com/rust-lang/rust/pull/132781
|
|
ci: refactor how directories are removed in free-disk-space disk
try-job: aarch64-gnu
|
|
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.
|