[new_without_default]: make the suggestion machine-applicable
Now that generics and lifetimes are output as expected, the lint should be applicable.
This commit is contained in:
parent
621e76d252
commit
f9b22e7b84
@ -155,7 +155,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
|
||||
&generics_sugg,
|
||||
&where_clause_sugg
|
||||
),
|
||||
Applicability::MaybeIncorrect,
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -102,7 +102,6 @@ impl<'c> LtKo<'c> {
|
||||
pub fn new() -> LtKo<'c> {
|
||||
unimplemented!()
|
||||
}
|
||||
// FIXME: that suggestion is missing lifetimes
|
||||
}
|
||||
|
||||
struct Private;
|
||||
@ -273,3 +272,30 @@ impl IgnoreLifetimeNew {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
// From issue #11267
|
||||
|
||||
pub struct MyStruct<K, V>
|
||||
where
|
||||
K: std::hash::Hash + Eq + PartialEq,
|
||||
{
|
||||
_kv: Option<(K, V)>,
|
||||
}
|
||||
|
||||
impl<K, V> Default for MyStruct<K, V>
|
||||
where
|
||||
K: std::hash::Hash + Eq + PartialEq,
|
||||
{
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, V> MyStruct<K, V>
|
||||
where
|
||||
K: std::hash::Hash + Eq + PartialEq,
|
||||
{
|
||||
pub fn new() -> Self {
|
||||
Self { _kv: None }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user