Debian Codegraph @

tests/integration/deprecated.rs

raw symbols SCIP
1 #![allow(deprecated)]
2
3 use craterust-analyzer cargo schemars 1.2.2 crate/::preluderust-analyzer cargo schemars 1.2.2 prelude/::*;
4 use pretty_assertionsrust-analyzer cargo pretty_assertions 1.4.1 crate/::assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!;
5
6 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:)]
7 #[deprecated]
8 struct DeprecatedStructrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedStruct# {
9 foorust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedStruct#foo.: i32,
10 #[deprecated]
11 barrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedStruct#bar.: bool,
12 }
13
14 #[allow(deprecated)]
15 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
16 fn deprecated_structrust-analyzer cargo schemars 1.2.2 deprecated/deprecated_struct().() {
17 testrust-analyzer cargo schemars 1.2.2 test!!(DeprecatedStructrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedStruct#)
18 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
19 .assert_allows_ser_roundtrip_defaultrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip_default().()
20 .customrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]custom().(|schema, _| {
21 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
22 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/deprecated"),
23 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
24 );
25 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
26 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/properties/bar/deprecated"),
27 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
28 );
29 });
30 }
31
32 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:)]
33 #[deprecated]
34 enum DeprecatedEnumrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum# {
35 #[defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/default:]
36 Unitrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#Unit#,
37 #[deprecated]
38 DeprecatedUnitVariantrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#DeprecatedUnitVariant#,
39 #[deprecated]
40 DeprecatedStructVariantrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#DeprecatedStructVariant# {
41 foorust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#DeprecatedStructVariant#foo.: i32,
42 #[deprecated]
43 deprecated_fieldrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#DeprecatedStructVariant#deprecated_field.: bool,
44 },
45 }
46
47 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
48 fn deprecated_enumrust-analyzer cargo schemars 1.2.2 deprecated/deprecated_enum().() {
49 testrust-analyzer cargo schemars 1.2.2 test!!(DeprecatedEnumrust-analyzer cargo schemars 1.2.2 deprecated/DeprecatedEnum#)
50 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
51 .assert_allows_ser_roundtrip_defaultrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip_default().()
52 .customrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]custom().(|schema, _| {
53 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
54 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/deprecated"),
55 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
56 );
57 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
58 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/oneOf/1/deprecated"),
59 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
60 );
61 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
62 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/oneOf/2/deprecated"),
63 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
64 );
65 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(
66 schema.as_valuerust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]as_value().().pointerrust-analyzer cargo serde_json 1.0.151 value/impl#[Value]pointer().("/oneOf/2/properties/DeprecatedStructVariant/properties/deprecated_field/deprecated"),
67 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Boolrust-analyzer cargo serde_json 1.0.151 value/Value#Bool#(true)),
68 );
69 });
70 }