File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ pub fn check_expr(sess: Session,
91
91
v : visit:: vt < bool > ) {
92
92
if is_const {
93
93
match e. node {
94
- expr_unary( box ( _ ) , _) | expr_unary ( uniq ( _ ) , _ ) |
95
- expr_unary( deref , _) => {
94
+ expr_unary( deref , _) => { }
95
+ expr_unary( box ( _ ) , _ ) | expr_unary ( uniq ( _ ) , _) => {
96
96
sess. span_err ( e. span ,
97
97
~"disallowed operator in constant expression") ;
98
98
return ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ const C : & ' static int = & 1000 ;
12
+ const D : int = * C ;
13
+ struct S ( & ' static int ) ;
14
+ const E : & ' static S = & S ( C ) ;
15
+ const F : int = * * * E ;
16
+
17
+ pub fn main ( ) {
18
+ fail_unless ! ( D == 1000 ) ;
19
+ fail_unless ! ( F == 1000 ) ;
20
+ }
You can’t perform that action at this time.
0 commit comments