diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-01-16 10:15:41 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-03-08 08:34:08 +0100 |
| commit | e0045ab8915c85e35dd04e9f9d00d6d011237bfa (patch) | |
| tree | db4892df6b9842e9df5a31bc99639d1384b9188b /src/test/run-pass/ctfe/tuple-struct-constructors.rs | |
| parent | 0595ff1009be0b4838b8efd0225c9601eff694eb (diff) | |
| download | rust-e0045ab8915c85e35dd04e9f9d00d6d011237bfa.tar.gz rust-e0045ab8915c85e35dd04e9f9d00d6d011237bfa.zip | |
Add tests for fixed issues
Diffstat (limited to 'src/test/run-pass/ctfe/tuple-struct-constructors.rs')
| -rw-r--r-- | src/test/run-pass/ctfe/tuple-struct-constructors.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/run-pass/ctfe/tuple-struct-constructors.rs b/src/test/run-pass/ctfe/tuple-struct-constructors.rs new file mode 100644 index 00000000000..ecc5d376636 --- /dev/null +++ b/src/test/run-pass/ctfe/tuple-struct-constructors.rs @@ -0,0 +1,20 @@ +// Copyright 2018 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. + +// https://github.com/rust-lang/rust/issues/41898 + +#![feature(nonzero, const_fn)] +extern crate core; +use core::nonzero::NonZero; + +fn main() { + const FOO: NonZero<u64> = unsafe { NonZero::new_unchecked(2) }; + if let FOO = FOO {} +} |
