]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/feature-gate-negate-unsigned.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test that negating unsigned integers is gated by `negate_unsigned` feature
15 impl std
::ops
::Neg
for S
{
17 fn neg(self) -> u32 { 0 }
20 const _MAX
: usize = -1;
21 //~^ WARN unary negation of unsigned integers will be feature gated in the future
25 //~^ WARN unary negation of unsigned integers will be feature gated in the future
26 let _b
: u8 = a
; // for infering variable a to u8.
29 //~^ WARN unary negation of unsigned integers will be feature gated in the future
32 //~^ WARN unary negation of unsigned integers will be feature gated in the future
35 //~^ WARN unary negation of unsigned integers will be feature gated in the future
37 -S
; // should not trigger the gate; issue 26840