mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 18:15:07 +03:00
Add no parameter test to call_info
This commit is contained in:
@@ -197,6 +197,25 @@ fn foo<T, U: Copy + Display>(x: T, y: U) -> u32
|
||||
assert_eq!(info.active_parameter, Some(0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_fn_signature_no_params() {
|
||||
let info = call_info(
|
||||
r#"fn foo<T>() -> T where T: Copy + Display {}
|
||||
fn bar() { foo(<|>); }"#,
|
||||
);
|
||||
|
||||
assert!(info.parameters().is_empty());
|
||||
assert_eq!(
|
||||
info.label(),
|
||||
r#"
|
||||
fn foo<T>() -> T
|
||||
where T: Copy + Display
|
||||
"#
|
||||
.trim()
|
||||
);
|
||||
assert!(info.active_parameter.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_fn_signature_for_impl() {
|
||||
let info = call_info(
|
||||
|
||||
Reference in New Issue
Block a user