2018-10-06 18:18:06 +02:00
|
|
|
// 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 <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.
|
|
|
|
|
2016-05-13 13:45:53 +02:00
|
|
|
// ignore-x86
|
2017-09-18 12:47:33 +02:00
|
|
|
|
2018-07-28 17:34:52 +02:00
|
|
|
#![warn(clippy::all)]
|
2016-02-29 09:36:13 +01:00
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
#[repr(usize)]
|
|
|
|
enum NonPortable {
|
2017-02-08 14:58:07 +01:00
|
|
|
X = 0x1_0000_0000,
|
2016-02-29 09:36:13 +01:00
|
|
|
Y = 0,
|
|
|
|
Z = 0x7FFF_FFFF,
|
|
|
|
A = 0xFFFF_FFFF,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum NonPortableNoHint {
|
2017-02-08 14:58:07 +01:00
|
|
|
X = 0x1_0000_0000,
|
2016-02-29 09:36:13 +01:00
|
|
|
Y = 0,
|
|
|
|
Z = 0x7FFF_FFFF,
|
2017-02-08 14:58:07 +01:00
|
|
|
A = 0xFFFF_FFFF,
|
2016-02-29 09:36:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(isize)]
|
|
|
|
enum NonPortableSigned {
|
|
|
|
X = -1,
|
|
|
|
Y = 0x7FFF_FFFF,
|
2017-02-08 14:58:07 +01:00
|
|
|
Z = 0xFFFF_FFFF,
|
|
|
|
A = 0x1_0000_0000,
|
2016-02-29 09:36:13 +01:00
|
|
|
B = std::i32::MIN as isize,
|
2017-02-08 14:58:07 +01:00
|
|
|
C = (std::i32::MIN as isize) - 1,
|
2016-02-29 09:36:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
enum NonPortableSignedNoHint {
|
|
|
|
X = -1,
|
|
|
|
Y = 0x7FFF_FFFF,
|
2017-02-08 14:58:07 +01:00
|
|
|
Z = 0xFFFF_FFFF,
|
|
|
|
A = 0x1_0000_0000,
|
2016-02-29 09:36:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
FIXME: uncomment once https://github.com/rust-lang/rust/issues/31910 is fixed
|
|
|
|
#[repr(usize)]
|
|
|
|
enum NonPortable2<T: Trait> {
|
|
|
|
X = Trait::Number,
|
|
|
|
Y = 0,
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Trait {
|
|
|
|
const Number: usize = 0x1_0000_0000;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2018-12-09 23:26:16 +01:00
|
|
|
fn main() {}
|