mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Rename ra_hir_ty -> hir_ty
This commit is contained in:
parent
50f8c1ebf2
commit
6a77ec7bbe
40 changed files with 44 additions and 47 deletions
41
crates/hir_ty/src/tests/display_source_code.rs
Normal file
41
crates/hir_ty/src/tests/display_source_code.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
use super::check_types_source_code;
|
||||
|
||||
#[test]
|
||||
fn qualify_path_to_submodule() {
|
||||
check_types_source_code(
|
||||
r#"
|
||||
mod foo {
|
||||
pub struct Foo;
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
let foo: foo::Foo = foo::Foo;
|
||||
foo
|
||||
} //^ foo::Foo
|
||||
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn omit_default_type_parameters() {
|
||||
check_types_source_code(
|
||||
r#"
|
||||
struct Foo<T = u8> { t: T }
|
||||
fn main() {
|
||||
let foo = Foo { t: 5u8 };
|
||||
foo;
|
||||
} //^ Foo
|
||||
"#,
|
||||
);
|
||||
|
||||
check_types_source_code(
|
||||
r#"
|
||||
struct Foo<K, T = u8> { k: K, t: T }
|
||||
fn main() {
|
||||
let foo = Foo { k: 400, t: 5u8 };
|
||||
foo;
|
||||
} //^ Foo<i32>
|
||||
"#,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue