File tree 9 files changed +9
-12
lines changed
9 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -172,9 +172,6 @@ borrowed_box = "allow"
172
172
derived_hash_with_manual_eq = " allow"
173
173
forget_non_drop = " allow"
174
174
needless_doctest_main = " allow"
175
- non_canonical_clone_impl = " allow"
176
- non_canonical_partial_ord_impl = " allow"
177
- self_named_constructors = " allow"
178
175
too_many_arguments = " allow"
179
176
type_complexity = " allow"
180
177
wrong_self_convention = " allow"
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ fn parse_comma_sep<S>(subtree: &tt::Subtree<S>) -> Vec<SmolStr> {
317
317
}
318
318
319
319
impl AttrsWithOwner {
320
- pub fn attrs_with_owner ( db : & dyn DefDatabase , owner : AttrDefId ) -> Self {
320
+ pub fn new ( db : & dyn DefDatabase , owner : AttrDefId ) -> Self {
321
321
Self { attrs : db. attrs ( owner) , owner }
322
322
}
323
323
Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ impl<N> FileItemTreeId<N> {
372
372
373
373
impl < N > Clone for FileItemTreeId < N > {
374
374
fn clone ( & self ) -> Self {
375
- Self ( self . 0 )
375
+ * self
376
376
}
377
377
}
378
378
impl < N > Copy for FileItemTreeId < N > { }
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ pub struct ItemLoc<N: ItemTreeModItemNode> {
219
219
220
220
impl < N : ItemTreeModItemNode > Clone for ItemLoc < N > {
221
221
fn clone ( & self ) -> Self {
222
- Self { container : self . container , id : self . id }
222
+ * self
223
223
}
224
224
}
225
225
@@ -248,7 +248,7 @@ pub struct AssocItemLoc<N: ItemTreeModItemNode> {
248
248
249
249
impl < N : ItemTreeModItemNode > Clone for AssocItemLoc < N > {
250
250
fn clone ( & self ) -> Self {
251
- Self { container : self . container , id : self . id }
251
+ * self
252
252
}
253
253
}
254
254
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ impl PartialEq for AstIdMap {
155
155
impl Eq for AstIdMap { }
156
156
157
157
impl AstIdMap {
158
- pub ( crate ) fn ast_id_map (
158
+ pub ( crate ) fn new (
159
159
db : & dyn ExpandDatabase ,
160
160
file_id : span:: HirFileId ,
161
161
) -> triomphe:: Arc < AstIdMap > {
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ pub trait ExpandDatabase: SourceDatabase {
61
61
#[ salsa:: input]
62
62
fn proc_macros ( & self ) -> Arc < ProcMacros > ;
63
63
64
- #[ salsa:: invoke( AstIdMap :: ast_id_map ) ]
64
+ #[ salsa:: invoke( AstIdMap :: new ) ]
65
65
fn ast_id_map ( & self , file_id : HirFileId ) -> Arc < AstIdMap > ;
66
66
67
67
/// Main public API -- parses a hir file, not caring whether it's a real
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ macro_rules! impl_has_attrs {
30
30
impl HasAttrs for $def {
31
31
fn attrs( self , db: & dyn HirDatabase ) -> AttrsWithOwner {
32
32
let def = AttrDefId :: $def_id( self . into( ) ) ;
33
- AttrsWithOwner :: attrs_with_owner ( db. upcast( ) , def)
33
+ AttrsWithOwner :: new ( db. upcast( ) , def)
34
34
}
35
35
fn attr_id( self ) -> AttrDefId {
36
36
AttrDefId :: $def_id( self . into( ) )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl<N: AstNode + std::fmt::Debug> std::fmt::Debug for AstPtr<N> {
36
36
impl < N : AstNode > Copy for AstPtr < N > { }
37
37
impl < N : AstNode > Clone for AstPtr < N > {
38
38
fn clone ( & self ) -> AstPtr < N > {
39
- AstPtr { raw : self . raw , _ty : PhantomData }
39
+ * self
40
40
}
41
41
}
42
42
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl<T> Ord for Idx<T> {
70
70
71
71
impl < T > PartialOrd for Idx < T > {
72
72
fn partial_cmp ( & self , other : & Self ) -> Option < cmp:: Ordering > {
73
- self . raw . partial_cmp ( & other. raw )
73
+ Some ( self . cmp ( other) )
74
74
}
75
75
}
76
76
You can’t perform that action at this time.
0 commit comments