mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 13:13:18 +00:00 
			
		
		
		
	Merge #1027
1027: remove obsolete diagnostic r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
		
						commit
						5a6a3d0777
					
				@ -98,7 +98,6 @@ pub enum ModuleSource {
 | 
				
			|||||||
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
 | 
					#[derive(Clone, Debug, Hash, PartialEq, Eq)]
 | 
				
			||||||
pub enum Problem {
 | 
					pub enum Problem {
 | 
				
			||||||
    UnresolvedModule { candidate: RelativePathBuf },
 | 
					    UnresolvedModule { candidate: RelativePathBuf },
 | 
				
			||||||
    NotDirOwner { move_to: RelativePathBuf, candidate: RelativePathBuf },
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl Module {
 | 
					impl Module {
 | 
				
			||||||
 | 
				
			|||||||
@ -152,27 +152,6 @@ fn check_module(
 | 
				
			|||||||
                    fix: Some(fix),
 | 
					                    fix: Some(fix),
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Problem::NotDirOwner { move_to, candidate } => {
 | 
					 | 
				
			||||||
                let move_file = FileSystemEdit::MoveFile {
 | 
					 | 
				
			||||||
                    src: file_id,
 | 
					 | 
				
			||||||
                    dst_source_root: source_root,
 | 
					 | 
				
			||||||
                    dst_path: move_to.clone(),
 | 
					 | 
				
			||||||
                };
 | 
					 | 
				
			||||||
                let create_file =
 | 
					 | 
				
			||||||
                    FileSystemEdit::CreateFile { source_root, path: move_to.join(candidate) };
 | 
					 | 
				
			||||||
                let fix = SourceChange {
 | 
					 | 
				
			||||||
                    label: "move file and create module".to_string(),
 | 
					 | 
				
			||||||
                    source_file_edits: Vec::new(),
 | 
					 | 
				
			||||||
                    file_system_edits: vec![move_file, create_file],
 | 
					 | 
				
			||||||
                    cursor_position: None,
 | 
					 | 
				
			||||||
                };
 | 
					 | 
				
			||||||
                Diagnostic {
 | 
					 | 
				
			||||||
                    range: name_node.range(),
 | 
					 | 
				
			||||||
                    message: "can't declare module at this location".to_string(),
 | 
					 | 
				
			||||||
                    severity: Severity::Error,
 | 
					 | 
				
			||||||
                    fix: Some(fix),
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        acc.push(diag)
 | 
					        acc.push(diag)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user