diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 7f150f38025..b3df12a9df1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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 { diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index a37d4f31643..cd97766752d 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -2019,7 +2019,7 @@ pub(crate) fn has_stripped_entries(&self) -> Option { #[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, pub(super) value: DefId, diff --git a/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs new file mode 100644 index 00000000000..6c48f5aa01f --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs @@ -0,0 +1,3 @@ +pub enum O { + L = -1, +} diff --git a/tests/rustdoc-ui/intra-doc/inline-external-enum.rs b/tests/rustdoc-ui/intra-doc/inline-external-enum.rs new file mode 100644 index 00000000000..363dd7f64c2 --- /dev/null +++ b/tests/rustdoc-ui/intra-doc/inline-external-enum.rs @@ -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() {}