mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 12:59:12 +00:00
add test for trait alias projections
This commit is contained in:
parent
82f174fbd9
commit
9deb3e440e
1 changed files with 21 additions and 0 deletions
21
crates/hir-ty/src/tests/trait_aliases.rs
Normal file
21
crates/hir-ty/src/tests/trait_aliases.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use crate::tests::check_types;
|
||||
|
||||
#[test]
|
||||
fn projection() {
|
||||
check_types(
|
||||
r#"
|
||||
#![feature(trait_alias)]
|
||||
|
||||
pub trait A {
|
||||
type Output;
|
||||
}
|
||||
|
||||
pub trait B = A<Output = u32>;
|
||||
|
||||
pub fn a<T: B>(x: T::Output) {
|
||||
x;
|
||||
// ^ u32
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue