mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 12:04:43 +00:00 
			
		
		
		
	fix: Skip pattern analysis on type mismatches
This commit is contained in:
		
							parent
							
								
									7230ded9c7
								
							
						
					
					
						commit
						8682c1b9b4
					
				
					 2 changed files with 17 additions and 0 deletions
				
			
		|  | @ -324,6 +324,9 @@ impl ExprValidator { | |||
|             let &Statement::Let { pat, initializer, else_branch: None, .. } = stmt else { | ||||
|                 continue; | ||||
|             }; | ||||
|             if self.infer.type_mismatch_for_pat(pat).is_some() { | ||||
|                 continue; | ||||
|             } | ||||
|             let Some(initializer) = initializer else { continue }; | ||||
|             let ty = &self.infer[initializer]; | ||||
|             if ty.contains_unknown() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Shoyu Vanilla
						Shoyu Vanilla