Shorten some error invocations.
- `struct_foo` + `emit` -> `foo` - `create_foo` + `emit` -> `emit_foo` I have made recent commits in other PRs that have removed some of these shortcuts for combinations with few uses, e.g. `struct_span_err_with_code`. But for the remaining combinations that have high levels of use, we might as well use them wherever possible.
This commit is contained in:
parent
4864cb8aef
commit
ff40ad4107
13 changed files with 30 additions and 34 deletions
|
@ -1371,12 +1371,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
let ImportKind::Glob { id, is_prelude, .. } = import.kind else { unreachable!() };
|
||||
|
||||
let ModuleOrUniformRoot::Module(module) = import.imported_module.get().unwrap() else {
|
||||
self.dcx().create_err(CannotGlobImportAllCrates { span: import.span }).emit();
|
||||
self.dcx().emit_err(CannotGlobImportAllCrates { span: import.span });
|
||||
return;
|
||||
};
|
||||
|
||||
if module.is_trait() {
|
||||
self.dcx().create_err(ItemsInTraitsAreNotImportable { span: import.span }).emit();
|
||||
self.dcx().emit_err(ItemsInTraitsAreNotImportable { span: import.span });
|
||||
return;
|
||||
} else if module == import.parent_scope.module {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue