rust/tests
bors be581d9f82 Auto merge of #116142 - GuillaumeGomez:enum-variant-display, r=fmease
[rustdoc] Show enum discrimant if it is a C-like variant

Fixes https://github.com/rust-lang/rust/issues/101337.

We currently display values for associated constant items in traits:

![image](https://github.com/rust-lang/rust/assets/3050060/03e566ec-c670-47b4-8ca2-b982baa7a0f4)

And we also display constant values like [here](file:///home/imperio/rust/rust/build/x86_64-unknown-linux-gnu/doc/std/f32/consts/constant.E.html).

I think that for coherency, we should display values of C-like enum variants.

With this change, it looks like this:

![image](https://github.com/rust-lang/rust/assets/3050060/b53fbbe0-bdb1-4289-8537-f2dd4988e9ac)

As for the display of the constant value itself, I used what we already have to keep coherency.

We display the C-like variants value in the following scenario:
 1. It is a C-like variant with a value set => all the time
 2. It is a C-like variant without a value set: All other variants are C-like variants and at least one them has its value set.

Here is the result in code:

```rust
// Ax and Bx value will be displayed.
enum A {
    Ax = 12,
    Bx,
}

// Ax and Bx value will not be displayed
enum B {
    Ax,
    Bx,
}

// Bx value will not be displayed
enum C {
    Ax(u32),
    Bx,
}

// Bx value will not be displayed, Cx value will be displayed.
#[repr(u32)]
enum D {
    Ax(u32),
    Bx,
    Cx = 12,
}
```

r? `@notriddle`
2023-10-09 13:18:47 +00:00
..
assembly
auxiliary
codegen Ignore MSVC in test. 2023-10-08 16:45:45 +00:00
codegen-units
coverage-map
debuginfo
incremental Bless incremental tests. 2023-10-06 15:46:11 +00:00
mir-opt Preserve DebugInfo in DeadStoreElimination. 2023-10-06 15:46:11 +00:00
pretty
run-coverage
run-coverage-rustdoc
run-make Auto merge of #116514 - petrochenkov:nogccld, r=lqd 2023-10-08 09:04:57 +00:00
run-make-fulldeps
run-pass-valgrind
rustdoc Auto merge of #116142 - GuillaumeGomez:enum-variant-display, r=fmease 2023-10-09 13:18:47 +00:00
rustdoc-gui
rustdoc-js rustdoc-search: fix bug with multi-item impl trait 2023-10-05 22:32:37 -07:00
rustdoc-js-std
rustdoc-json
rustdoc-ui
ui Auto merge of #116533 - cjgillot:skip-trivial-mir, r=oli-obk 2023-10-09 06:00:23 +00:00
ui-fulldeps Rollup merge of #116428 - Alexendoo:note-duplicate-diagnostics, r=compiler-errors,estebank 2023-10-05 19:24:35 +02:00
COMPILER_TESTS.md