mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
normalize if-eq bounds before testing
Hat-tip: aliemjay
This commit is contained in:
parent
e6b630c5b1
commit
c3137d9e8c
@ -823,10 +823,11 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||
) -> bool {
|
||||
match bound {
|
||||
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(
|
||||
self.tcx(),
|
||||
self.param_env,
|
||||
verify_if_eq_b,
|
||||
&verify_if_eq_b,
|
||||
generic_ty,
|
||||
) {
|
||||
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…
Reference in New Issue
Block a user