Skip to content

Commit d069d58

Browse files
committed
auto merge of #11060 : pcwalton/rust/tydecode-pod, r=pcwalton
r? @brson
2 parents 3906823 + b982f08 commit d069d58

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

src/librustc/metadata/tydecode.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,17 @@ fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds {
590590
'Z' => {
591591
param_bounds.builtin_bounds.add(ty::BoundSized);
592592
}
593+
'P' => {
594+
param_bounds.builtin_bounds.add(ty::BoundPod);
595+
}
593596
'I' => {
594597
param_bounds.trait_bounds.push(@parse_trait_ref(st, |x,y| conv(x,y)));
595598
}
596599
'.' => {
597600
return param_bounds;
598601
}
599-
_ => {
600-
fail!("parse_bounds: bad bounds")
602+
c => {
603+
fail!("parse_bounds: bad bounds ('{}')", c)
601604
}
602605
}
603606
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
* http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
// Tests that metadata serialization works for the `Pod` kind.
5+
6+
#[crate_type="lib"];
7+
8+
pub fn f<T:Pod>() {}
9+

src/test/auxiliary/trait_superkinds_in_metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515

1616
pub trait RequiresFreeze : Freeze { }
1717
pub trait RequiresRequiresFreezeAndSend : RequiresFreeze + Send { }
18+
pub trait RequiresPod : Pod { }

src/test/run-pass/builtin-superkinds-in-metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616

1717
extern mod trait_superkinds_in_metadata;
1818
use trait_superkinds_in_metadata::{RequiresRequiresFreezeAndSend, RequiresFreeze};
19+
use trait_superkinds_in_metadata::{RequiresPod};
1920

2021
struct X<T>(T);
2122

2223
impl <T:Freeze> RequiresFreeze for X<T> { }
2324

2425
impl <T:Freeze+Send> RequiresRequiresFreezeAndSend for X<T> { }
2526

27+
impl <T:Pod> RequiresPod for X<T> { }
28+
2629
fn main() { }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// xfail-fast
2+
// aux-build:kinds_in_metadata.rs
3+
4+
/* Any copyright is dedicated to the Public Domain.
5+
* http://creativecommons.org/publicdomain/zero/1.0/ */
6+
7+
// Tests that metadata serialization works for the `Pod` kind.
8+
9+
extern mod kinds_in_metadata;
10+
11+
use kinds_in_metadata::f;
12+
13+
pub fn main() {
14+
f::<int>();
15+
}
16+

0 commit comments

Comments
 (0)