// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn input(_: Option>) { } fn output() -> Option> { None } fn output_nested() -> Vec>> { vec![None] } // The lint only generates one warning for this fn output_nested_nested() -> Option>> { None } struct Struct { x: Option>, } impl Struct { fn struct_fn() -> Option> { None } } trait Trait { fn trait_fn() -> Option>; } enum Enum { Tuple(Option>), Struct{x: Option>}, } // The lint allows this type OptionOption = Option>; // The lint allows this fn output_type_alias() -> OptionOption { None } // The line allows this impl Trait for Struct { fn trait_fn() -> Option> { None } } fn main() { input(None); output(); output_nested(); // The lint allows this let local: Option> = None; // The lint allows this let expr = Some(Some(true)); }