Rollup merge of #81496 - guswynn:expected_async_block, r=oli-obk
name async generators something more human friendly in type error diagnostic fixes #81457 Some details: 1. I opted to load the generator kind from the hir in TyCategory. I also use 1 impl in the hir for the descr 2. I named both the source of the future, in addition to the general type (`future`), not sure what is preferred 3. I am not sure what is required to make sure "generator" is not referred to anywhere. A brief `rg "\"generator\"" showed me that most diagnostics correctly distinguish from generators and async generator, but the `descr` of `DefKind` is pretty general (not sure how thats used) 4. should the descr impl of AsyncGeneratorKind use its display impl instead of copying the string?
This commit is contained in:
commit
f468fd1d23
8 changed files with 104 additions and 17 deletions
|
@ -390,7 +390,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
"no {} named `{}` found for {} `{}` in the current scope",
|
||||
item_kind,
|
||||
item_name,
|
||||
actual.prefix_string(),
|
||||
actual.prefix_string(self.tcx),
|
||||
ty_str,
|
||||
);
|
||||
if let Mode::MethodCall = mode {
|
||||
|
@ -732,7 +732,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
.map(|(_, path)| path)
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
let actual_prefix = actual.prefix_string();
|
||||
let actual_prefix = actual.prefix_string(self.tcx);
|
||||
err.set_primary_message(&format!(
|
||||
"the {item_kind} `{item_name}` exists for {actual_prefix} `{ty_str}`, but its trait bounds were not satisfied"
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue