MCPcopy Index your code
hub / github.com/RustPython/RustPython / compiler_unwrap_option

Function compiler_unwrap_option

crates/codegen/src/compile.rs:374–382  ·  view source on GitHub ↗
(zelf: &Compiler, o: Option<T>)

Source from the content-addressed store, hash-verified

372}
373
374fn compiler_unwrap_option<T>(zelf: &Compiler, o: Option<T>) -> T {
375 if o.is_none() {
376 eprintln!("=== CODEGEN PANIC INFO ===");
377 eprintln!("This IS an internal error, an option was unwrapped during codegen");
378 eprint_location(zelf);
379 eprintln!("=== END PANIC INFO ===");
380 }
381 o.unwrap()
382}
383
384// fn compiler_result_unwrap<T, E: core::fmt::Debug>(zelf: &Compiler, result: Result<T, E>) -> T {
385// if result.is_err() {

Callers 4

exit_scopeMethod · 0.85
exit_annotation_scopeMethod · 0.85
compile_block_exprMethod · 0.85

Calls 3

eprint_locationFunction · 0.85
is_noneMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected