Skip to content

Commit

Permalink
Rollup merge of rust-lang#130635 - eholk:pin-reborrow-sugar, r=compil…
Browse files Browse the repository at this point in the history
…er-errors

Add `&pin (mut|const) T` type position sugar

This adds parser support for `&pin mut T` and `&pin const T` references. These are desugared to `Pin<&mut T>` and `Pin<&T>` in the AST lowering phases.

This PR currently includes rust-lang#130526 since that one is in the commit queue. Only the most recent commits (bd45002 and following) are new.

Tracking:

- rust-lang#130494

r? `@compiler-errors`
  • Loading branch information
matthiaskrgr authored Oct 15, 2024
2 parents ea48cf3 + c038c30 commit 66359a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clippy_utils/src/ast_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
(Ref(ll, l), Ref(rl, r)) => {
both(ll.as_ref(), rl.as_ref(), |l, r| eq_id(l.ident, r.ident)) && l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty)
},
(PinnedRef(ll, l), PinnedRef(rl, r)) => {
both(ll.as_ref(), rl.as_ref(), |l, r| eq_id(l.ident, r.ident)) && l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty)
},
(BareFn(l), BareFn(r)) => {
l.safety == r.safety
&& eq_ext(&l.ext, &r.ext)
Expand Down

0 comments on commit 66359a7

Please sign in to comment.