diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-12-23 11:43:31 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-12-23 11:43:31 +0100 |
| commit | c29f763153ac89e7930c6d50f5ab4656318b30d4 (patch) | |
| tree | e8e15c4887d72f392590b26988bae58de5b661fb /src | |
| parent | 0fd3be948ac6be2f695c699a0221634ebfafabc0 (diff) | |
Add `is_object_safe` information for traits in JSON output
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 2 | ||||
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 61376ab31dd..513e94afe29 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -648,10 +648,12 @@ impl FromWithTcx<clean::Trait> for Trait { fn from_tcx(trait_: clean::Trait, tcx: TyCtxt<'_>) -> Self { let is_auto = trait_.is_auto(tcx); let is_unsafe = trait_.unsafety(tcx) == rustc_hir::Unsafety::Unsafe; + let is_object_safe = trait_.is_object_safe(tcx); let clean::Trait { items, generics, bounds, .. } = trait_; Trait { is_auto, is_unsafe, + is_object_safe, items: ids(items, tcx), generics: generics.into_tcx(tcx), bounds: bounds.into_tcx(tcx), diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 5d979521885..164f88faa31 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// rustdoc format-version. -pub const FORMAT_VERSION: u32 = 27; +pub const FORMAT_VERSION: u32 = 28; /// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information /// about the language items in the local crate, as well as info about external items to allow @@ -634,6 +634,7 @@ pub struct FnDecl { pub struct Trait { pub is_auto: bool, pub is_unsafe: bool, + pub is_object_safe: bool, pub items: Vec<Id>, pub generics: Generics, pub bounds: Vec<GenericBound>, |
