about summary refs log tree commit diff
path: root/src/test/ui-fulldeps
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-7191/+0
2022-12-31Add missing extern crate rustc_driverbjorn3-0/+57
2022-12-31Add help for the error message when missing rustc_driverbjorn3-0/+33
2022-12-19docs: add long-form error-code docs for E0457Ezra Shaw-0/+1
2022-12-14Auto merge of #105233 - mejrs:always_eager, r=estebankbors-18/+34
Always evaluate vecs of subdiagnostics eagerly See https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/310186705 for context
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-19/+12
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Combine projection and opaque into aliasMichael Goulet-19/+12
2022-12-13bless fulldeps testsOli Scherer-3/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-2/+1
available
2022-12-04Always evaluate vecs of subdiagnostics eagerlymejrs-18/+34
2022-12-03Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillotMatthias Krüger-0/+1
Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
2022-12-02Merge `builtins` into `EarlyLintPassObjects`.Nicholas Nethercote-129/+86
This avoids calling `early_lint_node` twice. Note: one `early_lint_node` call had `!pre_expansion` for the second argument and the other had `false`. The new single call just has `!pre_expansion`. This results in a reduction of duplicate error messages in some `ui-fulldeps` tests. The order of some `ui-fulldeps` output also changes, but that doesn't matter.
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-0/+1
2022-11-21Improve slug name errormejrs-0/+35
2022-11-21Fix testsmejrs-129/+129
2022-11-17Use `ThinVec` in `ast::Path`.Nicholas Nethercote-1/+3
2022-11-17Box `ExprKind::{Closure,MethodCall}`, and `QSelf` in expressions, types, and ↵Nicholas Nethercote-13/+17
patterns.
2022-11-06make uninit_mask a unit testRalf Jung-28/+0
2022-10-26Remove #[suggestion_*] attributesXiretza-72/+84
2022-10-26Add "tool-only" suggestion styleXiretza-9/+16
2022-10-26rustfmt diagnostic derive testsXiretza-85/+80
2022-10-26Add style= parameter to suggestion attributesXiretza-4/+141
2022-10-23Allow specifying multiple alternative suggestionsXiretza-2/+133
This allows porting uses of span_suggestions() to diagnostic structs. Doesn't work for multipart_suggestions() because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while multipart_suggestions() creates multiple possible replacements, each with multiple spans.
2022-10-23Update translation testsNilstrieb-342/+356
2022-10-17macros: allow subdiagnostic-kind-less variantsDavid Wood-50/+43
Sometimes it is convenient to return a subdiagnostic enum where one or more of the variants don't add anything to the diagnostic. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-17macros: support doc comments in diag derivesDavid Wood-0/+30
Documentation comments shouldn't affect the diagnostic derive in any way, but explicit support has to be added for ignoring the `doc` attribute. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10macros: separate suggestion fmt'ing and emissionDavid Wood-0/+24
Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move. This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg` anyway. However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as: ```rust let diag = { /* create diagnostic */ }; diag.span_suggestion_with_style( span, fluent::crate::slug, format!("{}", __binding_0), Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.emit(); ``` For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first. Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition. By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added. ```rust let diag = { /* create diagnostic */ }; let __code_0 = format!("{}", __binding_0); /* + other formatting */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.span_suggestion_with_style( span, fluent::crate::slug, __code_0, Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.emit(); ``` Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10macros: `#[subdiagnostic(eager)]`David Wood-1/+88
Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10errors: `AddToDiagnostic::add_to_diagnostic_with`David Wood-7/+13
`AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-03errors: rename `typeck.ftl` to `hir_analysis.ftl`David Wood-233/+233
In #102306, `rustc_typeck` was renamed to `rustc_hir_analysis` but the diagnostic resources were not renamed - which is what this commit changes. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-01`ui-fulldeps`: adopt to the new rustc lint APIMaybe Waffle-39/+43
2022-09-28Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwcobors-0/+14
Migrate more of rustc_parse to SessionDiagnostic Still far from complete, but I thought I'd add a checkpoint here because rebasing was starting to get annoying.
2022-09-27Allow raw identifiers to be used as fluent argumentsXiretza-0/+14
2022-09-27Update tests.Mara Bos-6/+4
2022-09-26macros: support diagnostic derive on enumsDavid Wood-88/+119
Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-26Rollup merge of #101851 - Xiretza:diagnostic-derive-cleanups, r=davidtwcofee1-dead-176/+400
Clean up (sub)diagnostic derives The biggest chunk of this is unifying the parsing of subdiagnostic attributes (`#[error]`, `#[suggestion(...)]`, `#[label(...)]`, etc) between `Subdiagnostic` and `Diagnostic` type attributes as well as `Diagnostic` field attributes. It also improves a number of proc macro diagnostics. Waiting for #101558.
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-1/+1
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-22Unify subdiagnostic attribute parsingXiretza-85/+221
2022-09-22Add missing code="" attributes to suggestion subdiagnosticsXiretza-1/+1
2022-09-22Extract subdiagnostic attribute parsingXiretza-83/+105
2022-09-22Point to previous applicability when declared multiple timesXiretza-2/+8
2022-09-22Ensure #[suggestion] is only applied to correct tuple typesXiretza-15/+55
2022-09-22Ensure code= in #[suggestion(...)] is only set onceXiretza-1/+21
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-6/+6
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-69/+69
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-87/+87
2022-09-21UPDATE - rename AddSubdiagnostic trait to AddToDiagnosticJhonny Bill Mena-9/+9
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-94/+95
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-2/+1
2022-09-08Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwcoDylan DPC-6/+6
Allow lint passes to be bound by `TyCtxt` This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`. r? rust-lang/compiler