Skip to content

Commit e5dc149

Browse files
authored
Fixes two elided_named_lifetimes warnings (#1680)
When I build Solang, I see these two warnings: ``` warning: elided lifetime has a name --> src/emit/mod.rs:375:18 | 369 | pub fn binary<'a>( | -- lifetime `'a` declared here ... 375 | ) -> binary::Binary { | ^^^^^^ this elided lifetime gets resolved as `'a` | = note: `#[warn(elided_named_lifetimes)]` on by default warning: elided lifetime has a name --> src/sema/builtin_structs.rs:243:59 | 243 | pub fn definition<'a>(&'a self, ns: &'a Namespace) -> &StructDecl { | -- lifetime `'a` declared here ^ this elided lifetime gets resolved as `'a` ``` This PR addresses both of the warnings. Signed-off-by: Samuel Moelius <samuel.moelius@trailofbits.com>
1 parent fc29c83 commit e5dc149

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/emit/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl ast::Contract {
372372
context: &'a inkwell::context::Context,
373373
opt: &'a Options,
374374
contract_no: usize,
375-
) -> binary::Binary {
375+
) -> binary::Binary<'a> {
376376
binary::Binary::build(context, self, ns, opt, contract_no)
377377
}
378378

src/sema/builtin_structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub static BUILTIN_STRUCTS: Lazy<[BuiltinStructDeclaration; 3]> = Lazy::new(|| {
240240
});
241241

242242
impl StructType {
243-
pub fn definition<'a>(&'a self, ns: &'a Namespace) -> &StructDecl {
243+
pub fn definition<'a>(&'a self, ns: &'a Namespace) -> &'a StructDecl {
244244
match self {
245245
StructType::UserDefined(struct_no) => &ns.structs[*struct_no],
246246
StructType::AccountInfo => &BUILTIN_STRUCTS[0].struct_decl,

0 commit comments

Comments
 (0)