1
Fork 0

demonstrate how we can write "successful parse" tests quite easily

This commit is contained in:
Niko Matsakis 2017-11-14 12:17:28 -05:00 committed by Sunjay Varma
parent 1b196fa324
commit e565b5bbdd
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,19 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Zparse-only
#![feature(generic_associated_types)]
impl<T> Baz for T where T: Foo {
type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
}
fn main() {}

View file

@ -0,0 +1,25 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Zparse-only
#![feature(generic_associated_types)]
trait Foo {
type Bar<'a>;
type Bar<'a, 'b>;
type Bar<'a, 'b,>;
type Bar<'a, 'b, T>;
type Bar<'a, 'b, T, U>;
type Bar<'a, 'b, T, U,>;
type Bar<'a, 'b, T: Debug, U,>;
}
fn main() {}