aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/traits.rs
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-04-07 16:59:09 +0100
committerBenjamin Coenen <[email protected]>2020-04-07 16:59:09 +0100
commit18a5e164838e1dc2abcc6b79d4fc2f96ffd2507c (patch)
treebc80b5c49c3b7ba31c7fe967bb34fe14bac9d5ed /crates/ra_hir_ty/src/tests/traits.rs
parentab864ed259c10ff51f7c9c3421d098eeea7b0245 (diff)
parent33c364b545350134b945fbca834194fd1a28fe08 (diff)
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_hir_ty/src/tests/traits.rs')
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs
index 081aa943a..22ae6ca90 100644
--- a/crates/ra_hir_ty/src/tests/traits.rs
+++ b/crates/ra_hir_ty/src/tests/traits.rs
@@ -2021,3 +2021,28 @@ fn main() {
2021 "### 2021 "###
2022 ); 2022 );
2023} 2023}
2024
2025#[test]
2026fn dyn_trait_through_chalk() {
2027 let t = type_at(
2028 r#"
2029//- /main.rs
2030struct Box<T> {}
2031#[lang = "deref"]
2032trait Deref {
2033 type Target;
2034}
2035impl<T> Deref for Box<T> {
2036 type Target = T;
2037}
2038trait Trait {
2039 fn foo(&self);
2040}
2041
2042fn test(x: Box<dyn Trait>) {
2043 x.foo()<|>;
2044}
2045"#,
2046 );
2047 assert_eq!(t, "()");
2048}