mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Add flag to disallow opaque types for DisplayTarget::SourceCode
This commit is contained in:
parent
7501d3b721
commit
ac03de773f
15 changed files with 62 additions and 29 deletions
|
@ -176,7 +176,9 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
|
|||
fn make_ty(ty: &hir::Type, db: &dyn HirDatabase, module: hir::Module) -> ast::Type {
|
||||
let ty_str = match ty.as_adt() {
|
||||
Some(adt) => adt.name(db).to_string(),
|
||||
None => ty.display_source_code(db, module.into()).ok().unwrap_or_else(|| "_".to_string()),
|
||||
None => {
|
||||
ty.display_source_code(db, module.into(), false).ok().unwrap_or_else(|| "_".to_string())
|
||||
}
|
||||
};
|
||||
|
||||
make::ty(&ty_str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue