Rollup merge of #110146 - bvanjoi:relative-110138, r=notriddle

fix(doc): do not parse inline when output is json for external crate

relative #110138
This commit is contained in:
Yuki Okushi 2023-04-11 12:18:51 +09:00 committed by GitHub
commit a996418e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -2381,7 +2381,8 @@ fn clean_extern_crate<'tcx>(
Some(l) => attr::list_contains_name(&l, sym::inline),
None => false,
}
});
})
&& !cx.output_format.is_json();
let krate_owner_def_id = krate.owner_id.to_def_id();
if please_inline {

View File

@ -2019,7 +2019,7 @@ pub(crate) fn has_stripped_entries(&self) -> Option<bool> {
#[derive(Clone, Debug)]
pub(crate) struct Discriminant {
// In the case of cross crate re-exports, we don't have the nessesary information
// In the case of cross crate re-exports, we don't have the necessary information
// to reconstruct the expression of the discriminant, only the value.
pub(super) expr: Option<BodyId>,
pub(super) value: DefId,

View File

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

View File

@ -0,0 +1,8 @@
// 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() {}