We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
make::expr_from_text
Into<ast::Expr>
1 parent 5afee0d commit bdb72bdCopy full SHA for bdb72bd
src/tools/rust-analyzer/crates/syntax/src/ast/make.rs
@@ -663,7 +663,7 @@ pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> ast::Expr {
663
pub fn expr_assignment(lhs: ast::Expr, rhs: ast::Expr) -> ast::Expr {
664
expr_from_text(&format!("{lhs} = {rhs}"))
665
}
666
-fn expr_from_text(text: &str) -> ast::Expr {
+fn expr_from_text<E: Into<ast::Expr> + AstNode>(text: &str) -> E {
667
ast_from_text(&format!("const C: () = {text};"))
668
669
pub fn expr_let(pattern: ast::Pat, expr: ast::Expr) -> ast::LetExpr {
0 commit comments