summary refs log tree commit diff
path: root/compiler/rustc_error_messages
AgeCommit message (Collapse)AuthorLines
2022-08-15Revert let_chains stabilizationNilstrieb-1/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. It was discovered that they are not implemented correctly, which does not make them ready for stabilization.
2022-07-27lint: add bad opt access internal lintDavid Wood-0/+6
Some command-line options accessible through `sess.opts` are best accessed through wrapper functions on `Session`, `TyCtxt` or otherwise, rather than through field access on the option struct in the `Session`. Adds a new lint which triggers on those options that should be accessed through a wrapper function so that this is prohibited. Options are annotated with a new attribute `rustc_lint_opt_deny_field_access` which can specify the error message (i.e. "use this other function instead") to be emitted. A simpler alternative would be to simply rename the options in the option type so that it is clear they should not be used, however this doesn't prevent uses, just discourages them. Another alternative would be to make the option fields private, and adding accessor functions on the option types, however the wrapper functions sometimes rely on additional state from `Session` or `TyCtxt` which wouldn't be available in an function on the option type, so the accessor would simply make the field available and its use would be discouraged too. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-25passes: port more of `check_attr` moduleDavid Wood-0/+107
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20clippy::perf fixesMatthias Krüger-1/+1
2022-07-19Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, ↵bors-2/+2
r=petrochenkov,GuillaumeGomez Improve the function pointer docs This is #97842 but for function pointers instead of tuples. The concept is basically the same. * Reduce duplicate impls; show `fn (T₁, T₂, …, Tₙ)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html
2022-07-18Update invalid atomic ordering lintTomasz Miąsko-5/+0
The restriction that success ordering must be at least as strong as its failure ordering in compare-exchange operations was lifted in #98383.
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-2/+2
The attribute is also renamed `fake_variadic`.
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-15passes: migrate half of `check_attr`David Wood-0/+152
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-15errors: lint on `LintDiagnosticBuilder::build`David Wood-0/+9
Apply the `#[rustc_lint_diagnostics]` attribute to `LintDiagnosticBuilder::build` so that diagnostic migration lints will trigger for it. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-10use subdiagnostic for messageMichael Goulet-1/+7
2022-07-08simplify plurals in fluent messages using hir::ConstContextMichael Goulet-22/+6
2022-07-08Migrate MutDeref, TransientMutBorrow diagnosticsMichael Goulet-0/+19
2022-07-08Migrate PanicNonStr, RawPtrComparison, RawPtrToInt diagnosticsMichael Goulet-0/+11
2022-07-08Migrate StaticAccess diagnosticMichael Goulet-1/+11
2022-07-08Migrate NonConstOp diagnosticMichael Goulet-0/+3
2022-07-08Migrate unstable-in-stable diagnosticMichael Goulet-0/+5
2022-07-08Use dashes instead of underscores in fluent namesMichael Goulet-2/+2
2022-06-30lint: port asm labels diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port deref nullptr diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port clashing extern diagnosticsDavid Wood-0/+7
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port incomplete features diagnosticsDavid Wood-0/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port explicit outlives diagnosticsDavid Wood-0/+6
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port keyword idents diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port test items diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port `...` range pattern diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port trivial bounds diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port type alias bounds diagnosticsDavid Wood-0/+8
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unreachable `pub` diagnosticDavid Wood-0/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unstable feature diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port mutable transmutes diagnosticDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port no-mangle diagnosticsDavid Wood-0/+6
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unused doc comment diagnosticsDavid Wood-0/+5
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port deprecated attr diagnosticsDavid Wood-0/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port anonymous parameter diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port missing debug impl diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port missing copy impl diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port missing documentation diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unsafe diagnosticsDavid Wood-0/+30
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port non-shorthand pattern diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port box pointers diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port while true diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unused allocation diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unused import braces diagnosticsDavid Wood-0/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unused delimiter diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port path statement diagnosticsDavid Wood-0/+5
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port unused diagnosticsDavid Wood-0/+22
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port atomic ordering diagnosticsDavid Wood-0/+18
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port variant size difference diagnosticsDavid Wood-0/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port improper ctypes diagnosticsDavid Wood-0/+58
Signed-off-by: David Wood <david.wood@huawei.com>