diff options
author | Aleksey Kladov <[email protected]> | 2019-08-22 13:28:08 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-08-22 13:35:42 +0100 |
commit | 9f238930f1969731869c89956414f4b160b180c0 (patch) | |
tree | 182d17948da88b2acff477154cf54896e959efcd /crates/ra_hir/src/ty | |
parent | 2d0931b9ba7aabdc634c799b32957cc6f057e875 (diff) |
Don't add `?` bounds as real bounds
closes #1709
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#" |