resolve from_hir_call FIXME

This commit is contained in:
Ellen 2021-09-07 13:36:50 +01:00
parent 8c7954dc42
commit 3212734bd7
3 changed files with 24 additions and 2 deletions

View file

@ -337,7 +337,6 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
// `<T as Trait>::ASSOC` as well as `12`
&ExprKind::Literal { literal, .. } => self.nodes.push(Node::Leaf(literal)),
// FIXME(generic_const_exprs): Handle `from_hir_call` field
ExprKind::Call { fun, args, .. } => {
let fun = self.recurse_build(*fun)?;

View file

@ -8,4 +8,4 @@ fn foo<const N: u8>(a: [(); N as usize]) {
fn bar<const N: usize>() {}
fn main() {}
fn main() {}

View file

@ -0,0 +1,23 @@
#![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
struct Foo(u8);
impl const std::ops::Add for Foo {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
self
}
}
struct Evaluatable<const N: Foo>;
fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
bar::<{ std::ops::Add::add(N, N) }>();
}
fn bar<const N: Foo>() {}
fn main() {}