1
Fork 0

Prohibit type parameter shadowing with a clunky hammer.

This is a [breaking-change].

Change

    impl<T> Foo<T> {
        fn bar<T>(...

to (for example)

    impl<T> Foo<T> {
        fn bar<U>(...

Per RFC 459.

Closes #19390.
This commit is contained in:
Huon Wilson 2015-01-08 11:39:45 +11:00
parent 9f1ead8fad
commit 92cd8ea96a
3 changed files with 91 additions and 1 deletions

View file

@ -1396,7 +1396,7 @@ impl<T: Iterator<Item=char>> Parser<T> {
self.ch == Some(c)
}
fn error<T>(&self, reason: ErrorCode) -> Result<T, ParserError> {
fn error<U>(&self, reason: ErrorCode) -> Result<U, ParserError> {
Err(SyntaxError(reason, self.line, self.col))
}