aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-22 13:17:51 +0100
committerGitHub <[email protected]>2020-07-22 13:17:51 +0100
commitdba534a103dc9fb374bc313ac96d54d331cbd54a (patch)
treee6be02ef8733e33ae9a9a316e2769dd6ccbab793 /crates/ra_hir_ty/src/tests
parent2dd8ba2b21e3262f25e4245e37549206c8a3bc2d (diff)
parentdce99874368e3e42402b4443c5eb39495c8c162a (diff)
Merge #5475
5475: Support `Trait as _` imports r=matklad a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2736 Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs
index d3c4d3f2a..526e61caf 100644
--- a/crates/ra_hir_ty/src/tests/traits.rs
+++ b/crates/ra_hir_ty/src/tests/traits.rs
@@ -3089,3 +3089,25 @@ fn test() {
3089 "#, 3089 "#,
3090 ); 3090 );
3091} 3091}
3092
3093#[test]
3094fn underscore_import() {
3095 check_types(
3096 r#"
3097mod tr {
3098 pub trait Tr {
3099 fn method(&self) -> u8 { 0 }
3100 }
3101}
3102
3103struct Tr;
3104impl crate::tr::Tr for Tr {}
3105
3106use crate::tr::Tr as _;
3107fn test() {
3108 Tr.method();
3109 //^^^^^^^^^^^ u8
3110}
3111 "#,
3112 );
3113}