This commit is contained in:
hkalbasi 2023-03-10 11:57:30 +03:30
parent 14b9d182d5
commit 71e1c025f8
3 changed files with 14 additions and 2 deletions

View file

@ -100,7 +100,6 @@ pub(crate) fn path_to_const(
}; };
Some(ConstData { ty, value }.intern(Interner)) Some(ConstData { ty, value }.intern(Interner))
} }
Some(ValueNs::ConstId(c)) => db.const_eval(c).ok(),
_ => None, _ => None,
} }
} }

View file

@ -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;
"#,
);
}

View file

@ -3277,13 +3277,14 @@ fn func() {
#[test] #[test]
fn issue_14275() { fn issue_14275() {
// FIXME: evaluate const generic
check_types( check_types(
r#" r#"
struct Foo<const T: bool>; struct Foo<const T: bool>;
fn main() { fn main() {
const B: bool = false; const B: bool = false;
let foo = Foo::<B>; let foo = Foo::<B>;
//^^^ Foo<false> //^^^ Foo<_>
} }
"#, "#,
); );