Rollup merge of #110329 - aDotInTheVoid:json-inline-again, r=jyn514

Improve tests for #110138

These should live in rustdoc-json, not rustdoc-ui, so we can run assertions, and not just check there's no ICE

CC #100515, as we never document this suite

r? rustdoc
This commit is contained in:
jyn 2023-04-26 01:55:51 -05:00 committed by GitHub
commit a1d47188a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 11 deletions

View File

@ -0,0 +1,6 @@
//! Should not be inlined
/// Should not be inlined
pub enum O {
L = -1,
}

View File

@ -0,0 +1,10 @@
// Regression Test for https://github.com/rust-lang/rust/issues/110138
// aux-build: enum_with_discriminant.rs
#[doc(inline)]
pub extern crate enum_with_discriminant;
// @!has '$.index[*][?(@.docs == "Should not be inlined")]'
// @is '$.index[*][?(@.name == "enum_with_discriminant")].kind' '"extern_crate"'
// @set enum_with_discriminant = '$.index[*][?(@.name == "enum_with_discriminant")].id'
// @is '$.index[*][?(@.name == "doc_inline_external_crate")].inner.items[*]' $enum_with_discriminant

View File

@ -0,0 +1,10 @@
// aux-build: enum_with_discriminant.rs
extern crate enum_with_discriminant;
#[doc(inline)]
pub use enum_with_discriminant::*;
// @!has '$.index[*][?(@.docs == "Should not be inlined")]'
// @set use = '$.index[*][?(@.inner.name == "enum_with_discriminant")].id'
// @is '$.index[*][?(@.name == "extern_crate_glob")].inner.items[*]' $use

View File

@ -1,3 +0,0 @@
pub enum O {
L = -1,
}

View File

@ -1,8 +0,0 @@
// check-pass
// aux-build: inner-crate-enum.rs
// compile-flags:-Z unstable-options --output-format json
#[doc(inline)]
pub extern crate inner_crate_enum;
fn main() {}