mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomez
Remove special-casing of never primitive in rustdoc-json-types Fixes https://github.com/rust-lang/rust/issues/89349 r? `@GuillaumeGomez`
This commit is contained in:
commit
4adc8ea2ac
@ -418,7 +418,6 @@ impl FromWithTcx<clean::Type> for Type {
|
||||
}
|
||||
}
|
||||
Generic(s) => Type::Generic(s.to_string()),
|
||||
Primitive(clean::PrimitiveType::Never) => Type::Never,
|
||||
Primitive(p) => Type::Primitive(p.as_sym().to_string()),
|
||||
BareFunction(f) => Type::FunctionPointer(Box::new((*f).into_tcx(tcx))),
|
||||
Tuple(t) => Type::Tuple(t.into_iter().map(|x| x.into_tcx(tcx)).collect()),
|
||||
|
@ -255,7 +255,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
format_version: 8,
|
||||
format_version: 9,
|
||||
};
|
||||
let mut p = self.out_path.clone();
|
||||
p.push(output.index.get(&output.root).unwrap().name.clone().unwrap());
|
||||
|
@ -388,8 +388,6 @@ pub enum Type {
|
||||
},
|
||||
/// `impl TraitA + TraitB + ...`
|
||||
ImplTrait(Vec<GenericBound>),
|
||||
/// `!`
|
||||
Never,
|
||||
/// `_`
|
||||
Infer,
|
||||
/// `*mut u32`, `*u8`, etc.
|
||||
|
22
src/test/rustdoc-json/primitives.rs
Normal file
22
src/test/rustdoc-json/primitives.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#![feature(never_type)]
|
||||
|
||||
// @has primitives.json "$.index[*][?(@.name=='PrimNever')].visibility" \"public\"
|
||||
// @has - "$.index[*][?(@.name=='PrimNever')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='PrimNever')].inner.type.inner" \"never\"
|
||||
pub type PrimNever = !;
|
||||
|
||||
// @has - "$.index[*][?(@.name=='PrimStr')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='PrimStr')].inner.type.inner" \"str\"
|
||||
pub type PrimStr = str;
|
||||
|
||||
// @has - "$.index[*][?(@.name=='PrimBool')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='PrimBool')].inner.type.inner" \"bool\"
|
||||
pub type PrimBool = bool;
|
||||
|
||||
// @has - "$.index[*][?(@.name=='PrimChar')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='PrimChar')].inner.type.inner" \"char\"
|
||||
pub type PrimChar = char;
|
||||
|
||||
// @has - "$.index[*][?(@.name=='PrimU8')].inner.type.kind" \"primitive\"
|
||||
// @has - "$.index[*][?(@.name=='PrimU8')].inner.type.inner" \"u8\"
|
||||
pub type PrimU8 = u8;
|
Loading…
Reference in New Issue
Block a user