@@ -10,7 +10,7 @@ use comfy_table::{presets::ASCII_MARKDOWN, Attribute, Cell, CellAlignment, Color
1010use eyre:: Result ;
1111use foundry_block_explorers:: contract:: Metadata ;
1212use foundry_compilers:: {
13- artifacts:: { remappings:: Remapping , BytecodeObject , Source } ,
13+ artifacts:: { remappings:: Remapping , BytecodeObject , Contract , Source } ,
1414 compilers:: {
1515 solc:: { Solc , SolcCompiler } ,
1616 Compiler ,
@@ -129,7 +129,10 @@ impl ProjectCompiler {
129129 }
130130
131131 /// Compiles the project.
132- pub fn compile < C : Compiler > ( mut self , project : & Project < C > ) -> Result < ProjectCompileOutput < C > > {
132+ pub fn compile < C : Compiler < CompilerContract = Contract > > (
133+ mut self ,
134+ project : & Project < C > ,
135+ ) -> Result < ProjectCompileOutput < C > > {
133136 // TODO: Avoid process::exit
134137 if !project. paths . has_input_files ( ) && self . files . is_empty ( ) {
135138 sh_println ! ( "Nothing to compile" ) ?;
@@ -163,7 +166,10 @@ impl ProjectCompiler {
163166 /// ProjectCompiler::new().compile_with(|| Ok(prj.compile()?)).unwrap();
164167 /// ```
165168 #[ instrument( target = "forge::compile" , skip_all) ]
166- fn compile_with < C : Compiler , F > ( self , f : F ) -> Result < ProjectCompileOutput < C > >
169+ fn compile_with < C : Compiler < CompilerContract = Contract > , F > (
170+ self ,
171+ f : F ,
172+ ) -> Result < ProjectCompileOutput < C > >
167173 where
168174 F : FnOnce ( ) -> Result < ProjectCompileOutput < C > > ,
169175 {
@@ -202,7 +208,10 @@ impl ProjectCompiler {
202208 }
203209
204210 /// If configured, this will print sizes or names
205- fn handle_output < C : Compiler > ( & self , output : & ProjectCompileOutput < C > ) {
211+ fn handle_output < C : Compiler < CompilerContract = Contract > > (
212+ & self ,
213+ output : & ProjectCompileOutput < C > ,
214+ ) {
206215 let print_names = self . print_names . unwrap_or ( false ) ;
207216 let print_sizes = self . print_sizes . unwrap_or ( false ) ;
208217
@@ -465,7 +474,7 @@ pub struct ContractInfo {
465474/// If `verify` and it's a standalone script, throw error. Only allowed for projects.
466475///
467476/// **Note:** this expects the `target_path` to be absolute
468- pub fn compile_target < C : Compiler > (
477+ pub fn compile_target < C : Compiler < CompilerContract = Contract > > (
469478 target_path : & Path ,
470479 project : & Project < C > ,
471480 quiet : bool ,
0 commit comments