Skip to content

Commit f34b28d

Browse files
committed
Merge branch 'master' into davxy-secp256-static-context
2 parents cff77d7 + 1188ee7 commit f34b28d

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

crates/env/src/engine/off_chain/chain_extension.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub trait ChainExtension {
5050
/// Calls the chain extension with the given input.
5151
///
5252
/// Returns an error code and may fill the `output` buffer with a SCALE encoded result.
53+
#[allow(clippy::ptr_arg)]
5354
fn call(&mut self, input: &[u8], output: &mut Vec<u8>) -> u32;
5455
}
5556

crates/lang/codegen/src/generator/events.rs

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ impl<'a> Events<'a> {
7777
/// Generates the base event enum that comprises all user defined events.
7878
/// All emitted events are converted into a variant of this enum before being
7979
/// serialized and emitted to apply their unique event discriminant (ID).
80+
///
81+
/// # Developer Note
82+
///
83+
/// The `__ink_dylint_EventBase` config attribute is used here to convey the
84+
/// information that the generated enum is an ink! event to `dylint`.
8085
fn generate_event_base(&self) -> TokenStream2 {
8186
let storage_ident = &self.contract.module().storage().ident();
8287
let event_idents = self
@@ -90,6 +95,7 @@ impl<'a> Events<'a> {
9095
quote! {
9196
#[allow(non_camel_case_types)]
9297
#[derive(::scale::Encode, ::scale::Decode)]
98+
#[cfg(not(feature = "__ink_dylint_EventBase"))]
9399
pub enum #base_event_ident {
94100
#( #event_idents(#event_idents), )*
95101
}

crates/lang/codegen/src/generator/item_impls.rs

+6
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ impl ItemImpls<'_> {
227227
}
228228

229229
/// Generates the code for the given ink! constructor within an inherent implementation block.
230+
///
231+
/// # Developer Note
232+
///
233+
/// The `__ink_dylint_Constructor` config attribute is used here to convey the
234+
/// information that the generated function is an ink! constructor to `dylint`.
230235
fn generate_inherent_constructor(constructor: &ir::Constructor) -> TokenStream2 {
231236
let span = constructor.span();
232237
let attrs = constructor.attrs();
@@ -236,6 +241,7 @@ impl ItemImpls<'_> {
236241
let statements = constructor.statements();
237242
quote_spanned!(span =>
238243
#( #attrs )*
244+
#[cfg(not(feature = "__ink_dylint_Constructor"))]
239245
#vis fn #ident( #( #inputs ),* ) -> Self {
240246
#( #statements )*
241247
}

crates/lang/codegen/src/generator/storage.rs

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ impl Storage<'_> {
8484
}
8585

8686
/// Generates the storage struct definition.
87+
///
88+
/// # Developer Note
89+
///
90+
/// The `__ink_dylint_Storage` config attribute is used here to convey the
91+
/// information that the generated struct is an ink! storage struct to `dylint`.
8792
fn generate_storage_struct(&self) -> TokenStream2 {
8893
let storage = self.contract.module().storage();
8994
let span = storage.span();
@@ -98,6 +103,7 @@ impl Storage<'_> {
98103
)]
99104
#[derive(::ink_storage::traits::SpreadLayout)]
100105
#[cfg_attr(test, derive(::core::fmt::Debug))]
106+
#[cfg(not(feature = "__ink_dylint_Storage"))]
101107
pub struct #ident {
102108
#( #fields ),*
103109
}

crates/lang/tests/unique_topics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ mod my_contract {
115115
///
116116
/// This function has complexity of `O(n * log n)` and no additional memory
117117
/// is required, although the order of items is not preserved.
118-
fn has_duplicates<T: PartialEq + AsRef<[u8]>>(items: &mut Vec<T>) -> bool {
118+
fn has_duplicates<T: PartialEq + AsRef<[u8]>>(items: &mut [T]) -> bool {
119119
// Sort the vector
120120
items.sort_by(|a, b| Ord::cmp(a.as_ref(), b.as_ref()));
121121
// And then find any two consecutive equal elements.

crates/storage/src/lazy/lazy_array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<T, const N: usize> EntryArray<T, N> {
264264
if at >= Self::capacity() {
265265
return None
266266
}
267-
(&mut *CacheCell::get_ptr(&self.entries[at as usize]).as_ptr()).as_mut()
267+
(*CacheCell::get_ptr(&self.entries[at as usize]).as_ptr()).as_mut()
268268
}
269269

270270
/// Returns an iterator that yields shared references to all cached entries.

0 commit comments

Comments
 (0)