about summary refs log tree commit diff
path: root/compiler/rustc_errors
AgeCommit message (Collapse)AuthorLines
2025-01-25Auto merge of #119286 - jyn514:linker-output, r=bjorn3bors-18/+31
show linker output even if the linker succeeds Show stderr and stderr by default, controlled by a new `linker_messages` lint. fixes https://github.com/rust-lang/rust/issues/83436. fixes https://github.com/rust-lang/rust/issues/38206. cc https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408986134 <!-- try-job: dist-x86_64-msvc --> try-job: aarch64-apple r? `@bjorn3`
2025-01-21bumpt compiler and tools to windows 0.59klensy-1/+1
2025-01-20don't ICE when emitting linker errors during `-Z link-only`jyn-18/+31
note that this still ICEs when passed `-Z link-only --error-format json` because i can't be bothered to fix it right now
2025-01-19Manual cleanup of some `is_{or_none|some_and}` usagesYotam Ofek-2/+4
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-3/+3
2025-01-12Auto merge of #135402 - matthiaskrgr:rollup-cz7hs13, r=matthiaskrgrbors-2/+0
Rollup of 6 pull requests Successful merges: - #129259 (Add inherent versions of MaybeUninit methods for slices) - #135374 (Suggest typo fix when trait path expression is typo'ed) - #135377 (Make MIR cleanup for functions with impossible predicates into a real MIR pass) - #135378 (Remove a bunch of diagnostic stashing that doesn't do anything) - #135397 (compiletest: add erroneous variant to `string_enum`s conversions error) - #135398 (add more crash tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-2/+0
2025-01-11fix `it's` -> `its` in doc commentYotam Ofek-1/+1
2024-12-31Convert some Into impls into From implsMichael Goulet-3/+3
2024-12-26Account for removal of multiline span in suggestionEsteban Küber-7/+79
When highlighting the removed parts of a suggestion, properly account for spans that cover more than one line. Fix #134485.
2024-12-20Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwcoDianQK-2/+9
Fix logical error with what text is considered whitespace. There appears to be a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space. In that case the subtraction will cause a ICE (for a compiler in debug mode) as described in https://github.com/rust-lang/rust/issues/132918.
2024-12-18chore: fix some typosacceptacross-2/+2
Signed-off-by: acceptacross <csqcqs@gmail.com>
2024-12-18Auto merge of #134243 - nnethercote:re-export-more-rustc_span, r=jieyouxubors-4/+2
Re-export more `rustc_span::symbol` things from `rustc_span`. `rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers to `rustc_span::`. This is a 300+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one. r? `@jieyouxu`
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-4/+2
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-16Fix logical error with what text is considered whitespace.Harrison Kaiser-2/+9
There is a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space.
2024-12-16update uses of extract_if in the compilerThe 8472-4/+4
2024-12-14Rollup merge of #134181 - estebank:trim-render, r=oli-obkMatthias Krüger-3/+12
Tweak multispan rendering to reduce output length Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments. We do that check not only on the first 4 lines of the multispan, but now also on the previous to last line as well.
2024-12-13Account for `///` when rendering multiline spansEsteban Küber-8/+9
Don't consider `///` and `//!` docstrings to be empty for the purposes of multiline span rendering.
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-1/+5
span rendering
2024-12-12Tweak multispan renderingEsteban Küber-2/+6
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-12Rollup merge of #134187 - nnethercote:rm-PErr, r=jieyouxuMatthias Krüger-2/+1
Remove `PErr`. It's just a synonym for `Diag` that adds no value and is only used in a few places. r? ``@spastorino``
2024-12-12Rollup merge of #134154 - dev-ardi:field-expr-generics, r=compiler-errorsMatthias Krüger-0/+4
suppress field expr with generics error message if it's a method Don't emit "field expressions may not have generic arguments" if it's a method call without `()` r? estebank Fixes #67680 Is this the best way to go? It's by far the simplest I could come up with.
2024-12-12Remove `PErr`.Nicholas Nethercote-2/+1
It's just a synonym for `Diag` that adds no value and is only used in a few places.
2024-12-11Don't emit "field expressions may not have generic arguments" if it's a ↵Orion Gonzalez-0/+4
method call without ()
2024-12-11document check_expr_fieldOrion Gonzalez-1/+1
2024-12-06Handle unwinding out of the closure argument of run_compiler with pending ↵bjorn3-3/+7
delayed bugs
2024-12-06Store a single copy of the error registry in DiagCtxtbjorn3-21/+35
And pass this to the individual emitters when necessary.
2024-11-30Eliminate magic numbers from expression precedenceDavid Tolnay-0/+7
2024-11-12Auto merge of #132954 - matthiaskrgr:rollup-x3rww9h, r=matthiaskrgrbors-3/+16
Rollup of 7 pull requests Successful merges: - #131831 (extend the "if-unchanged" logic for compiler builds) - #132541 (Proper support for cross-crate recursive const stability checks) - #132657 (AIX: add run-make support) - #132901 (Warn about invalid `mir-enable-passes` pass names) - #132923 (Triagebot: Consolidate the T-compiler ad hoc assignment groups) - #132938 (Make precise capturing suggestion machine-applicable only if it has no APITs) - #132947 (clarify `must_produce_diag` ICE for debugging) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-12Auto merge of #132282 - Noratrieb:it-is-the-end-of-serial, r=cjgillotbors-10/+0
Delete the `cfg(not(parallel))` serial compiler Since it's inception a long time ago, the parallel compiler and its cfgs have been a maintenance burden. This was a necessary evil the allow iteration while not degrading performance because of synchronization overhead. But this time is over. Thanks to the amazing work by the parallel working group (and the dyn sync crimes), the parallel compiler has now been fast enough to be shipped by default in nightly for quite a while now. Stable and beta have still been on the serial compiler, because they can't use `-Zthreads` anyways. But this is quite suboptimal: - the maintenance burden still sucks - we're not testing the serial compiler in nightly Because of these reasons, it's time to end it. The serial compiler has served us well in the years since it was split from the parallel one, but it's over now. Let the knight slay one head of the two-headed dragon! #113349 Note that the default is still 1 thread, as more than 1 thread is still fairly broken. cc `@onur-ozkan` to see if i did the bootstrap field removal correctly, `@SparrowLii` on the sync parts
2024-11-12Delete the `cfg(not(parallel))` serial compilerNoratrieb-10/+0
Since it's inception a long time ago, the parallel compiler and its cfgs have been a maintenance burden. This was a necessary evil the allow iteration while not degrading performance because of synchronization overhead. But this time is over. Thanks to the amazing work by the parallel working group (and the dyn sync crimes), the parallel compiler has now been fast enough to be shipped by default in nightly for quite a while now. Stable and beta have still been on the serial compiler, because they can't use `-Zthreads` anyways. But this is quite suboptimal: - the maintenance burden still sucks - we're not testing the serial compiler in nightly Because of these reasons, it's time to end it. The serial compiler has served us well in the years since it was split from the parallel one, but it's over now. Let the knight slay one head of the two-headed dragon!
2024-11-12clarify `must_produce_diag` ICE for debuggingRémy Rakic-3/+16
2024-11-11Auto merge of #126597 - estebank:unicode-output, r=fmeasebors-128/+595
Add Unicode block-drawing compiler output support Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI. In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in. After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ``` After: ![rustc output with unicode box drawing characters](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25) Before: ![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-10Address review commentsLeón Orell Valerian Liehr-26/+25
2024-11-10Add Unicode block-drawing compiler output supportEsteban Küber-121/+589
Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI: After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ```
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-2/+2
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-10-29Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillotJubilee-8/+13
compiler: apply clippy::clone_on_ref_ptr for CI Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443. Some Arc's can be misplaced with Lrc's, sorry. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-8/+13
2024-10-27compiler: Add rustc_abi dependence to the compilerJubilee Young-1/+2
Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-10-23"innermost", "outermost", "leftmost", and "rightmost" don't need hyphensJosh Triplett-4/+4
These are all standard dictionary words and don't require hyphenation.
2024-10-07Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errorsMatthias Krüger-21/+20
Avoid `&Lrc<T>` in various places Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better. r? `@oli-obk`
2024-10-07Convert `Option<&Lrc<T>>` return types to `Option<&T>`.Nicholas Nethercote-21/+20
It's simpler and more concise.
2024-10-07Remove `InferCtxt::err_count_on_creation`.Nicholas Nethercote-12/+0
It's no longer used meaningfully. This also means `DiagCtxtHandle::err_count_excluding_lint_errs` can be removed.
2024-09-27bump few depsklensy-1/+1
cargo_metadata, thorin-dwp, windows
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-123/+91
2024-09-18Add suggestions for expressions in patternsLieselotte-0/+2
2024-09-12Implement a Method to Seal `DiagInner`'s SuggestionsVeera-17/+70
2024-09-11clippy::useless_conversionMichael Goulet-2/+2
2024-09-07Do not ICE on expect(warnings).Camille GILLOT-12/+5
2024-09-06Check AttrId for expectations.Camille GILLOT-108/+17