Commit a59e9f7 1 parent f34453d commit a59e9f7 Copy full SHA for a59e9f7
File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -841,12 +841,16 @@ impl Constant {
841
841
language_backend. write_literal ( out, value) ;
842
842
}
843
843
Language :: Cython => {
844
- out. write ( "const " ) ;
845
- language_backend. write_type ( out, & self . ty ) ;
846
- // For extern Cython declarations the initializer is ignored,
847
- // but still useful as documentation, so we write it as a comment.
848
- write ! ( out, " {} # = " , name) ;
849
- language_backend. write_literal ( out, value) ;
844
+ if matches ! ( self . value, Literal :: PanicMacro ( _) ) {
845
+ // Cython don't have a equivalent to `#error` directive
846
+ } else {
847
+ out. write ( "const " ) ;
848
+ language_backend. write_type ( out, & self . ty ) ;
849
+ // For extern Cython declarations the initializer is ignored,
850
+ // but still useful as documentation, so we write it as a comment.
851
+ write ! ( out, " {} # = " , name) ;
852
+ language_backend. write_literal ( out, value) ;
853
+ }
850
854
}
851
855
}
852
856
You can’t perform that action at this time.
0 commit comments