mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

Implements https://www.github.com/rust-lang/rust/issues/141358. This has 2 primary benefits: 1. For rustdoc-json consumers, they no longer need to parse strings of attributes, but it's there in a structured and normalized way. 2. For rustc contributors, the output of HIR pretty printing is no longer a versioned thing in the output. People can work on https://github.com/rust-lang/rust/issues/131229 without needing to bump `FORMAT_VERSION`. (Over time, as the attribute refractor continues, I expect we'll add new things to `rustdoc_json_types::Attribute`. But this can be done separately to the rustc changes).
29 lines
879 B
Rust
29 lines
879 B
Rust
#![no_std]
|
|
|
|
//@ is "$.index[?(@.name=='I8')].attrs[*].repr.int" '"i8"'
|
|
//@ is "$.index[?(@.name=='I8')].attrs[*].repr.kind" '"rust"'
|
|
//@ is "$.index[?(@.name=='I8')].attrs[*].repr.align" null
|
|
//@ is "$.index[?(@.name=='I8')].attrs[*].repr.packed" null
|
|
#[repr(i8)]
|
|
pub enum I8 {
|
|
First,
|
|
}
|
|
|
|
//@ is "$.index[?(@.name=='I32')].attrs[*].repr.int" '"i32"'
|
|
//@ is "$.index[?(@.name=='I32')].attrs[*].repr.kind" '"rust"'
|
|
//@ is "$.index[?(@.name=='I32')].attrs[*].repr.align" null
|
|
//@ is "$.index[?(@.name=='I32')].attrs[*].repr.packed" null
|
|
#[repr(i32)]
|
|
pub enum I32 {
|
|
First,
|
|
}
|
|
|
|
//@ is "$.index[?(@.name=='Usize')].attrs[*].repr.int" '"usize"'
|
|
//@ is "$.index[?(@.name=='Usize')].attrs[*].repr.kind" '"rust"'
|
|
//@ is "$.index[?(@.name=='Usize')].attrs[*].repr.align" null
|
|
//@ is "$.index[?(@.name=='Usize')].attrs[*].repr.packed" null
|
|
#[repr(usize)]
|
|
pub enum Usize {
|
|
First,
|
|
}
|