Auto merge of #338 - dtolnay:refs, r=oli-obk
Strip more references Fixes #337.
This commit is contained in:
commit
cc115ca43a
@ -139,9 +139,9 @@ fn contains_generic(ty: &ast::Ty, generics: &ast::Generics) -> bool {
|
||||
//
|
||||
// impl<'a, T> Serialize for Test<'a, T>
|
||||
// where T: Serialize { ... }
|
||||
fn strip_reference(ty: &P<ast::Ty>) -> &P<ast::Ty> {
|
||||
match ty.node {
|
||||
ast::TyKind::Rptr(_, ref mut_ty) => &mut_ty.ty,
|
||||
_ => ty
|
||||
fn strip_reference(mut ty: &P<ast::Ty>) -> &P<ast::Ty> {
|
||||
while let ast::TyKind::Rptr(_, ref mut_ty) = ty.node {
|
||||
ty = &mut_ty.ty;
|
||||
}
|
||||
ty
|
||||
}
|
||||
|
@ -49,6 +49,12 @@ enum EnumWith<T> {
|
||||
i: i32 },
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct MultipleRef<'a, 'b, 'c, T> where T: 'c, 'c: 'b, 'b: 'a {
|
||||
t: T,
|
||||
rrrt: &'a &'b &'c T,
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fn ser_i32<S: Serializer>(_: &i32, _: &mut S) -> Result<(), S::Error> { panic!() }
|
||||
|
Loading…
Reference in New Issue
Block a user