]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #36649 - eddyb:selfish-idents, r=pnkfelix
authorbors <bors@rust-lang.org>
Fri, 23 Sep 2016 16:49:26 +0000 (09:49 -0700)
committerGitHub <noreply@github.com>
Fri, 23 Sep 2016 16:49:26 +0000 (09:49 -0700)
Don't let a type parameter named "Self" unchanged past HIR lowering.

Fixes #36638 by rewriting `Self` type parameters (which are a parse error) to a `gensym("Self")`.

Background: #35605 introduced code across rustc that determines `Self` by its keyword name.
Reverting the sanity checks around that would inadvertently cause confusion between the true `Self` of a `trait` and other type parameters named `Self` (which have caused parse errors already).

I do not like to use `gensym`, and we may do something different here in the future, but this should work.


Trivial merge