diff options
Diffstat (limited to 'src/test/rustdoc-ui/recursive-deref-ice.rs')
-rw-r--r-- | src/test/rustdoc-ui/recursive-deref-ice.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/recursive-deref-ice.rs b/src/test/rustdoc-ui/recursive-deref-ice.rs new file mode 100644 index 000000000..c44fd27f4 --- /dev/null +++ b/src/test/rustdoc-ui/recursive-deref-ice.rs @@ -0,0 +1,19 @@ +// check-pass + +// ICE found in https://github.com/rust-lang/rust/issues/83123 + +pub struct Attribute; + +pub struct Map<'hir> {} +impl<'hir> Map<'hir> { + pub fn attrs(&self) -> &'hir [Attribute] { &[] } +} + +pub struct List<T>(T); + +impl<T> std::ops::Deref for List<T> { + type Target = [T]; + fn deref(&self) -> &[T] { + &[] + } +} |