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:
parent
9f1ead8fad
commit
92cd8ea96a
3 changed files with 91 additions and 1 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue