Skip to content

Commit

Permalink
Rollup merge of rust-lang#110146 - bvanjoi:relative-110138, r=notriddle
Browse files Browse the repository at this point in the history
fix(doc): do not parse inline when output is json for external crate

relative rust-lang#110138
  • Loading branch information
JohnTitor committed Apr 11, 2023
2 parents 75a4625 + c127020 commit a996418
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ impl Variant {

#[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,
Expand Down
3 changes: 3 additions & 0 deletions tests/rustdoc-ui/intra-doc/auxiliary/inner-crate-enum.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub enum O {
L = -1,
}
8 changes: 8 additions & 0 deletions tests/rustdoc-ui/intra-doc/inline-external-enum.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit a996418

Please sign in to comment.