diff options
author | Florian Diebold <[email protected]> | 2019-02-17 13:43:59 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-17 13:44:39 +0000 |
commit | 795d718ba17545aedb0475051332aed6db2104ed (patch) | |
tree | 652dac8b0a8dbd299f9b2a6696c1714076aab341 /crates/ra_hir/src/ty/tests.rs | |
parent | a1bda3fc084bb6aa4979282b4907db9885fac9af (diff) |
Unify with the autorefed/autoderefed receiver type during method resolution
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 1eca68dc5..5eb9c4f5b 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -539,6 +539,26 @@ fn test() -> i128 { | |||
539 | } | 539 | } |
540 | 540 | ||
541 | #[test] | 541 | #[test] |
542 | fn infer_impl_generics_with_autoderef() { | ||
543 | check_inference( | ||
544 | "infer_impl_generics_with_autoderef", | ||
545 | r#" | ||
546 | enum Option<T> { | ||
547 | Some(T), | ||
548 | None, | ||
549 | } | ||
550 | impl<T> Option<T> { | ||
551 | fn as_ref(&self) -> Option<&T> {} | ||
552 | } | ||
553 | fn test(o: Option<u32>) { | ||
554 | (&o).as_ref(); | ||
555 | o.as_ref(); | ||
556 | } | ||
557 | "#, | ||
558 | ); | ||
559 | } | ||
560 | |||
561 | #[test] | ||
542 | fn infer_generic_chain() { | 562 | fn infer_generic_chain() { |
543 | check_inference( | 563 | check_inference( |
544 | "infer_generic_chain", | 564 | "infer_generic_chain", |