error: `~const` is not allowed here --> $DIR/tilde-const-and-const-params.rs:25:11 | LL | fn bar(_: Foo) -> Foo<{ A::add(N) }> { | ^^^^^^^^^^^^ | note: this function is not `const`, so it cannot have `~const` trait bounds --> $DIR/tilde-const-and-const-params.rs:25:4 | LL | fn bar(_: Foo) -> Foo<{ A::add(N) }> { | ^^^ error[E0015]: cannot call non-const fn `::add` in constants --> $DIR/tilde-const-and-const-params.rs:25:61 | LL | fn bar(_: Foo) -> Foo<{ A::add(N) }> { | ^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0015`.