Skip to content

Commit c29f763

Browse files
Add is_object_safe information for traits in JSON output
1 parent 0fd3be9 commit c29f763

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/librustdoc/json/conversions.rs

+2
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ impl FromWithTcx<clean::Trait> for Trait {
648648
fn from_tcx(trait_: clean::Trait, tcx: TyCtxt<'_>) -> Self {
649649
let is_auto = trait_.is_auto(tcx);
650650
let is_unsafe = trait_.unsafety(tcx) == rustc_hir::Unsafety::Unsafe;
651+
let is_object_safe = trait_.is_object_safe(tcx);
651652
let clean::Trait { items, generics, bounds, .. } = trait_;
652653
Trait {
653654
is_auto,
654655
is_unsafe,
656+
is_object_safe,
655657
items: ids(items, tcx),
656658
generics: generics.into_tcx(tcx),
657659
bounds: bounds.into_tcx(tcx),

src/rustdoc-json-types/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
use std::path::PathBuf;
99

1010
/// rustdoc format-version.
11-
pub const FORMAT_VERSION: u32 = 27;
11+
pub const FORMAT_VERSION: u32 = 28;
1212

1313
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1414
/// about the language items in the local crate, as well as info about external items to allow
@@ -634,6 +634,7 @@ pub struct FnDecl {
634634
pub struct Trait {
635635
pub is_auto: bool,
636636
pub is_unsafe: bool,
637+
pub is_object_safe: bool,
637638
pub items: Vec<Id>,
638639
pub generics: Generics,
639640
pub bounds: Vec<GenericBound>,

0 commit comments

Comments
 (0)