diff options
| -rw-r--r-- | crates/hir-ty/src/consteval.rs | 1 | ||||
| -rw-r--r-- | crates/hir-ty/src/tests/regression.rs | 12 | ||||
| -rw-r--r-- | crates/hir-ty/src/tests/simple.rs | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/crates/hir-ty/src/consteval.rs b/crates/hir-ty/src/consteval.rs index 2762bdc6ca8..5830c48988f 100644 --- a/crates/hir-ty/src/consteval.rs +++ b/crates/hir-ty/src/consteval.rs @@ -100,7 +100,6 @@ pub(crate) fn path_to_const( }; Some(ConstData { ty, value }.intern(Interner)) } - Some(ValueNs::ConstId(c)) => db.const_eval(c).ok(), _ => None, } } diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index 2fa6234da1e..e6b4f13c8d1 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -1744,3 +1744,15 @@ fn foo(b: Bar) { "#, ); } + +#[test] +fn regression_14305() { + check_no_mismatches( + r#" +//- minicore: add +trait Tr {} +impl Tr for [u8; C] {} +const C: usize = 2 + 2; +"#, + ); +} diff --git a/crates/hir-ty/src/tests/simple.rs b/crates/hir-ty/src/tests/simple.rs index 1648396eb1a..0e9c349afef 100644 --- a/crates/hir-ty/src/tests/simple.rs +++ b/crates/hir-ty/src/tests/simple.rs @@ -3277,13 +3277,14 @@ fn func() { #[test] fn issue_14275() { + // FIXME: evaluate const generic check_types( r#" struct Foo<const T: bool>; fn main() { const B: bool = false; let foo = Foo::<B>; - //^^^ Foo<false> + //^^^ Foo<_> } "#, ); |
