This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +15
-11
lines changed
proc-macro-srv/proc-macro-test Expand file tree Collapse file tree 7 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 9090 - name : Switch to stable toolchain
9191 run : |
9292 rustup update --no-self-update stable
93- rustup component add --toolchain stable rust-src
93+ rustup component add --toolchain stable rust-src clippy
9494 rustup default stable
9595
9696 - name : Run analysis-stats on rust-analyzer
@@ -103,6 +103,10 @@ jobs:
103103 RUSTC_BOOTSTRAP : 1
104104 run : target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
105105
106+ - name : clippy
107+ if : matrix.os == 'ubuntu-latest'
108+ run : cargo clippy --all-targets
109+
106110 # Weird targets to catch non-portable code
107111 rust-cross :
108112 if : github.repository == 'rust-lang/rust-analyzer'
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ impl Attr {
235235 let ( path, input) = tt. split_at ( path_end) ;
236236 let path = Interned :: new ( ModPath :: from_tt ( db, path) ?) ;
237237
238- let input = match input. get ( 0 ) {
238+ let input = match input. first ( ) {
239239 Some ( tt:: TokenTree :: Subtree ( tree) ) => {
240240 Some ( Interned :: new ( AttrInput :: TokenTree ( Box :: new ( tree. clone ( ) ) ) ) )
241241 }
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ fn convert_path(
232232 ast:: PathSegmentKind :: SuperKw => {
233233 let mut deg = 1 ;
234234 let mut next_segment = None ;
235- while let Some ( segment) = segments. next ( ) {
235+ for segment in segments. by_ref ( ) {
236236 match segment. kind ( ) ? {
237237 ast:: PathSegmentKind :: SuperKw => deg += 1 ,
238238 ast:: PathSegmentKind :: Name ( name) => {
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ impl<'p> MatchCheckCtx<'p> {
237237 ctor = Or ;
238238 // Collect here because `Arena::alloc_extend` panics on reentrancy.
239239 let subpats: SmallVec < [ _ ; 2 ] > =
240- pats. into_iter ( ) . map ( |pat| self . lower_pat ( pat) ) . collect ( ) ;
240+ pats. iter ( ) . map ( |pat| self . lower_pat ( pat) ) . collect ( ) ;
241241 fields = self . pattern_arena . alloc_extend ( subpats) ;
242242 }
243243 }
Original file line number Diff line number Diff line change @@ -1715,7 +1715,7 @@ impl Evaluator<'_> {
17151715 let v: Cow < ' _ , [ u8 ] > = if size != v. len ( ) {
17161716 // Handle self enum
17171717 if size == 16 && v. len ( ) < 16 {
1718- Cow :: Owned ( pad16 ( & v, false ) . to_vec ( ) )
1718+ Cow :: Owned ( pad16 ( v, false ) . to_vec ( ) )
17191719 } else if size < 16 && v. len ( ) == 16 {
17201720 Cow :: Borrowed ( & v[ 0 ..size] )
17211721 } else {
Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ fn modpath_from_str(link: &str) -> Option<ModPath> {
311311 "self" => PathKind :: Super ( 0 ) ,
312312 "super" => {
313313 let mut deg = 1 ;
314- while let Some ( segment) = parts. next ( ) {
314+ for segment in parts. by_ref ( ) {
315315 if segment == "super" {
316316 deg += 1 ;
317317 } else {
Original file line number Diff line number Diff line change @@ -109,11 +109,11 @@ fn main() {
109109 let mut artifact_path = None ;
110110 for message in Message :: parse_stream ( output. stdout . as_slice ( ) ) {
111111 if let Message :: CompilerArtifact ( artifact) = message. unwrap ( ) {
112- if artifact. target . kind . contains ( & "proc-macro" . to_string ( ) ) {
113- if artifact. package_id . repr . starts_with ( & repr) || artifact . package_id . repr == pkgid
114- {
115- artifact_path = Some ( PathBuf :: from ( & artifact . filenames [ 0 ] ) ) ;
116- }
112+ if artifact. target . kind . contains ( & "proc-macro" . to_string ( ) )
113+ && ( artifact. package_id . repr . starts_with ( & repr)
114+ || artifact . package_id . repr == pkgid )
115+ {
116+ artifact_path = Some ( PathBuf :: from ( & artifact . filenames [ 0 ] ) ) ;
117117 }
118118 }
119119 }
You can’t perform that action at this time.
0 commit comments