Skip to content

Commit 8025bc9

Browse files
committed
Auto merge of #26153 - dotdash:issue26127, r=luqmana
Fixes #26127
2 parents 6c5834d + 96bc00f commit 8025bc9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/librustc_trans/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
16761676
if !type_is_zero_size(ccx, result_ty) {
16771677
alloc_ty(bcx, result_ty, "constructor_result")
16781678
} else {
1679-
C_undef(type_of::type_of(ccx, result_ty))
1679+
C_undef(type_of::type_of(ccx, result_ty).ptr_to())
16801680
}
16811681
}
16821682
};

src/test/run-pass/issue26127.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2015 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+
trait Tr { type T; }
12+
impl Tr for u8 { type T=(); }
13+
struct S<I: Tr>(I::T);
14+
15+
fn foo<I: Tr>(i: I::T) {
16+
S::<I>(i);
17+
}
18+
19+
fn main() {
20+
foo::<u8>(());
21+
}

0 commit comments

Comments
 (0)