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

syntax: expand impl_pretty_name to handle more cases. #11254

Merged
merged 1 commit into from
Jan 1, 2014

Conversation

huonw
Copy link
Member

@huonw huonw commented Jan 1, 2014

The resulting symbol names aren't very pretty at all:

trait Trait { fn method(&self); }
impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
Trait$__extensions__::method:..., which is what the symbol name used
to be for anything other than impl Trait for foo::bar::Baz (which
became, and still becomes, Trait$Baz::method).

@huonw
Copy link
Member Author

huonw commented Jan 1, 2014

This is a hack (hopefully temporary) so that the source impl/type of method symbols aren't complete mysteries.

@brson
Copy link
Contributor

brson commented Jan 1, 2014

Glad to see __extensions__ finally disappear.

The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
bors added a commit that referenced this pull request Jan 1, 2014
The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
@bors bors closed this Jan 1, 2014
@bors bors merged commit 8f26d0b into rust-lang:master Jan 1, 2014
@huonw huonw deleted the impl-names branch February 25, 2014 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants