-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
@@ -109,16 +109,13 @@ where | |||
/// Similar to a `BoundedVec`, but not owned and cannot be decoded. | |||
#[derive(Encode, scale_info::TypeInfo)] | |||
#[scale_info(skip_type_params(S))] | |||
pub struct BoundedSlice<'a, T, S>(&'a [T], PhantomData<S>); | |||
pub struct BoundedSlice<T: 'static, S>(&'static [T], PhantomData<S>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't see why this can be 'static
, we should be parameterizing over the lifetime of the reference to the slice, but I don't know why rustc or clippy is telling us to just use 'static
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, thinking a little more, I think you are right. So then just add a clippy silencer here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems it is a bug atm (either to silence it or the warning itself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why it started annoying us with this. Does not make sense IMO.
Otherwise it would not work outside of static context anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah perhaps we silence this lint globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can not silence it. However, I also don't think this here is the correct solution. This is a bug in rustc and I also already looked into it. It is coming from the scale_info::TypeInfo
derive macro. We need to wait for rustc to fix this.
Fix these warnings:
The second warning about
BoundedVec
seems we should ignore.Needs: rust-lang/rust#96956