diff options
| author | bors <bors@rust-lang.org> | 2020-08-12 06:42:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-12 06:42:49 +0000 |
| commit | 4745cbe83e0b3299bfe7f7f305b975c3c09f92db (patch) | |
| tree | cb2e5e7bd66527c2b564a6144dda36b7ca4a6c64 /src/test/rustdoc | |
| parent | c94ed5ca91f1363b66970ce2cbd6e2773e3cb1d3 (diff) | |
| parent | ab766f0511fa0a735997b2a442744af71d8e6be0 (diff) | |
| download | rust-4745cbe83e0b3299bfe7f7f305b975c3c09f92db.tar.gz rust-4745cbe83e0b3299bfe7f7f305b975c3c09f92db.zip | |
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.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs b/src/test/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs new file mode 100644 index 00000000000..6f66b8e5563 --- /dev/null +++ b/src/test/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs @@ -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!() + } +} |
