Skip to content

Commit a8f7acd

Browse files
authored
Rollup merge of #117114 - nnethercote:improve-stringify-test, r=petrochenkov
Improve `stringify.rs` test Best reviewed one commit at a time. r? `@petrochenkov`
2 parents d09c988 + c1800fb commit a8f7acd

File tree

2 files changed

+482
-559
lines changed

2 files changed

+482
-559
lines changed

compiler/rustc_ast/src/ast.rs

+7
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ pub enum RangeSyntax {
734734
}
735735

736736
/// All the different flavors of pattern that Rust recognizes.
737+
//
738+
// Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`.
737739
#[derive(Clone, Encodable, Decodable, Debug)]
738740
pub enum PatKind {
739741
/// Represents a wildcard pattern (`_`).
@@ -967,6 +969,7 @@ impl Stmt {
967969
}
968970
}
969971

972+
// Adding a new variant? Please update `test_stmt` in `tests/ui/macros/stringify.rs`.
970973
#[derive(Clone, Encodable, Decodable, Debug)]
971974
pub enum StmtKind {
972975
/// A local (let) binding.
@@ -1345,6 +1348,7 @@ pub struct StructExpr {
13451348
pub rest: StructRest,
13461349
}
13471350

1351+
// Adding a new variant? Please update `test_expr` in `tests/ui/macros/stringify.rs`.
13481352
#[derive(Clone, Encodable, Decodable, Debug)]
13491353
pub enum ExprKind {
13501354
/// An array (`[a, b, c, d]`)
@@ -2015,6 +2019,8 @@ pub struct BareFnTy {
20152019
}
20162020

20172021
/// The various kinds of type recognized by the compiler.
2022+
//
2023+
// Adding a new variant? Please update `test_ty` in `tests/ui/macros/stringify.rs`.
20182024
#[derive(Clone, Encodable, Decodable, Debug)]
20192025
pub enum TyKind {
20202026
/// A variable-length slice (`[T]`).
@@ -2880,6 +2886,7 @@ pub struct ConstItem {
28802886
pub expr: Option<P<Expr>>,
28812887
}
28822888

2889+
// Adding a new variant? Please update `test_item` in `tests/ui/macros/stringify.rs`.
28832890
#[derive(Clone, Encodable, Decodable, Debug)]
28842891
pub enum ItemKind {
28852892
/// An `extern crate` item, with the optional *original* crate name if the crate was renamed.

0 commit comments

Comments
 (0)