File tree 2 files changed +3
-9
lines changed 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,8 @@ impl<'a> PathTransform<'a> {
160
160
}
161
161
( Either :: Left ( k) , None ) => {
162
162
if let Some ( default) = k. default ( db) {
163
- eprintln ! ( "\n default = {:?}" , default ) ;
164
163
let default = ast:: make:: expr_const_value ( & default) ;
165
- fn get_syntax < T : AstNode > ( node : T ) -> SyntaxNode {
166
- node. syntax ( ) . clone_for_update ( )
167
- }
168
- const_substs. insert ( k, default. either ( get_syntax, get_syntax) ) ;
164
+ const_substs. insert ( k, default. syntax ( ) . clone_for_update ( ) ) ;
169
165
// FIXME: transform the default value
170
166
}
171
167
}
Original file line number Diff line number Diff line change 9
9
//! API should require to assemble every node piecewise. The trick of
10
10
//! `parse(format!())` we use internally is an implementation detail -- long
11
11
//! term, it will be replaced with direct tree manipulation.
12
- use either:: Either ;
13
12
use itertools:: Itertools ;
14
13
use stdx:: { format_to, never} ;
15
14
@@ -508,9 +507,8 @@ pub fn expr_literal(text: &str) -> ast::Literal {
508
507
ast_from_text ( & format ! ( "fn f() {{ let _ = {text}; }}" ) )
509
508
}
510
509
511
- // FIXME: support `ast::BLOCK_EXPR` too
512
- pub fn expr_const_value ( text : & str ) -> Either < ast:: Literal , ast:: PathExpr > {
513
- ast_from_text ( & format ! ( "fn f() {{ let _ = {text}; }}" ) )
510
+ pub fn expr_const_value ( text : & str ) -> ast:: Expr {
511
+ ast_from_text ( & format ! ( "trait Foo<const N: usize = {text}> {{}}" ) )
514
512
}
515
513
516
514
pub fn expr_empty_block ( ) -> ast:: Expr {
You can’t perform that action at this time.
0 commit comments