Skip to content

Commit 711adc4

Browse files
committed
Fix impl trait in anon const resolution
1 parent 69d855c commit 711adc4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ impl<'hir> Map<'hir> {
697697
| Node::ForeignItem(ForeignItem { kind: ForeignItemKind::Fn(..), .. })
698698
| Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(..), .. })
699699
| Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(..), .. })
700+
| Node::AnonConst(..)
700701
| Node::Block(_) = node
701702
{
702703
return Some(hir_id);

src/test/ui/impl-trait/issues/issue-78722.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//~^ WARN the feature `impl_trait_in_bindings` is incomplete
66

77
type F = impl core::future::Future<Output = u8>;
8+
//~^ ERROR type mismatch
89

910
struct Bug {
1011
V1: [(); {

src/test/ui/impl-trait/issues/issue-78722.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ LL | type F = impl core::future::Future<Output = u8>;
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `u8`
1515

1616
error: `async` blocks are not allowed in constants
17-
--> $DIR/issue-78722.rs:14:20
17+
--> $DIR/issue-78722.rs:15:20
1818
|
1919
LL | let f: F = async { 1 };
2020
| ^^^^^^^^^^^
2121

2222
error[E0493]: destructors cannot be evaluated at compile-time
23-
--> $DIR/issue-78722.rs:14:13
23+
--> $DIR/issue-78722.rs:15:13
2424
|
2525
LL | let f: F = async { 1 };
2626
| ^ constants cannot evaluate destructors

0 commit comments

Comments
 (0)