about summary refs log tree commit diff
path: root/src/test/ui-fulldeps
AgeCommit message (Collapse)AuthorLines
2022-09-06Allow lint passes to be bound by `TyCtxt`Jason Newcomb-6/+6
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-5/+5
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-13/+15
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-11/+11
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-02Rollup merge of #101294 - Xiretza:fix-100844-accident, r=davidtwcoGuillaume Gomez-85/+299
Fix #100844 rebase accident This undoes the rebase accident in #100844, which accidentally caused #100970 to be reverted.
2022-09-01Allow deriving multiple subdiagnostics using one SessionSubdiagnosticXiretza-48/+34
This reimplements ac638c1, which had to be reverted in the previous commit because it contains a rebase accident that itself reverted significant unrelated changes to SessionSubdiagnostic.
2022-09-01Revert parts of "use derive proc macro to impl SessionDiagnostic"Xiretza-85/+313
This reverts parts of commit ac638c1f5fca36484506415319ab254ad522a692. During rebase, this commit accidentally reverted unrelated changes to the subdiagnostic derive (those allowing multipart_suggestions to be derived). This commit reverts all changes to the subdiagnostic code made in ac638c1f5fc, the next commit will reintroduce the actually intended changes.
2022-09-01Adjust stderr fileOli Scherer-2/+2
2022-08-31Rollup merge of #101230 - davidtwco:translation-internal-lint-no-self-lint, ↵Matthias Krüger-7/+15
r=fee1-dead lint: avoid linting diag functions with diag lints Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted. cc #100717 https://github.com/rust-lang/rust/pull/101041#discussion_r959303706
2022-08-31lint: avoid linting diag functions with diag lintsDavid Wood-7/+15
Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-31use derive proc macro to impl SessionDiagnosticYuanheng Li-313/+85
fixes `SessionSubdiagnostic` to accept multiple attributes emitting list of fluent message remains unresolved
2022-08-31Rollup merge of #100970 - Xiretza:derive-multipart-suggestion, r=davidtwcoMatthias Krüger-100/+292
Allow deriving multipart suggestions This turned into a bit more of a rewrite than I was initially hoping for... Still, I think the `SessionSubdiagnostic` derive is a little cleaner overall now, and closer to the `SessionDiagnostic` derive to make future code sharing easier. r? ``@davidtwco``
2022-08-30Rework SessionSubdiagnostic derive to support multipart_suggestionXiretza-48/+278
2022-08-30Unify indentation in subdiagnostic-derive testXiretza-16/+16
2022-08-30SessionSubdiagnostic: make `#[applicability]` optionalXiretza-47/+9
2022-08-30Rollup merge of #101123 - JohnTitor:rm-register-attr, r=TaKO8KiDylan DPC-33/+0
Remove `register_attr` feature Closes #66080 Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-28Remove `register_attr`-related testsYuki Okushi-33/+0
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-24translations: rename warn_ to warningLuis Cardoso-23/+22
The macro warn_ was named like that because it the keyword warn is a built-in attribute and at the time this macro was created the word 'warning' was also taken. However it is no longer the case and we can rename warn_ to warning.
2022-08-22fluent: update testsXiretza-21/+60
2022-08-22Use `AttrVec` in more places.Nicholas Nethercote-3/+2
In some places we use `Vec<Attribute>` and some places we use `ThinVec<Attribute>` (a.k.a. `AttrVec`). This results in various points where we have to convert between `Vec` and `ThinVec`. This commit changes the places that use `Vec<Attribute>` to use `AttrVec`. A lot of this is mechanical and boring, but there are some interesting parts: - It adds a few new methods to `ThinVec`. - It implements `MapInPlace` for `ThinVec`, and introduces a macro to avoid the repetition of this trait for `Vec`, `SmallVec`, and `ThinVec`. Overall, it makes the code a little nicer, and has little effect on performance. But it is a precursor to removing `rustc_data_structures::thin_vec::ThinVec` and replacing it with `thin_vec::ThinVec`, which is implemented more efficiently.
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-213/+286
2022-08-21Disallow #[primary_span] on LintDiagnosticsXiretza-1/+17
2022-08-21Make derived SessionDiagnostics generic on diagnostic levelXiretza-79/+47
Deriving SessionDiagnostic on a type no longer forces that diagnostic to be one of warning, error, or fatal. The level is instead decided when the struct is passed to the respective Handler::emit_*() method.
2022-08-21Add Handler::struct_diagnostic()Xiretza-1/+1
This unifies the struct_{warn,error,fatal}() methods in one generic method.
2022-08-12Change fluent_messages macro to expect _ slugs instead of - slugsest31-1/+38
For the most part, the macro actually worked with _ slugs, but the prefix_something -> prefix::something conversion was not implemented. We don't want to accept - slugs for consistency reasons. We thus error if a name is found with - inside. This ensures a consistent style.
2022-08-12Fix testsest31-4/+4
2022-08-10Adapt ui-fulldeps test.Camille GILLOT-2/+2
2022-07-31Remove workarounds for issue 59998bjorn3-40/+0
2022-07-27lint: add bad opt access internal lintDavid Wood-0/+42
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-4/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-23Rollup merge of #99298 - ChrisDenton:ignore-plugins-stage1, r=Mark-SimulacrumGuillaume Gomez-4/+6
Make `ui-fulldeps/gated-plugins` and `ui-fulldeps/multiple-plugins` tests stage 2 only These test can fail on stage 1. Fixes #99295
2022-07-19tests: fix `rustc-pass-by-value-self`Artur Sinila-2/+2
2022-07-19tests: fix `rustc-pass-by-value-self`Artur Sinila-4/+4
2022-07-15stage 2 `gated-plugins` and `multiple-plugins`Chris Denton-4/+6
These test can fail on stage 1
2022-07-15macros: support adding warnings to diagsDavid Wood-3/+22
Both diagnostic and subdiagnostic derives were missing the ability to add warnings to diagnostics - this is made more difficult by the `warn` attribute already existing, so this name being unavailable for the derives to use. `#[warn_]` is used instead, which requires special-casing so that `{span_,}warn` is called instead of `{span_,}warn_`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15macros: support `MultiSpan` in diag derivesDavid Wood-9/+16
Add support for `MultiSpan` with any of the attributes that work on a `Span` - requires that diagnostic logic generated for these attributes are emitted in the by-move block rather than the by-ref block that they would normally have been generated in. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-0/+1
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-13Bless ui-fulldeps tests.Camille GILLOT-3/+3
2022-07-12Parse closure bindersMaybe Waffle-0/+1
This is first step in implementing RFC 3216. - Parse `for<'a>` before closures in ast - Error in lowering - Add `closure_lifetime_binder` feature
2022-07-11Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkovMatthias Krüger-1/+1
Fix duplicated type annotation suggestion Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-09Auto merge of #98950 - ChrisDenton:getoverlapped-io, r=thomccbors-0/+81
Windows: Fallback for overlapped I/O Fixes #98947
2022-07-08Fixup diagnostic-derive testDaniel Xu-1/+1
2022-07-06Fix ui-fulldep testChris Denton-6/+11
2022-07-06Tests for unsound Windows file methodsChris Denton-0/+76
2022-07-05macros: add diagnostic derive for lintsDavid Wood-2/+41
`SessionDiagnostic` isn't suitable for use on lints as whether or not it creates an error or a warning is decided at compile-time by the macro, whereas lints decide this at runtime based on the location of the lint being reported (as it will depend on the user's `allow`/`deny` attributes, etc). Re-using most of the machinery for `SessionDiagnostic`, this macro introduces a `LintDiagnostic` derive which implements a `DecorateLint` trait, taking a `LintDiagnosticBuilder` and adding to the lint according to the diagnostic struct.
2022-06-30tests: avoid inadvertent diffs in diag derive testDavid Wood-60/+56
In the diagnostic derive test, a "the following other types implement trait" diagnostic is output which lists rustc types that implement `IntoDiagnosticArg`. As the output of this test can change due to new internal compiler types like implementing `IntoDiagnosticArg`, it can start failing without indicating a problem to be fixed - so normalize that output away. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port non-existant doc keyword diagnosticsDavid Wood-1/+1
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24macros: use typed identifiers in subdiag deriveDavid Wood-175/+195
As in the diagnostic derive, using typed identifiers in the subdiagnostic derive improves the diagnostics of using the subdiagnostic derive as Fluent messages will be confirmed to exist at compile-time. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24macros: use typed identifiers in diag deriveDavid Wood-219/+309
Using typed identifiers instead of strings with the Fluent identifier enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers - use of a non-existent Fluent identifier will not compile. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-16Move `finish` out of the `Encoder` trait.Nicholas Nethercote-3/+3
This simplifies things, but requires making `CacheEncoder` non-generic. (This was previously merged as commit 4 in #94732 and then was reverted in #97905 because it caused a perf regression.)