1 #![deny(clippy::option_option)]
3 fn input(_: Option<Option<u8>>) {}
5 fn output() -> Option<Option<u8>> {
9 fn output_nested() -> Vec<Option<Option<u8>>> {
13 // The lint only generates one warning for this
14 fn output_nested_nested() -> Option<Option<Option<u8>>> {
19 x: Option<Option<u8>>,
23 fn struct_fn() -> Option<Option<u8>> {
29 fn trait_fn() -> Option<Option<u8>>;
33 Tuple(Option<Option<u8>>),
34 Struct { x: Option<Option<u8>> },
37 // The lint allows this
38 type OptionOption = Option<Option<u32>>;
40 // The lint allows this
41 fn output_type_alias() -> OptionOption {
45 // The line allows this
46 impl Trait for Struct {
47 fn trait_fn() -> Option<Option<u8>> {
57 // The lint allows this
58 let local: Option<Option<u8>> = None;
60 // The lint allows this
61 let expr = Some(Some(true));