diff options
| author | Tobias Schottdorf <tobias.schottdorf@gmail.com> | 2017-10-06 16:30:23 -0400 |
|---|---|---|
| committer | Tobias Schottdorf <tobias.schottdorf@gmail.com> | 2017-10-06 16:30:23 -0400 |
| commit | de55b4f077a11780eb0534ef5b41fb0ff765b31d (patch) | |
| tree | 757df51c4a42e2e74b50ee90d5c1f4c831eadf8a /src/test/ui/const-expr-addr-operator.rs | |
| parent | a8feaee5b6b54c03f49481fe04a9ad9e8f659f7c (diff) | |
implement pattern-binding-modes RFC
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
Diffstat (limited to 'src/test/ui/const-expr-addr-operator.rs')
| -rw-r--r-- | src/test/ui/const-expr-addr-operator.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/const-expr-addr-operator.rs b/src/test/ui/const-expr-addr-operator.rs new file mode 100644 index 00000000000..282b0d4e45b --- /dev/null +++ b/src/test/ui/const-expr-addr-operator.rs @@ -0,0 +1,20 @@ +// Copyright 2017 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. + +// Encountered while testing #44614. + +pub fn main() { + // Constant of generic type (int) + const X: &'static u32 = &22; + assert_eq!(0, match &22 { + X => 0, + _ => 1, + }); +} \ No newline at end of file |
