@@ -148,7 +148,6 @@ impl<'c> Translation<'c> {
148148 & self ,
149149 ctx : ExprContext ,
150150 expr_id : CExprId ,
151- override_ty : Option < CQualTypeId > ,
152151 ) -> TranslationResult < Option < WithStmts < Box < Expr > > > > {
153152 let macros = match self . ast_context . macro_invocations . get ( & expr_id) {
154153 Some ( macros) => macros. as_slice ( ) ,
@@ -201,6 +200,7 @@ impl<'c> Translation<'c> {
201200 // determined by the surrounding context.
202201 // Since the expansion sites are expecting a particular type, we need to cast it here
203202 // if it differs from the `const` type.
203+ let override_ty = self . expr_override_types . get ( & expr_id) . copied ( ) ;
204204 let expr_ty = override_ty. or_else ( || self . ast_context [ expr_id] . kind . get_qual_type ( ) ) ;
205205 if let Some ( expr_ty) = expr_ty {
206206 self . convert_cast (
@@ -249,14 +249,9 @@ impl<'c> Translation<'c> {
249249 ) ) ) )
250250 }
251251
252- pub fn expr_is_expanded_macro (
253- & self ,
254- ctx : ExprContext ,
255- expr_id : CExprId ,
256- override_ty : Option < CQualTypeId > ,
257- ) -> bool {
252+ pub fn expr_is_expanded_macro ( & self , ctx : ExprContext , expr_id : CExprId ) -> bool {
258253 matches ! (
259- self . convert_const_macro_expansion( ctx, expr_id, override_ty ) ,
254+ self . convert_const_macro_expansion( ctx, expr_id) ,
260255 Ok ( Some ( _) )
261256 )
262257 }
0 commit comments