Skip to content

Commit

Permalink
Testing and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjay committed Dec 1, 2017
1 parent 1c023b3 commit 38c2a73
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Expand Up @@ -1295,7 +1295,6 @@ impl<'a> Parser<'a> {
let (name, node, generics) = if self.eat_keyword(keywords::Type) {
let (generics, TyParam {ident, bounds, default, ..}) =
self.parse_trait_item_assoc_ty(vec![])?;
self.expect(&token::Semi)?;
(ident, TraitItemKind::Type(bounds, default), generics)
} else if self.is_const_item() {
self.expect_keyword(keywords::Const)?;
Expand Down Expand Up @@ -4464,6 +4463,7 @@ impl<'a> Parser<'a> {
} else {
None
};
self.expect(&token::Semi)?;

Ok((generics, TyParam {
attrs: preceding_attrs.into(),
Expand Down
Expand Up @@ -10,8 +10,15 @@

use std::ops::Deref;

trait PointerFamily {
trait PointerFamily<U> {
type Pointer<T>: Deref<Target = T>;
type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone;
}

struct Foo;
impl PointerFamily<u32> for Foo {
type Pointer<usize> = Box<usize>;
type Pointer2<u32> = Box<u32>;
}

fn main() {}

This file was deleted.

This file was deleted.

Expand Up @@ -8,11 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags: -Zparse-only
// compile-flags: -Z parse-only

#![feature(generic_associated_types)]

impl<T> Baz for T where T: Foo {
//FIXME(sunjay): This should parse successfully
type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
}

Expand Down
Expand Up @@ -8,10 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags: -Zparse-only
// compile-flags: -Z parse-only

#![feature(generic_associated_types)]

use std::ops::Deref;

trait Foo {
type Bar<'a>;
type Bar<'a, 'b>;
Expand All @@ -20,6 +22,11 @@ trait Foo {
type Bar<'a, 'b, T, U>;
type Bar<'a, 'b, T, U,>;
type Bar<'a, 'b, T: Debug, U,>;
type Bar<'a, 'b, T: Debug, U,>: Debug;
type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>;
type Bar<'a, 'b, T: Debug, U,> where T: Deref<Target = U>, U: Into<T>;
type Bar<'a, 'b, T: Debug, U,>: Deref<Target = T> + Into<U>
where T: Deref<Target = U>, U: Into<T>;
}

fn main() {}

0 comments on commit 38c2a73

Please sign in to comment.