librustc: Add missing case for the Pod bound in tydecode.

This commit is contained in:
Patrick Walton 2013-12-18 15:03:32 -08:00
parent 3906823765
commit b982f08a66
5 changed files with 34 additions and 2 deletions

View File

@ -590,14 +590,17 @@ fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds {
'Z' => {
param_bounds.builtin_bounds.add(ty::BoundSized);
}
'P' => {
param_bounds.builtin_bounds.add(ty::BoundPod);
}
'I' => {
param_bounds.trait_bounds.push(@parse_trait_ref(st, |x,y| conv(x,y)));
}
'.' => {
return param_bounds;
}
_ => {
fail!("parse_bounds: bad bounds")
c => {
fail!("parse_bounds: bad bounds ('{}')", c)
}
}
}

View File

@ -0,0 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that metadata serialization works for the `Pod` kind.
#[crate_type="lib"];
pub fn f<T:Pod>() {}

View File

@ -15,3 +15,4 @@
pub trait RequiresFreeze : Freeze { }
pub trait RequiresRequiresFreezeAndSend : RequiresFreeze + Send { }
pub trait RequiresPod : Pod { }

View File

@ -16,6 +16,7 @@
extern mod trait_superkinds_in_metadata;
use trait_superkinds_in_metadata::{RequiresRequiresFreezeAndSend, RequiresFreeze};
use trait_superkinds_in_metadata::{RequiresPod};
struct X<T>(T);
@ -23,4 +24,6 @@ impl <T:Freeze> RequiresFreeze for X<T> { }
impl <T:Freeze+Send> RequiresRequiresFreezeAndSend for X<T> { }
impl <T:Pod> RequiresPod for X<T> { }
fn main() { }

View File

@ -0,0 +1,16 @@
// xfail-fast
// aux-build:kinds_in_metadata.rs
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that metadata serialization works for the `Pod` kind.
extern mod kinds_in_metadata;
use kinds_in_metadata::f;
pub fn main() {
f::<int>();
}