aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-22 13:28:08 +0100
committerAleksey Kladov <[email protected]>2019-08-22 13:35:42 +0100
commit9f238930f1969731869c89956414f4b160b180c0 (patch)
tree182d17948da88b2acff477154cf54896e959efcd /crates/ra_hir/src/ty
parent2d0931b9ba7aabdc634c799b32957cc6f057e875 (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.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#"