Skip to content

Commit

Permalink
Rollup merge of rust-lang#117114 - nnethercote:improve-stringify-test…
Browse files Browse the repository at this point in the history
…, r=petrochenkov

Improve `stringify.rs` test

Best reviewed one commit at a time.

r? `@petrochenkov`
  • Loading branch information
matthiaskrgr authored Oct 26, 2023
2 parents d09c988 + c1800fb commit a8f7acd
Show file tree
Hide file tree
Showing 2 changed files with 482 additions and 559 deletions.
7 changes: 7 additions & 0 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ pub enum RangeSyntax {
}

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

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

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

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

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

0 comments on commit a8f7acd

Please sign in to comment.