Skip to content

Commit 5c426ba

Browse files
committed
Auto merge of #153416 - JonathanBrouwer:rollup-eezxWTV, r=JonathanBrouwer
Rollup of 12 pull requests Successful merges: - rust-lang/rust#153402 (miri subtree update) - rust-lang/rust#152164 (Lint unused features) - rust-lang/rust#152801 (Refactor WriteBackendMethods a bit) - rust-lang/rust#153196 (Update path separators to be available in const context) - rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors) - rust-lang/rust#153317 (Abort after `representability` errors) - rust-lang/rust#153276 (Remove `cycle_fatal` query modifier) - rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes) - rust-lang/rust#153396 (use `minicore` in some `run-make` tests) - rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7) - rust-lang/rust#153406 (Remove a ping for myself) - rust-lang/rust#153414 (Rename translation -> formatting)
2 parents 5f3040f + 07734d9 commit 5c426ba

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/compiler-debugging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ Here are some notable ones:
275275
|----------------|-------------|
276276
| `rustc_def_path` | Dumps the [`def_path_str`] of an item. |
277277
| `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. |
278+
| `rustc_dump_inferred_outlives` | Dumps implied bounds of an item. More precisely, the [`inferred_outlives_of`] an item. |
278279
| `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. |
280+
| `rustc_dump_object_lifetime_defaults` | Dumps the [object lifetime defaults] of an item. |
279281
| `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. |
282+
| `rustc_dump_variances` | Dumps the [variances] of an item. |
280283
| `rustc_dump_vtable` | Dumps the vtable layout of an impl, or a type alias of a dyn type. |
281284
| `rustc_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. |
282285
| `rustc_layout` | [See this section](#debugging-type-layouts). |
283-
| `rustc_object_lifetime_default` | Dumps the [object lifetime defaults] of an item. |
284-
| `rustc_outlives` | Dumps implied bounds of an item. More precisely, the [`inferred_outlives_of`] an item. |
285286
| `rustc_regions` | Dumps NLL closure region requirements. |
286287
| `rustc_symbol_name` | Dumps the mangled & demangled [`symbol_name`] of an item. |
287-
| `rustc_variances` | Dumps the [variances] of an item. |
288288

289289
Right below you can find elaborate explainers on a selected few.
290290

src/diagnostics/diagnostic-structs.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Diagnostic and subdiagnostic structs
2-
rustc has three diagnostic traits that can be used to create diagnostics:
3-
`Diagnostic`, `LintDiagnostic`, and `Subdiagnostic`.
2+
rustc has two diagnostic traits that can be used to create diagnostics:
3+
`Diagnostic` and `Subdiagnostic`.
44

55
For simple diagnostics,
66
derived impls can be used, e.g. `#[derive(Diagnostic)]`. They are only suitable for simple diagnostics that
77
don't require much logic in deciding whether or not to add additional subdiagnostics.
88

99
In cases where diagnostics require more complex or dynamic behavior, such as conditionally adding subdiagnostics,
1010
customizing the rendering logic, or selecting messages at runtime, you will need to manually implement
11-
the corresponding trait (`Diagnostic`, `LintDiagnostic`, or `Subdiagnostic`).
11+
the corresponding trait (`Diagnostic` or `Subdiagnostic`).
1212
This approach provides greater flexibility and is recommended for diagnostics that go beyond simple, static structures.
1313

1414
Diagnostic can be translated into different languages.
1515

16-
## `#[derive(Diagnostic)]` and `#[derive(LintDiagnostic)]`
16+
## `#[derive(Diagnostic)]`
1717

1818
Consider the [definition][defn] of the "field already declared" diagnostic shown below:
1919

@@ -123,8 +123,8 @@ tcx.dcx().emit_err(FieldAlreadyDeclared {
123123
});
124124
```
125125

126-
### Reference for `#[derive(Diagnostic)]` and `#[derive(LintDiagnostic)]`
127-
`#[derive(Diagnostic)]` and `#[derive(LintDiagnostic)]` support the following attributes:
126+
### Reference for `#[derive(Diagnostic)]`
127+
`#[derive(Diagnostic)]` supports the following attributes:
128128

129129
- `#[diag("message", code = "...")]`
130130
- _Applied to struct or enum variant._
@@ -171,7 +171,6 @@ tcx.dcx().emit_err(FieldAlreadyDeclared {
171171
- Adds the subdiagnostic represented by the subdiagnostic struct.
172172
- `#[primary_span]` (_Optional_)
173173
- _Applied to `Span` fields on `Subdiagnostic`s.
174-
Not used for `LintDiagnostic`s._
175174
- Indicates the primary span of the diagnostic.
176175
- `#[skip_arg]` (_Optional_)
177176
- _Applied to any field._

src/diagnostics/translation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ There are two ways of writing translatable diagnostics:
3232
deciding to emit subdiagnostics and can therefore be represented as diagnostic structs).
3333
See [the diagnostic and subdiagnostic structs documentation](./diagnostic-structs.md).
3434
2. Using typed identifiers with `Diag` APIs (in
35-
`Diagnostic` or `Subdiagnostic` or `LintDiagnostic` implementations).
35+
`Diagnostic` or `Subdiagnostic` implementations).
3636

3737
When adding or changing a translatable diagnostic,
3838
you don't need to worry about the translations.

0 commit comments

Comments
 (0)