Debian Codegraph @

tests/367_implicit_some.rs

raw symbols SCIP
1 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:, serderust-analyzer cargo serde 1.0.228 crate/::Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:)]
2 struct MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
3 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: i64,
4 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<i64>,
5 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<i64>>,
6 }
7
8 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
9 fn test_recursive_implicit_somerust-analyzer cargo ron 0.12.0 test_recursive_implicit_some().() {
10 // Test case provided by d86leader in
11 // https://github.com/ron-rs/ron/issues/367#issue-1147920589
12
13 let x1: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
14 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1)");
15 let x2: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
16 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1, f2: None, f3: None)");
17 let x3: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
18 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1, f2: 2, f3: 3)");
19 let x4: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
20 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1, f2: 2, f3: Some(3))");
21 let x5: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
22 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1, f2: 2, f3: Some(Some(3)))");
23 let x6: stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields#, _> =
24 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("#![enable(implicit_some)]\n(f1: 1, f2: 2, f3: Some(None))");
25
26 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
27 x1,
28 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
29 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
30 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
31 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#
32 })
33 );
34 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
35 x2,
36 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
37 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
38 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
39 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#
40 })
41 );
42 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
43 x3,
44 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
45 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
46 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2),
47 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(3))
48 })
49 );
50 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
51 x4,
52 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
53 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
54 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2),
55 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(3))
56 })
57 );
58 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
59 x5,
60 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
61 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
62 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2),
63 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(3))
64 })
65 );
66 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
67 x6,
68 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(MaybeFieldsrust-analyzer cargo ron 0.12.0 MaybeFields# {
69 f1rust-analyzer cargo ron 0.12.0 MaybeFields#f1.: 1,
70 f2rust-analyzer cargo ron 0.12.0 MaybeFields#f2.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2),
71 f3rust-analyzer cargo ron 0.12.0 MaybeFields#f3.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)
72 })
73 );
74 }
75
76 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
77 fn test_nested_implicit_somerust-analyzer cargo ron 0.12.0 test_nested_implicit_some().() {
78 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
79 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\n5"),
80 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(5))))
81 );
82 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
83 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\nNone"),
84 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)
85 );
86 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
87 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\nSome(5)"),
88 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(5))))
89 );
90 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
91 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\nSome(None)"),
92 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#))
93 );
94 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
95 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\nSome(Some(5))"),
96 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(5))))
97 );
98 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
99 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>("#![enable(implicit_some)]\nSome(Some(None))"),
100 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)))
101 );
102 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
103 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u32>>>>(
104 "#![enable(implicit_some)]\nSome(Some(Some(5)))"
105 ),
106 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(5))))
107 );
108 }
109
110 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
111 fn fuzzer_found_issuesrust-analyzer cargo ron 0.12.0 fuzzer_found_issues().() {
112 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, serderust-analyzer cargo serde 1.0.228 crate/::Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
113 struct Some_rust-analyzer cargo ron 0.12.0 Some_#();
114
115 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, serderust-analyzer cargo serde 1.0.228 crate/::Serializerust-analyzer cargo serde_derive 1.0.228 Serialize:, serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_derive 1.0.228 Deserialize:)]
116 struct None_rust-analyzer cargo ron 0.12.0 None_#();
117
118 let ser_some = ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::to_string_prettyrust-analyzer cargo ron 0.12.0 ser/to_string_pretty().(
119 &Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Some_rust-analyzer cargo ron 0.12.0 Some_#()),
120 ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::PrettyConfigrust-analyzer cargo ron 0.12.0 ser/PrettyConfig#::defaultrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig][Default]default().()
121 .struct_namesrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig]struct_names().(true)
122 .extensionsrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig]extensions().(ronrust-analyzer cargo ron 0.12.0 crate/::extensionsrust-analyzer cargo ron 0.12.0 extensions/::Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::IMPLICIT_SOMErust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]IMPLICIT_SOME.),
123 )
124 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
125 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ser_some, "#![enable(implicit_some)]\nSome_()");
126
127 let ser_none = ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::to_string_prettyrust-analyzer cargo ron 0.12.0 ser/to_string_pretty().(
128 &Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(None_rust-analyzer cargo ron 0.12.0 None_#()),
129 ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::PrettyConfigrust-analyzer cargo ron 0.12.0 ser/PrettyConfig#::defaultrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig][Default]default().()
130 .struct_namesrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig]struct_names().(true)
131 .extensionsrust-analyzer cargo ron 0.12.0 ser/impl#[PrettyConfig]extensions().(ronrust-analyzer cargo ron 0.12.0 crate/::extensionsrust-analyzer cargo ron 0.12.0 extensions/::Extensionsrust-analyzer cargo ron 0.12.0 extensions/Extensions#::IMPLICIT_SOMErust-analyzer cargo ron 0.12.0 extensions/impl#[Extensions]IMPLICIT_SOME.),
132 )
133 .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
134 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(ser_none, "#![enable(implicit_some)]\nNone_()");
135
136 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
137 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Some_rust-analyzer cargo ron 0.12.0 Some_#>>(&ser_some).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(),
138 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Some_rust-analyzer cargo ron 0.12.0 Some_#())
139 );
140 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
141 ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().::<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<None_rust-analyzer cargo ron 0.12.0 None_#>>(&ser_none).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(),
142 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(None_rust-analyzer cargo ron 0.12.0 None_#())
143 );
144 }