@@ -71,11 +71,16 @@ impl<'cx, 'a> Context<'cx, 'a> {
7171 /// }
7272 /// }
7373 /// ```
74- pub ( super ) fn build ( mut self , mut cond_expr : P < Expr > , panic_path : Path ) -> P < Expr > {
74+ pub ( super ) fn build (
75+ mut self ,
76+ mut cond_expr : P < Expr > ,
77+ is_in_const_env : bool ,
78+ panic_path : Path ,
79+ ) -> P < Expr > {
7580 let expr_str = pprust:: expr_to_string ( & cond_expr) ;
7681 self . manage_cond_expr ( & mut cond_expr) ;
7782 let initial_imports = self . build_initial_imports ( ) ;
78- let panic = self . build_panic ( & expr_str, panic_path) ;
83+ let panic = self . build_panic ( & expr_str, is_in_const_env , panic_path) ;
7984 let cond_expr_with_unlikely = self . build_unlikely ( cond_expr) ;
8085
8186 let Self { best_case_captures, capture_decls, cx, local_bind_decls, span, .. } = self ;
@@ -147,7 +152,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
147152 /// __capture0,
148153 /// ...
149154 /// );
150- fn build_panic ( & self , expr_str : & str , panic_path : Path ) -> P < Expr > {
155+ fn build_panic ( & self , expr_str : & str , is_in_const_env : bool , panic_path : Path ) -> P < Expr > {
151156 let escaped_expr_str = escape_to_fmt ( expr_str) ;
152157 let initial = [
153158 TokenTree :: token_joint (
@@ -179,6 +184,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
179184 self . cx . expr (
180185 self . span ,
181186 ExprKind :: MacCall ( P ( MacCall {
187+ is_in_const_env,
182188 path : panic_path,
183189 args : P ( DelimArgs {
184190 dspan : DelimSpan :: from_single ( self . span ) ,
0 commit comments