diff options
author | Jonas Schievink <[email protected]> | 2020-07-21 16:52:43 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-07-21 16:55:17 +0100 |
commit | c07eaf868dab86d061ae80c098798a767b910e91 (patch) | |
tree | 1793a7f85fd45a0774e019aaa9fe16410ab6eda9 /crates/ra_hir_ty/src/tests | |
parent | 65b89b5471879a80fb6003c9fa0f8f93e2eb38e6 (diff) |
Support `Trait as _` imports
Diffstat (limited to 'crates/ra_hir_ty/src/tests')
-rw-r--r-- | crates/ra_hir_ty/src/tests/traits.rs | 22 |
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] | ||
3094 | fn underscore_import() { | ||
3095 | check_types( | ||
3096 | r#" | ||
3097 | mod tr { | ||
3098 | pub trait Tr { | ||
3099 | fn method(&self) -> u8 { 0 } | ||
3100 | } | ||
3101 | } | ||
3102 | |||
3103 | struct Tr; | ||
3104 | impl crate::tr::Tr for Tr {} | ||
3105 | |||
3106 | use crate::tr::Tr as _; | ||
3107 | fn test() { | ||
3108 | Tr.method(); | ||
3109 | //^^^^^^^^^^^ u8 | ||
3110 | } | ||
3111 | "#, | ||
3112 | ); | ||
3113 | } | ||