about summary refs log tree commit diff
path: root/compiler/rustc_error_messages
AgeCommit message (Collapse)AuthorLines
2023-02-01migrate parser::ty to diagnostic structsXiretza-0/+35
2023-02-01rustc_parse: migrate more to diagnostic structsXiretza-0/+149
2023-02-01Auto merge of #107257 - inquisitivecrystal:ffi-attr, r=davidtwcobors-0/+12
Strengthen validation of FFI attributes Previously, `codegen_attrs` validated the attributes `#[ffi_pure]`, `#[ffi_const]`, and `#[ffi_returns_twice]` to make sure that they were only used on foreign functions. However, this validation was insufficient in two ways: 1. `codegen_attrs` only sees items for which code must be generated, so it was unable to raise errors when the attribute was incorrectly applied to macros and the like. 2. the validation code only checked that the item with the attr was foreign, but not that it was a foreign function, allowing these attributes to be applied to foreign statics as well. This PR moves the validation to `check_attr`, which sees all items. It additionally changes the validation to ensure that the attribute's target is `Target::ForeignFunction`, only allowing the attributes on foreign functions and not foreign statics. Because these attributes are unstable, there is no risk for backwards compatibility. The changes also ending up making the code much easier to read. This PR is best reviewed commit by commit. Additionally, I was considering moving the tests to the `attribute` subdirectory, to get them out of the general UI directory. I could do that as part of this PR or a follow-up, as the reviewer prefers. CC: #58328, #58329
2023-01-30incremental: migrate diagnosticsDavid Wood-0/+119
Migrate the `rustc_incremental` crate's diagnostics to translatable diagnostic structs. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-1/+75
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-29Auto merge of #106253 - nbdd0121:upcast, r=compiler-errorsbors-0/+2
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable` Fix #106247 To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query). cc `@dtolnay` r? `@compiler-errors`
2023-01-28Migrate some range parsing diagnosticsclubby789-0/+11
2023-01-28Reintroduce multiple_supertrait_upcastable lintGary Guo-0/+2
2023-01-28Rollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errorsMatthias Krüger-3/+3
Detect references to non-existant messages in Fluent resources Should help with cases like #107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference) Fixes #107370 ```@rustbot``` label +A-translation
2023-01-27Fix some Fluent typosclubby789-3/+3
2023-01-26Rollup merge of #106978 - mejrs:mir_build3, r=davidtwcoMatthias Krüger-4/+12
Migrate mir_build's borrow conflicts This also changes the error message slightly, for two reasons: - I'm not a fan of saying "value borrowed, by `x`, here" - it simplifies the error implementation significantly.
2023-01-26Rollup merge of #106971 - oli-obk:tait_error, r=davidtwcoMatthias Krüger-3/+19
Handle diagnostics customization on the fluent side (for one specific diagnostic) r? ```@davidtwco```
2023-01-26Auto merge of #107318 - matthiaskrgr:rollup-776kd81, r=matthiaskrgrbors-3/+0
Rollup of 9 pull requests Successful merges: - #97373 (impl DispatchFromDyn for Cell and UnsafeCell) - #106625 (Remove backwards compat for LLVM 12 coverage format) - #106779 (Avoid __cxa_thread_atexit_impl on Emscripten) - #106811 (Append .dwp to the binary filename instead of replacing the existing extension.) - #106836 (Remove optimistic spinning from `mpsc::SyncSender`) - #106946 (implement Hash for proc_macro::LineColumn) - #107074 (remove unnecessary check for opaque types) - #107287 (Improve fn pointer notes) - #107304 (Use `can_eq` to compare types for default assoc type error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-26Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisaMatthias Krüger-3/+0
Remove backwards compat for LLVM 12 coverage format The minimum external LLVM was updated to 13 recently in https://github.com/rust-lang/rust/pull/100611, so this PR removes backwards compat with older coverage formats. I kept the version check and error message there, in accordance with this comment: https://github.com/rust-lang/rust/pull/91207#issuecomment-981121867
2023-01-26Rollup merge of #106407 - mejrs:attr_check, r=compiler-errorsMatthias Krüger-0/+21
Improve proc macro attribute diagnostics Closes https://github.com/rust-lang/rust/issues/102923
2023-01-24Move FFI attribute validation to `check_attr`inquisitivecrystal-0/+12
2023-01-23Add suggestion to remove if in let...else blockEdward Shen-0/+1
Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let block. This is likely that the user has accidentally mixed if-let and let...else together.
2023-01-22Rollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, ↵Matthias Krüger-13/+13
r=petrochenkov Fix missing arguments issues and copy-paste bug for fluent Fixes #107090
2023-01-20Auto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgrbors-1/+2
Rollup of 6 pull requests Successful merges: - #106699 ([drop tracking] Visit break expressions ) - #106738 (Fix known-bug annotations) - #106891 (Tweak "borrow closure argument" suggestion) - #106928 (add raw identifier for keyword in suggestion) - #107065 (Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic) - #107068 (autoderive Subdiagnostic for AddtoExternBlockSuggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-19Fix broken format strings in `infer.ftl`clubby789-8/+8
2023-01-19Autoderive ExternBlockSuggestionmejrs-1/+2
2023-01-18Fix #107090, fix missing arguments for fluentyukang-13/+13
2023-01-17Migrate mir_build's borrow conflictsmejrs-4/+12
2023-01-17Handle diagnostics customization on the fluent sideOli Scherer-1/+19
2023-01-17Empty regions don't exist anymore, remove them from fluentOli Scherer-2/+0
2023-01-17Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwUMatthias Krüger-6/+6
ConstBlocks are poly if their substs are poly r? `@BoxyUwU` fixes #106926
2023-01-17Rollup merge of #106591 - Ezrashaw:attempted-integer-identifer, r=EstebankMatthias Krüger-0/+2
suggestion for attempted integer identifier in patterns Fixes #106552 Implemented a suggestion on `E0005` that occurs when no bindings are present and the pattern is a literal integer.
2023-01-16Properly pluralize 'generic constants'Michael Goulet-6/+6
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-0/+4
2023-01-14suggest fix for attempted integer identifier in patternsEzra Shaw-0/+2
2023-01-13Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholkMatthias Krüger-0/+3
Warn when using panic-strategy abort for proc-macro crates See https://github.com/rust-lang/rust/issues/82320, this simply warns for now as that seems like the best step that can be immediately taken (opposed to straight up rejecting or ignoring)
2023-01-13Auto merge of #106801 - JohnTitor:rollup-xqkraw0, r=JohnTitorbors-0/+3
Rollup of 6 pull requests Successful merges: - #106608 (Render missing generics suggestion verbosely) - #106716 ([RFC 2397] Deny incorrect locations) - #106754 (Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer`) - #106782 (Ignore tests move in git blame) - #106785 (Make blame spans better for impl wfcheck) - #106791 (Fix ICE formatting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-13Warn when using panic-strategy abort for proc-macro cratesLukas Wirth-0/+3
2023-01-13Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwcoYuki Okushi-0/+3
[RFC 2397] Deny incorrect locations cc #51992 As declared in the RFC, `#[do_not_recommend]` should only be applicable on trait implementations.
2023-01-13Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwcobors-0/+11
Add checks for the signature of the `start` lang item Closes #105963
2023-01-13Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwcobors-2/+59
Migrate `rustc_lint` lint diagnostics Part 2 of [Migrate `rustc_lint` errors to `SessionDiagnostic`](https://github.com/rust-lang/rust/pull/100776) r? `@davidtwco` # TODO - [x] Refactor some lints manually implementing `DecorateLint` to use `Option<Subdiagnostic>`. - [x] Add `#[rustc_lint_diagnostics]` to lint functions in `context.rs`. - [x] Migrate `hidden_unicode_codepoints.rs`. - [x] Migrate `UnsafeCode` in `builtin.rs`. - [x] Migrate the rest of `builtin.rs`.
2023-01-12Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwconils-1/+0
remove unreachable error code `E0490` AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker. cc ``@GuillaumeGomez`` #61137
2023-01-12[RFC 2397] Deny incorrect locationsCaio-0/+3
2023-01-11Rollup merge of #106170 - compiler-errors:autoderef-to-analysis, r=lcnrMichael Goulet-4/+4
Move autoderef to `rustc_hir_analysis` Not sure if this is a change we actually want, but autoderef really is only (functionally) used by `rustc_hir_analysis` and `rustc_hir_typeck`, so it probably should live there. Instead, implement a separate autoderef helper in `TypeErrCtxt` for the one use-case that goes against the ordering of the crate graph..
2023-01-11Rollup merge of #106097 - mejrs:mir_build2, r=oli-obkMichael Goulet-0/+61
Migrate mir_build diagnostics 2 of 3 The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.
2023-01-12Auto merge of #106537 - ↵bors-0/+6
fmease:recover-where-clause-before-tuple-struct-body, r=estebank Recover from where clauses placed before tuple struct bodies Open to any suggestions regarding the phrasing of the diagnostic. Fixes #100790. `@rustbot` label A-diagnostics r? diagnostics
2023-01-12remove unreachable error code `E0490`Ezra Shaw-1/+0
2023-01-12Improve proc macro attribute diagnosticsmejrs-0/+21
2023-01-11Translate `Overlap` eagerlymejrs-2/+0
2023-01-11Don't recommend `if let` if `let else` worksmejrs-1/+1
2023-01-11Migrate pattern matchingmejrs-4/+32
2023-01-11Migrate usefulness.rsmejrs-2/+12
2023-01-11Migrate deconstruct_pat.rsmejrs-1/+7
2023-01-11Translate const_to_pat.rsmejrs-0/+19
2023-01-11add checks for the signature of the lang itemasquared31415-0/+11