diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 6c2d857bc..57fd5492d 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -3029,6 +3029,35 @@ fn test(s: S) { | |||
3029 | } | 3029 | } |
3030 | 3030 | ||
3031 | #[test] | 3031 | #[test] |
3032 | fn deref_trait_with_question_mark_size() { | ||
3033 | let t = type_at( | ||
3034 | r#" | ||
3035 | //- /main.rs | ||
3036 | #[lang = "deref"] | ||
3037 | trait Deref { | ||
3038 | type Target; | ||
3039 | fn deref(&self) -> &Self::Target; | ||
3040 | } | ||
3041 | |||
3042 | struct Arc<T>; | ||
3043 | impl<T: ?Sized> Deref for Arc<T> { | ||
3044 | type Target = T; | ||
3045 | } | ||
3046 | |||
3047 | struct S; | ||
3048 | impl S { | ||
3049 | fn foo(&self) -> u128 {} | ||
3050 | } | ||
3051 | |||
3052 | fn test(s: Arc<S>) { | ||
3053 | (*s, s.foo())<|> | ||
3054 | } | ||
3055 | "#, | ||
3056 | ); | ||
3057 | assert_eq!(t, "(S, u128)"); | ||
3058 | } | ||
3059 | |||
3060 | #[test] | ||
3032 | fn obligation_from_function_clause() { | 3061 | fn obligation_from_function_clause() { |
3033 | let t = type_at( | 3062 | let t = type_at( |
3034 | r#" | 3063 | r#" |