and refactor to just move the checking

This commit is contained in:
Agustin Chiappe Berrini 2017-12-06 04:28:01 -05:00
parent a2899408dd
commit 65ccf24ce8
7 changed files with 100 additions and 39 deletions

View file

@ -8,20 +8,18 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only -Z continue-parse-after-error
trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names
fn serialize(val : &'self T) -> Vec<u8> ; //~ ERROR lifetimes cannot use keyword names
fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
fn serialize(val : &'self T) -> Vec<u8> ;
fn deserialize(repr : &[u8]) -> &'self T;
}
impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
impl<'self> Serializable<str> for &'self str {
//~^ ERROR lifetimes cannot use keyword names
fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names
//~| ERROR missing lifetime specifier
fn serialize(val : &'self str) -> Vec<u8> {
vec![1]
}
fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names
fn deserialize(repr: &[u8]) -> &'self str {
"hi"
}
}

View file

@ -0,0 +1,14 @@
// Copyright 2012-2014 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.
fn main() {
'break: loop { //~ ERROR invalid label name `'break`
}
}

View file

@ -8,11 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z parse-only -Z continue-parse-after-error
fn foo<'a>(a: &'a isize) { }
fn bar(a: &'static isize) { }
fn baz(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names
fn zab(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names
fn baz<'let>(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names
fn zab<'self>(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names
fn main() { }