normalize if-eq bounds before testing
Hat-tip: aliemjay
This commit is contained in:
parent
e6b630c5b1
commit
c3137d9e8c
2 changed files with 39 additions and 1 deletions
|
@ -823,10 +823,11 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
) -> bool {
|
) -> bool {
|
||||||
match bound {
|
match bound {
|
||||||
VerifyBound::IfEq(verify_if_eq_b) => {
|
VerifyBound::IfEq(verify_if_eq_b) => {
|
||||||
|
let verify_if_eq_b = var_values.normalize(self.region_rels.tcx, *verify_if_eq_b);
|
||||||
match test_type_match::extract_verify_if_eq(
|
match test_type_match::extract_verify_if_eq(
|
||||||
self.tcx(),
|
self.tcx(),
|
||||||
self.param_env,
|
self.param_env,
|
||||||
verify_if_eq_b,
|
&verify_if_eq_b,
|
||||||
generic_ty,
|
generic_ty,
|
||||||
) {
|
) {
|
||||||
Some(r) => {
|
Some(r) => {
|
||||||
|
|
37
src/test/ui/nll/vimwiki-core-regression.rs
Normal file
37
src/test/ui/nll/vimwiki-core-regression.rs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// check-pass
|
||||||
|
//
|
||||||
|
// Regression test from crater run for
|
||||||
|
// <https://github.com/rust-lang/rust/pull/98109>.
|
||||||
|
|
||||||
|
|
||||||
|
pub trait ElementLike {}
|
||||||
|
|
||||||
|
pub struct Located<T> where T: ElementLike {
|
||||||
|
inner: T,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BlockElement<'a>(&'a str);
|
||||||
|
|
||||||
|
impl ElementLike for BlockElement<'_> {}
|
||||||
|
|
||||||
|
|
||||||
|
pub struct Page<'a> {
|
||||||
|
/// Comprised of the elements within a page
|
||||||
|
pub elements: Vec<Located<BlockElement<'a>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, __IdxT> std::ops::Index<__IdxT> for Page<'a> where
|
||||||
|
Vec<Located<BlockElement<'a>>>: std::ops::Index<__IdxT>
|
||||||
|
{
|
||||||
|
type Output =
|
||||||
|
<Vec<Located<BlockElement<'a>>> as
|
||||||
|
std::ops::Index<__IdxT>>::Output;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn index(&self, idx: __IdxT) -> &Self::Output {
|
||||||
|
<Vec<Located<BlockElement<'a>>> as
|
||||||
|
std::ops::Index<__IdxT>>::index(&self.elements, idx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue