mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Merge #864
864: Fix handling of generics in tuple variants and refactor a bit r=matklad a=flodiebold (The problem was that we created separate substitutions for the return value, so we lost the connection between the type arguments in the constructor call and the type arguments of the result.) Also make them display a tiny bit nicer. Fixes #860. Co-authored-by: Florian Diebold <flodiebold@gmail.com> Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
This commit is contained in:
commit
bb665a7062
6 changed files with 124 additions and 42 deletions
|
@ -163,6 +163,23 @@ mod tests {
|
|||
assert_eq!(hover.info, "u32");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_some() {
|
||||
let (analysis, position) = single_file_with_position(
|
||||
"
|
||||
enum Option<T> { Some(T) }
|
||||
use Option::Some;
|
||||
|
||||
fn main() {
|
||||
So<|>me(12);
|
||||
}
|
||||
",
|
||||
);
|
||||
let hover = analysis.hover(position).unwrap().unwrap();
|
||||
// not the nicest way to show it currently
|
||||
assert_eq!(hover.info, "Some<i32>(T) -> Option<T>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_for_local_variable() {
|
||||
let (analysis, position) = single_file_with_position("fn func(foo: i32) { fo<|>o; }");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue