diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-17 23:41:02 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-19 12:37:26 +0000 |
commit | b5466f3fb36005c313205d944430498f17aea6fa (patch) | |
tree | 6d7ae5caf5a87c295a30343ce6892949f1668b52 /crates/ra_hir/src/expr.rs | |
parent | 5027c5d4ee38e07ee426df433d0c650d55b1be84 (diff) |
Address issues flagged in review
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index c05bbc442..1d0beb148 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -329,8 +329,6 @@ impl Expr { | |||
329 | pub struct PatId(RawId); | 329 | pub struct PatId(RawId); |
330 | impl_arena_id!(PatId); | 330 | impl_arena_id!(PatId); |
331 | 331 | ||
332 | // copied verbatim from librustc::hir | ||
333 | |||
334 | /// Explicit binding annotations given in the HIR for a binding. Note | 332 | /// Explicit binding annotations given in the HIR for a binding. Note |
335 | /// that this is not the final binding *mode* that we infer after type | 333 | /// that this is not the final binding *mode* that we infer after type |
336 | /// inference. | 334 | /// inference. |
@@ -341,8 +339,6 @@ pub enum BindingAnnotation { | |||
341 | /// when matching. For example, the `x` in `Some(x)` will have binding | 339 | /// when matching. For example, the `x` in `Some(x)` will have binding |
342 | /// mode `None`; if you do `let Some(x) = &Some(22)`, it will | 340 | /// mode `None`; if you do `let Some(x) = &Some(22)`, it will |
343 | /// ultimately be inferred to be by-reference. | 341 | /// ultimately be inferred to be by-reference. |
344 | /// | ||
345 | /// Note that implicit reference skipping is not implemented yet (#42640). | ||
346 | Unannotated, | 342 | Unannotated, |
347 | 343 | ||
348 | /// Annotated with `mut x` -- could be either ref or not, similar to `None`. | 344 | /// Annotated with `mut x` -- could be either ref or not, similar to `None`. |
@@ -375,7 +371,7 @@ pub struct FieldPat { | |||
375 | /// Close relative to rustc's hir::PatKind | 371 | /// Close relative to rustc's hir::PatKind |
376 | #[derive(Debug, Clone, Eq, PartialEq)] | 372 | #[derive(Debug, Clone, Eq, PartialEq)] |
377 | pub enum Pat { | 373 | pub enum Pat { |
378 | Missing, // do we need this? | 374 | Missing, |
379 | Wild, | 375 | Wild, |
380 | Tuple(Vec<PatId>), | 376 | Tuple(Vec<PatId>), |
381 | Struct { | 377 | Struct { |
@@ -387,7 +383,6 @@ pub enum Pat { | |||
387 | start: ExprId, | 383 | start: ExprId, |
388 | end: ExprId, | 384 | end: ExprId, |
389 | }, | 385 | }, |
390 | Box(PatId), | ||
391 | Slice { | 386 | Slice { |
392 | prefix: Vec<PatId>, | 387 | prefix: Vec<PatId>, |
393 | rest: Option<PatId>, | 388 | rest: Option<PatId>, |
@@ -420,7 +415,7 @@ impl Pat { | |||
420 | Pat::Tuple(args) | Pat::TupleStruct { args, .. } => { | 415 | Pat::Tuple(args) | Pat::TupleStruct { args, .. } => { |
421 | args.iter().map(|pat| *pat).for_each(f); | 416 | args.iter().map(|pat| *pat).for_each(f); |
422 | } | 417 | } |
423 | Pat::Ref { pat, .. } | Pat::Box(pat) => f(*pat), | 418 | Pat::Ref { pat, .. } => f(*pat), |
424 | Pat::Slice { | 419 | Pat::Slice { |
425 | prefix, | 420 | prefix, |
426 | rest, | 421 | rest, |