the "add missing members" assists: implemented substitution of default values of const params

This commit is contained in:
ponyii 2023-06-30 17:31:04 +04:00
parent 6918eb6ebd
commit 52b4392724
8 changed files with 127 additions and 52 deletions

View file

@ -503,11 +503,16 @@ pub fn hacky_block_expr(
pub fn expr_unit() -> ast::Expr {
expr_from_text("()")
}
pub fn expr_literal(text: &str) -> ast::Literal {
assert_eq!(text.trim(), text);
ast_from_text(&format!("fn f() {{ let _ = {text}; }}"))
}
pub fn expr_const_value(text: &str) -> ast::Expr {
ast_from_text(&format!("trait Foo<const N: usize = {text}> {{}}"))
}
pub fn expr_empty_block() -> ast::Expr {
expr_from_text("{}")
}