Skip to content

Commit 3212734

Browse files
committed
resolve from_hir_call FIXME
1 parent 8c7954d commit 3212734

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
337337
// `<T as Trait>::ASSOC` as well as `12`
338338
&ExprKind::Literal { literal, .. } => self.nodes.push(Node::Leaf(literal)),
339339

340-
// FIXME(generic_const_exprs): Handle `from_hir_call` field
341340
ExprKind::Call { fun, args, .. } => {
342341
let fun = self.recurse_build(*fun)?;
343342

src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ fn foo<const N: u8>(a: [(); N as usize]) {
88

99
fn bar<const N: usize>() {}
1010

11-
fn main() {}
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
2+
#![allow(incomplete_features)]
3+
4+
#[derive(PartialEq, Eq)]
5+
struct Foo(u8);
6+
7+
impl const std::ops::Add for Foo {
8+
type Output = Self;
9+
10+
fn add(self, rhs: Self) -> Self::Output {
11+
self
12+
}
13+
}
14+
15+
struct Evaluatable<const N: Foo>;
16+
17+
fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
18+
bar::<{ std::ops::Add::add(N, N) }>();
19+
}
20+
21+
fn bar<const N: Foo>() {}
22+
23+
fn main() {}

0 commit comments

Comments
 (0)