]> git.lizzy.rs Git - rust.git/commit
Merge #1677
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Mon, 12 Aug 2019 19:43:57 +0000 (19:43 +0000)
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Mon, 12 Aug 2019 19:43:57 +0000 (19:43 +0000)
commit2c65a059840dd2092a00e90337a8221cd832c456
treefa1f8c46158271eb859928ed9da3eb389f861c09
parent0cf48e48d75d267bfa38ff1319e7f7c0468fb53f
parent5af9691dc9132db61b50c4e90cdeda6fea0c5dd9
Merge #1677

1677: Associated types r=flodiebold a=flodiebold

This implements basic support for (fully qualified) associated type projections:
 - handle fully qualified paths like `<T as Trait>::AssocType` (basically desugaring to something like `Trait<Self=T>::AssocType`)
 - lower these to a new `Ty::Projection` enum variant
 - also introduce `Ty::UnselectedProjection` for cases like `T::AssocType` where the trait from which the type comes isn't specified, but these aren't handled further so far
 - in inference, normalize these projections using Chalk: basically, when encountering a type e.g. from a type annotation or signature, we replace these `Ty::Projection`s by type variables and add obligations to normalize the associated type

Co-authored-by: Florian Diebold <flodiebold@gmail.com>