@@ -42,8 +42,8 @@ std::unique_ptr<Expr>
42
42
DeriveOrd::cmp_call (std::unique_ptr<Expr> &&self_expr,
43
43
std::unique_ptr<Expr> &&other_expr)
44
44
{
45
- auto cmp_fn_path = builder.path_in_expression (
46
- {" core " , " cmp" , trait (ordering), fn (ordering)}, true );
45
+ auto cmp_fn_path = builder.path_in_expression_core (
46
+ {" cmp" , trait (ordering), fn (ordering)});
47
47
48
48
return builder.call (ptrify (cmp_fn_path),
49
49
vec (builder.ref (std::move (self_expr)),
@@ -58,10 +58,10 @@ DeriveOrd::cmp_impl (
58
58
auto fn = cmp_fn (std::move (fn_block), type_name);
59
59
60
60
auto trait = ordering == Ordering::Partial ? " PartialOrd" : " Ord" ;
61
- auto trait_path = builder.type_path ({" core " , " cmp" , trait}, true );
61
+ auto trait_path = builder.type_path_core ({" cmp" , trait});
62
62
63
63
auto trait_bound
64
- = builder.trait_bound (builder.type_path ({" core " , " cmp" , trait}, true ));
64
+ = builder.trait_bound (builder.type_path_core ({" cmp" , trait}));
65
65
66
66
auto trait_items = vec (std::move (fn));
67
67
@@ -78,7 +78,7 @@ std::unique_ptr<AssociatedItem>
78
78
DeriveOrd::cmp_fn (std::unique_ptr<BlockExpr> &&block, Identifier type_name)
79
79
{
80
80
// Ordering
81
- auto return_type = builder.type_path ({" core " , " cmp" , " Ordering" }, true );
81
+ auto return_type = builder.type_path_core ({" cmp" , " Ordering" });
82
82
83
83
// In the case of PartialOrd, we return an Option<Ordering>
84
84
if (ordering == Ordering::Partial)
@@ -87,13 +87,11 @@ DeriveOrd::cmp_fn (std::unique_ptr<BlockExpr> &&block, Identifier type_name)
87
87
88
88
auto generic_seg = builder.type_path_segment_generic (
89
89
" Option" , GenericArgs ({}, {generic}, {}, loc));
90
- auto core = builder.type_path_segment (" core" );
91
90
auto option = builder.type_path_segment (" option" );
92
91
93
92
return_type
94
- = builder.type_path (vec (std::move (core), std::move (option),
95
- std::move (generic_seg)),
96
- true );
93
+ = builder.type_path_core (vec (std::move (option),
94
+ std::move (generic_seg)));
97
95
}
98
96
99
97
// &self, other: &Self
@@ -113,7 +111,7 @@ std::unique_ptr<Pattern>
113
111
DeriveOrd::make_equal ()
114
112
{
115
113
std::unique_ptr<Pattern> equal = ptrify (
116
- builder.path_in_expression ({" core " , " cmp" , " Ordering" , " Equal" }, true ));
114
+ builder.path_in_expression_core ({" cmp" , " Ordering" , " Equal" }));
117
115
118
116
// We need to wrap the pattern in Option::Some if we are doing partial
119
117
// ordering
@@ -148,8 +146,7 @@ DeriveOrd::recursive_match (std::vector<SelfOther> &&members)
148
146
if (members.empty ())
149
147
{
150
148
std::unique_ptr<Expr> value = ptrify (
151
- builder.path_in_expression ({" core" , " cmp" , " Ordering" , " Equal" },
152
- true ));
149
+ builder.path_in_expression_core ({" cmp" , " Ordering" , " Equal" }));
153
150
154
151
if (ordering == Ordering::Partial)
155
152
value = builder.call (ptrify (builder.path_in_expression (
0 commit comments