diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-12 20:43:57 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-12 20:43:57 +0100 |
commit | 2c65a059840dd2092a00e90337a8221cd832c456 (patch) | |
tree | fa1f8c46158271eb859928ed9da3eb389f861c09 /crates/ra_assists/src | |
parent | 0cf48e48d75d267bfa38ff1319e7f7c0468fb53f (diff) | |
parent | 5af9691dc9132db61b50c4e90cdeda6fea0c5dd9 (diff) |
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 <[email protected]>
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/auto_import.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ra_assists/src/auto_import.rs b/crates/ra_assists/src/auto_import.rs index a32e2f9b6..1158adbbc 100644 --- a/crates/ra_assists/src/auto_import.rs +++ b/crates/ra_assists/src/auto_import.rs | |||
@@ -71,6 +71,7 @@ fn compare_path_segment(a: &SmolStr, b: &ast::PathSegment) -> bool { | |||
71 | ast::PathSegmentKind::SelfKw => a == "self", | 71 | ast::PathSegmentKind::SelfKw => a == "self", |
72 | ast::PathSegmentKind::SuperKw => a == "super", | 72 | ast::PathSegmentKind::SuperKw => a == "super", |
73 | ast::PathSegmentKind::CrateKw => a == "crate", | 73 | ast::PathSegmentKind::CrateKw => a == "crate", |
74 | ast::PathSegmentKind::Type { .. } => false, // not allowed in imports | ||
74 | } | 75 | } |
75 | } else { | 76 | } else { |
76 | false | 77 | false |