Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the checks for `Self` type parameters #50125

Open
cuviper opened this issue Apr 20, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@cuviper
Copy link
Member

commented Apr 20, 2018

per @eddyb in #49889 (comment)

I don't think we should need is_self and has_self_ty (or the gensym hack altogether), and instead we should rely on knowing that e.g. the item in scope is a trait and thus index 0 is Self.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 20, 2018

Paper over a bug on master
This commit papers over rust-lang#49889 (introducing a fixme pointing at rust-lang#50125) for a
bug that was introduced with rust-lang#49695. This workaround is taken from rust-lang#49891.

bors added a commit that referenced this issue Aug 24, 2018

Auto merge of #53661 - eddyb:noname, r=<try>
rustc: remove type & lifetime parameter names from the typesystem.

Everything that needs a name, for whatever reason, must get it from the `DefId`.

Fixes #50125 by replacing special-casing of `Self` (and the gensym hack) with getting the type for the `Self` parameter from the trait, and comparing types with that, instead.

Also removes AST pretty-printing for input position `impl Trait`, it now prints like `-> impl Trait`.
That is, the relevant `ty::Predicate`s are obtained on the fly from the definition and printed.

r? @nikomatsakis cc @michaelwoerister @varkor @oli-obk @GuillaumeGomez

bors added a commit that referenced this issue Aug 24, 2018

Auto merge of #53677 - eddyb:not-my-self, r=<try>
rustc: remove Ty::{is_self, has_self_ty}.

Fixes #50125 by replacing special-casing of `Self` (and the gensym hack) with getting the type for the `Self` parameter from the trait, and comparing types with that, instead.

**NOTE**: this is part of #53661, split out to independently check performance impact.

bors added a commit that referenced this issue Aug 25, 2018

Auto merge of #53677 - eddyb:not-my-self, r=<try>
rustc: remove Ty::{is_self, has_self_ty}.

Fixes #50125 by replacing special-casing of `Self` (and the gensym hack) with getting the type for the `Self` parameter from the trait, and comparing types with that, instead.

**NOTE**: this is part of #53661, split out to independently check performance impact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.