diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-04-02 18:59:17 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2024-04-02 18:59:17 +0200 |
| commit | 70b4ace09d5b1033c751654b9bbe714eeb4d5b4d (patch) | |
| tree | a494e3b99d297a21dde6e3d7c63b9e59029b2a3f /tests/rustdoc-ui | |
| parent | 5dbaafdb9305df5332157e74eaaa55c615aa489f (diff) | |
| download | rust-70b4ace09d5b1033c751654b9bbe714eeb4d5b4d.tar.gz rust-70b4ace09d5b1033c751654b9bbe714eeb4d5b4d.zip | |
rustdoc: synthetic auto trait impls: accept unresolved region vars for now
Diffstat (limited to 'tests/rustdoc-ui')
| -rw-r--r-- | tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl-normalize.rs | 17 | ||||
| -rw-r--r-- | tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl.rs | 11 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl-normalize.rs b/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl-normalize.rs new file mode 100644 index 00000000000..1b67c2bc875 --- /dev/null +++ b/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl-normalize.rs @@ -0,0 +1,17 @@ +// We used to ICE here while trying to synthesize auto trait impls. +// issue: 112242 +//@ check-pass +//@ compile-flags: -Znormalize-docs + +pub trait MyTrait<'a> { + type MyItem; +} +pub struct Inner<Q>(Q); +pub struct Outer<Q>(Inner<Q>); + +impl<'a, Q> std::marker::Unpin for Inner<Q> +where + Q: MyTrait<'a>, + <Q as MyTrait<'a>>::MyItem: Copy, +{ +} diff --git a/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl.rs b/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl.rs new file mode 100644 index 00000000000..31d1b11ff31 --- /dev/null +++ b/tests/rustdoc-ui/synthetic-auto-trait-impls/lifetime-generic-user-impl.rs @@ -0,0 +1,11 @@ +// We used to ICE here while trying to synthesize auto trait impls. +// issue: 123370 +//@ check-pass + +pub struct Inner<'a, Q>(&'a (), Q); + +pub struct Outer<'a, Q>(Inner<'a, Q>); + +impl<'a, Q: Trait<'a>> std::marker::Unpin for Inner<'static, Q> {} + +pub trait Trait<'a> {} |
