Skip to content

Commit e90a8c4

Browse files
committed
auto merge of #11851 : pnkfelix/rust/fsk-fix-issue-10031, r=alexcrichton
Fix #10031.
2 parents 3781728 + b315aba commit e90a8c4

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/librustc/metadata/encoder.rs

+2
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
766766
ebml_w.start_tag(tag_items_data_item);
767767
encode_def_id(ebml_w, local_def(ctor_id));
768768
encode_family(ebml_w, 'f');
769+
encode_bounds_and_type(ebml_w, ecx,
770+
&lookup_item_type(ecx.tcx, local_def(ctor_id)));
769771
encode_name(ecx, ebml_w, name);
770772
encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, ctor_id));
771773
encode_path(ecx, ebml_w, path, ast_map::PathName(name));

src/test/auxiliary/issue_10031_aux.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2014 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+
pub struct Wrap<A>(A);

src/test/run-pass/issue-10031.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2014 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+
// xfail-fast - check-fast doesn't understand aux-build
12+
// aux-build:issue_10031_aux.rs
13+
extern mod issue_10031_aux;
14+
15+
pub fn main() {
16+
let _ = issue_10031_aux::Wrap(());
17+
}

0 commit comments

Comments
 (0)