mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 03:54:42 +00:00 
			
		
		
		
	Merge pull request #20333 from Veykril/push-xmulpqkxrytn
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				metrics / build_metrics (push) Waiting to run
				
			
		
			
				
	
				metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (self) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
				
			
		
			
				
	
				metrics / generate_final_metrics (push) Blocked by required conditions
				
			
		
			
				
	
				rustdoc / rustdoc (push) Waiting to run
				
			
		
		
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	metrics / build_metrics (push) Waiting to run
				
			metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
				
			metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
				
			metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
				
			metrics / other_metrics (self) (push) Blocked by required conditions
				
			metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
				
			metrics / generate_final_metrics (push) Blocked by required conditions
				
			rustdoc / rustdoc (push) Waiting to run
				
			fix: Do not require all rename definitions to be renameable
This commit is contained in:
		
						commit
						4bcc293637
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		|  | @ -35,13 +35,8 @@ pub(crate) fn prepare_rename( | ||||||
|     let syntax = source_file.syntax(); |     let syntax = source_file.syntax(); | ||||||
| 
 | 
 | ||||||
|     let res = find_definitions(&sema, syntax, position, &Name::new_symbol_root(sym::underscore))? |     let res = find_definitions(&sema, syntax, position, &Name::new_symbol_root(sym::underscore))? | ||||||
|         .map(|(frange, kind, def, _, _)| { |         .filter(|(_, _, def, _, _)| def.range_for_rename(&sema).is_some()) | ||||||
|             // ensure all ranges are valid
 |         .map(|(frange, kind, _, _, _)| { | ||||||
| 
 |  | ||||||
|             if def.range_for_rename(&sema).is_none() { |  | ||||||
|                 bail!("No references found at position") |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|             always!( |             always!( | ||||||
|                 frange.range.contains_inclusive(position.offset) |                 frange.range.contains_inclusive(position.offset) | ||||||
|                     && frange.file_id == position.file_id |                     && frange.file_id == position.file_id | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Wirth
						Lukas Wirth