diff options
| author | Andrew Cann <shum@canndrew.org> | 2017-01-21 15:15:23 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2017-02-03 18:48:15 +0800 |
| commit | 5c90dd797883ad2084e8bbc92420b42b9f7fb7d7 (patch) | |
| tree | d0f23fb4931013b1ce1093b5ec21a70e57d250bb /src/test/compile-fail | |
| parent | 085f046c280639ce2f545108740d02c8a470cdd6 (diff) | |
| download | rust-5c90dd797883ad2084e8bbc92420b42b9f7fb7d7.tar.gz rust-5c90dd797883ad2084e8bbc92420b42b9f7fb7d7.zip | |
Use a proper future-compatibility lint
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/defaulted-unit-warning.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/compile-fail/defaulted-unit-warning.rs b/src/test/compile-fail/defaulted-unit-warning.rs new file mode 100644 index 00000000000..7a15ac025ef --- /dev/null +++ b/src/test/compile-fail/defaulted-unit-warning.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(resolve_trait_on_defaulted_unit)] + +trait Deserialize { + fn deserialize() -> Result<Self, String> +} + +fn doit() -> Result<(), String> { + let _ = Deserialize::deserialize()?; + //~^ ERROR attempt to resolve a trait + Ok(()) +} + +fn main() { + doit(); +} + |
