File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: fd318300cf713f0e74f3a834f6c07970b85f17e4
4
+ refs/heads/snap-stage3: 76c90283ce9de476357abf9a5fed79e86a2f1f53
5
5
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ pub fn trans_intrinsic(ccx: @CrateContext,
317
317
"uninit" => {
318
318
// Do nothing, this is effectively a no-op
319
319
let retty = substs. tys [ 0 ] ;
320
- if type_is_immediate ( ccx, retty) && !ty :: type_is_nil ( retty) {
320
+ if type_is_immediate ( ccx, retty) && !type_is_voidish ( ccx , retty) {
321
321
unsafe {
322
322
Ret ( bcx, lib:: llvm:: llvm:: LLVMGetUndef ( type_of ( ccx, retty) . to_ref ( ) ) ) ;
323
323
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2012-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
+ // Test the uninit() construct returning various empty types.
12
+
13
+ use std:: vec;
14
+ use std:: unstable:: intrinsics;
15
+
16
+ #[ deriving( Clone ) ]
17
+ struct Foo ;
18
+
19
+ fn main ( ) {
20
+ unsafe {
21
+ let _x: Foo = intrinsics:: uninit ( ) ;
22
+ let _x: [ Foo , ..2 ] = intrinsics:: uninit ( ) ;
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments