-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #75205 - Aaron1011:fix/auto-trait-proj-ice, r=nikomatsakis
Handle projection predicates in the param env for auto-trait docs Fixes #72213 Any predicates in the param env are guaranteed to hold, so we don't need to do any additional processing of them if we come across them as sub-obligations of a different predicate. This allows us to avoid adding the same predicate to the computed ParamEnv multiple times (but with different regions each time), which causes an ambiguity error during fulfillment.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/test/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Regression test for issue #72213 | ||
// Tests that we don't ICE when we have projection predicates | ||
// in our initial ParamEnv | ||
|
||
pub struct Lines<'a, L> | ||
where | ||
L: Iterator<Item = &'a ()>, | ||
{ | ||
words: std::iter::Peekable<Words<'a, L>>, | ||
} | ||
|
||
pub struct Words<'a, L> { | ||
_m: std::marker::PhantomData<&'a L>, | ||
} | ||
|
||
impl<'a, L> Iterator for Words<'a, L> | ||
where | ||
L: Iterator<Item = &'a ()>, | ||
{ | ||
type Item = (); | ||
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
unimplemented!() | ||
} | ||
} |