]> git.lizzy.rs Git - rust.git/commit
syntax: expand impl_pretty_name to handle more cases.
authorHuon Wilson <dbau.pp+github@gmail.com>
Wed, 1 Jan 2014 05:30:21 +0000 (16:30 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Wed, 1 Jan 2014 15:53:54 +0000 (02:53 +1100)
commit8f26d0b9b8725fa74dc36fcf4abf45dc1ca8c56a
treed10ee55a699bed56fb8cf05aefe1c5a3e8b7a822
parent09a561ac9caaf4acfc170cac92efe6bb5a991a11
syntax: expand impl_pretty_name to handle more cases.

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`).
src/librustc/metadata/encoder.rs
src/libsyntax/ast_map.rs
src/test/compile-fail/ambig_impl_unify.rs