Debian Codegraph @

tests/test_convert.rs

raw symbols SCIP
1 #![allow(clippy::unnecessary_wraps)]
2
3 mod droprust-analyzer cargo anyhow 1.0.103 drop/;
4
5 use selfrust-analyzer cargo anyhow 1.0.103 crate/::droprust-analyzer cargo anyhow 1.0.103 drop/::{DetectDroprust-analyzer cargo anyhow 1.0.103 drop/DetectDrop#, Flagrust-analyzer cargo anyhow 1.0.103 drop/Flag#};
6 use anyhowrust-analyzer cargo anyhow 1.0.103 crate/::{Errorrust-analyzer cargo anyhow 1.0.103 Error#, Resultrust-analyzer cargo anyhow 1.0.103 Result#};
7 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# as StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#;
8
9 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
10 fn test_convertrust-analyzer cargo anyhow 1.0.103 test_convert().() {
11 let has_dropped = Flagrust-analyzer cargo anyhow 1.0.103 drop/Flag#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]new().();
12 let error = Errorrust-analyzer cargo anyhow 1.0.103 Error#::newrust-analyzer cargo anyhow 1.0.103 error/impl#[Error]new().(DetectDroprust-analyzer cargo anyhow 1.0.103 drop/DetectDrop#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[DetectDrop]new().(&has_dropped));
13 let box_dyn = Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::<dyn StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>::fromrust-analyzer cargo anyhow 1.0.103 error/impl#[`Box<dyn Error + 'static>`][`From<Error>`]from().(error);
14 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!("oh no!", box_dyn.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().());
15 droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/drop().(box_dyn);
16 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(has_dropped.getrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]get().());
17 }
18
19 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
20 fn test_convert_sendrust-analyzer cargo anyhow 1.0.103 test_convert_send().() {
21 let has_dropped = Flagrust-analyzer cargo anyhow 1.0.103 drop/Flag#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]new().();
22 let error = Errorrust-analyzer cargo anyhow 1.0.103 Error#::newrust-analyzer cargo anyhow 1.0.103 error/impl#[Error]new().(DetectDroprust-analyzer cargo anyhow 1.0.103 drop/DetectDrop#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[DetectDrop]new().(&has_dropped));
23 let box_dyn = Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::<dyn StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>::fromrust-analyzer cargo anyhow 1.0.103 error/impl#[`Box<dyn Error + Send + 'static>`][`From<Error>`]from().(error);
24 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!("oh no!", box_dyn.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().());
25 droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/drop().(box_dyn);
26 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(has_dropped.getrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]get().());
27 }
28
29 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
30 fn test_convert_send_syncrust-analyzer cargo anyhow 1.0.103 test_convert_send_sync().() {
31 let has_dropped = Flagrust-analyzer cargo anyhow 1.0.103 drop/Flag#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]new().();
32 let error = Errorrust-analyzer cargo anyhow 1.0.103 Error#::newrust-analyzer cargo anyhow 1.0.103 error/impl#[Error]new().(DetectDroprust-analyzer cargo anyhow 1.0.103 drop/DetectDrop#::newrust-analyzer cargo anyhow 1.0.103 drop/impl#[DetectDrop]new().(&has_dropped));
33 let box_dyn = Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::<dyn StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync#>::fromrust-analyzer cargo anyhow 1.0.103 error/impl#[`Box<dyn Error + Send + Sync + 'static>`][`From<Error>`]from().(error);
34 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!("oh no!", box_dyn.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().());
35 droprust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/drop().(box_dyn);
36 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(has_dropped.getrust-analyzer cargo anyhow 1.0.103 drop/impl#[Flag]get().());
37 }
38
39 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
40 fn test_question_markrust-analyzer cargo anyhow 1.0.103 test_question_mark().() -> Resultrust-analyzer cargo anyhow 1.0.103 Result#<(), Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> {
41 fn frust-analyzer cargo anyhow 1.0.103 f().() -> Resultrust-analyzer cargo anyhow 1.0.103 Result#<()> {
42 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
43 }
44 frust-analyzer cargo anyhow 1.0.103 f().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
45 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
46 }