mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 10:04:23 +00:00
Auto merge of #14312 - HKalbasi:master, r=lnicola
Revert #14285 fix #14305
This commit is contained in:
commit
1b5bba4535
@ -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,
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
@ -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<_>
|
||||
}
|
||||
"#,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user