diff --git a/vhdl_lang/src/analysis/lock.rs b/vhdl_lang/src/analysis/lock.rs index 3314014e..c307474d 100644 --- a/vhdl_lang/src/analysis/lock.rs +++ b/vhdl_lang/src/analysis/lock.rs @@ -181,13 +181,13 @@ mod tests { match lock.entry() { AnalysisEntry::Occupied(entry) => { assert_eq!(*entry, 2); - assert!((*entry.result() - 1.0_f64).abs() < std::f64::EPSILON); + assert!((*entry.result() - 1.0_f64).abs() < f64::EPSILON); } _ => panic!("Expected Occupied entry"), }; assert_eq!(*lock.get().unwrap(), 2); - assert!((*lock.get().unwrap().result() - 1.0_f64).abs() < std::f64::EPSILON); + assert!((*lock.get().unwrap().result() - 1.0_f64).abs() < f64::EPSILON); // Check that lock is reset lock.reset(); diff --git a/vhdl_lang/src/analysis/names.rs b/vhdl_lang/src/analysis/names.rs index b6d398e3..5365ca8e 100644 --- a/vhdl_lang/src/analysis/names.rs +++ b/vhdl_lang/src/analysis/names.rs @@ -427,7 +427,6 @@ pub enum AttrResolveResult<'a> { #[derive(Debug)] pub struct AttributeSuffix<'a> { - pub signature: &'a mut Option>, pub attr: &'a mut WithToken, pub expr: &'a mut Option>>, } @@ -462,7 +461,6 @@ impl<'a> SplitName<'a> { Name::Attribute(ref mut attr) => SplitName::Suffix( &mut attr.name, Suffix::Attribute(AttributeSuffix { - signature: &mut attr.signature, attr: &mut attr.attr, expr: &mut attr.expr, }), diff --git a/vhdl_lang/src/analysis/range.rs b/vhdl_lang/src/analysis/range.rs index 2741d28a..de290885 100644 --- a/vhdl_lang/src/analysis/range.rs +++ b/vhdl_lang/src/analysis/range.rs @@ -319,11 +319,7 @@ impl<'a, 't> AnalyzeContext<'a, 't> { prefix.as_type_of_attr_prefix( self.ctx, name.span, - &AttributeSuffix { - signature, - attr, - expr, - }, + &AttributeSuffix { attr, expr }, diagnostics, ) }), diff --git a/vhdl_lang/src/named_entity/arena.rs b/vhdl_lang/src/named_entity/arena.rs index 29724f20..69bf6ff6 100644 --- a/vhdl_lang/src/named_entity/arena.rs +++ b/vhdl_lang/src/named_entity/arena.rs @@ -65,7 +65,8 @@ impl LocalArena { let ent_id = EntityId::new_arena(self.id, LocalId(idx as u32)); ent.id = ent_id; - self.items.push(std::mem::transmute(ent)); + self.items + .push(std::mem::transmute::, AnyEnt<'_>>(ent)); self.get(ent_id.local_id()) } diff --git a/vhdl_lang/src/syntax/tokens/tokenizer.rs b/vhdl_lang/src/syntax/tokens/tokenizer.rs index 552611fe..0b72595c 100644 --- a/vhdl_lang/src/syntax/tokens/tokenizer.rs +++ b/vhdl_lang/src/syntax/tokens/tokenizer.rs @@ -942,10 +942,10 @@ fn parse_exponent(reader: &mut ContentReader) -> Result { let exp = parse_integer(reader, 10, false)?; if negative { - if exp <= (-(i32::min_value() as i64)) as u64 { + if exp <= (-(i32::MIN as i64)) as u64 { return Ok((-(exp as i64)) as i32); } - } else if exp <= i32::max_value() as u64 { + } else if exp <= i32::MAX as u64 { return Ok(exp as i32); } @@ -2583,7 +2583,7 @@ comment ))] ); - let exponent_str = ((i32::max_value() as i64) + 1).to_string(); + let exponent_str = ((i32::MAX as i64) + 1).to_string(); let large_int = format!("1e{exponent_str}"); let code = Code::new(&large_int); let (tokens, _) = code.tokenize_result(); @@ -2595,7 +2595,7 @@ comment ))] ); - let exponent_str = ((i32::min_value() as i64) - 1).to_string(); + let exponent_str = ((i32::MIN as i64) - 1).to_string(); let large_int = format!("1.0e{exponent_str}"); let code = Code::new(&large_int); let (tokens, _) = code.tokenize_result(); @@ -2607,7 +2607,7 @@ comment ))] ); - let large_int = ((u64::max_value() as i128) + 1).to_string(); + let large_int = ((u64::MAX as i128) + 1).to_string(); let code = Code::new(&large_int); let (tokens, _) = code.tokenize_result(); assert_eq!( @@ -2618,14 +2618,14 @@ comment ))] ); - let large_int = u64::max_value().to_string(); + let large_int = u64::MAX.to_string(); let code = Code::new(&large_int); let (tokens, _) = code.tokenize_result(); assert_eq!( tokens, vec![Ok(Token { kind: AbstractLiteral, - value: Value::AbstractLiteral(ast::AbstractLiteral::Integer(u64::max_value())), + value: Value::AbstractLiteral(ast::AbstractLiteral::Integer(u64::MAX)), pos: code.pos(), comments: None, })]