mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Diagnose incorrect unsafety for trait impls
This commit is contained in:
parent
d5faad1dae
commit
e21d21a8fb
8 changed files with 204 additions and 24 deletions
|
@ -388,8 +388,18 @@ impl Printer<'_> {
|
|||
wln!(self);
|
||||
}
|
||||
ModItem::Impl(it) => {
|
||||
let Impl { target_trait, self_ty, is_negative, items, generic_params, ast_id: _ } =
|
||||
&self.tree[it];
|
||||
let Impl {
|
||||
target_trait,
|
||||
self_ty,
|
||||
is_negative,
|
||||
is_unsafe,
|
||||
items,
|
||||
generic_params,
|
||||
ast_id: _,
|
||||
} = &self.tree[it];
|
||||
if *is_unsafe {
|
||||
w!(self, "unsafe");
|
||||
}
|
||||
w!(self, "impl");
|
||||
self.print_generic_params(generic_params);
|
||||
w!(self, " ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue