Skip to content

Commit

Permalink
move from dyn trait in argument position
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurnikov committed Dec 18, 2024
1 parent 9367be0 commit a6065ec
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions third_party/move/move-compiler-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ where
}

/// Run move compiler and print errors to given writer. Returns the set of compiled units.
pub fn run_move_compiler_with_emitter(
emitter: &mut dyn Emitter,
pub fn run_move_compiler_with_emitter<E>(
emitter: &mut E,
options: Options,
) -> anyhow::Result<(GlobalEnv, Vec<AnnotatedCompiledUnit>)> {
) -> anyhow::Result<(GlobalEnv, Vec<AnnotatedCompiledUnit>)>
where
E: Emitter + ?Sized,
{
logging::setup_logging();
info!("Move Compiler v2");

Expand Down Expand Up @@ -618,7 +621,10 @@ fn get_vm_error_loc(env: &GlobalEnv, source_map: &SourceMap, e: &VMError) -> Opt
}

/// Report any diags in the env to the writer and fail if there are errors.
pub fn check_errors(env: &GlobalEnv, emitter: &mut dyn Emitter, msg: &str) -> anyhow::Result<()> {
pub fn check_errors<E>(env: &GlobalEnv, emitter: &mut E, msg: &str) -> anyhow::Result<()>
where
E: Emitter + ?Sized,
{
let options = env.get_extension::<Options>().unwrap_or_default();

emitter.report_diag(env, options.report_severity());
Expand Down

0 comments on commit a6065ec

Please sign in to comment.