aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/tests.rs29
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]
3032fn deref_trait_with_question_mark_size() {
3033 let t = type_at(
3034 r#"
3035//- /main.rs
3036#[lang = "deref"]
3037trait Deref {
3038 type Target;
3039 fn deref(&self) -> &Self::Target;
3040}
3041
3042struct Arc<T>;
3043impl<T: ?Sized> Deref for Arc<T> {
3044 type Target = T;
3045}
3046
3047struct S;
3048impl S {
3049 fn foo(&self) -> u128 {}
3050}
3051
3052fn test(s: Arc<S>) {
3053 (*s, s.foo())<|>
3054}
3055"#,
3056 );
3057 assert_eq!(t, "(S, u128)");
3058}
3059
3060#[test]
3032fn obligation_from_function_clause() { 3061fn obligation_from_function_clause() {
3033 let t = type_at( 3062 let t = type_at(
3034 r#" 3063 r#"