diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2022-07-27 17:55:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-27 17:55:07 +0200 |
| commit | c37ee1a7e04419bf91a280357bfbb950d99512b3 (patch) | |
| tree | 69357e651fe65c3e40fe9899aad8e06746b399a4 /src/test | |
| parent | a7f4eb995589283d5729e6a99f578da9ab043988 (diff) | |
| parent | 4b2f06b8a91fde63a744c4b297030893d4a92c92 (diff) | |
| download | rust-c37ee1a7e04419bf91a280357bfbb950d99512b3.tar.gz rust-c37ee1a7e04419bf91a280357bfbb950d99512b3.zip | |
Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkov
Clean up HIR-based lifetime resolution Based on https://github.com/rust-lang/rust/pull/97313. Fixes #98932. r? `@petrochenkov`
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/impl-header-lifetime-elision/constant-used-as-arraylen.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/impl-header-lifetime-elision/constant-used-as-arraylen.rs b/src/test/ui/impl-header-lifetime-elision/constant-used-as-arraylen.rs new file mode 100644 index 00000000000..929b82bfc43 --- /dev/null +++ b/src/test/ui/impl-header-lifetime-elision/constant-used-as-arraylen.rs @@ -0,0 +1,24 @@ +// check-pass +// Verify that we do not ICE when anonymous lifetimes appear inside an AnonConst. + +pub struct EntriesBuffer(Box<[[u8; HashesEntry::LEN]; 5]>); + +impl EntriesBuffer { + pub fn iter_child_buffers(&mut self) -> impl Iterator<Item = &mut [u8; HashesEntry::LEN]> { + self.0.iter_mut() + } + + pub fn iter_child_buffers_explicit( + &mut self, + ) -> impl Iterator<Item = &mut [u8; HashesEntry::<'_>::LEN]> { + self.0.iter_mut() + } +} + +pub struct HashesEntry<'a>(&'a [u8]); + +impl HashesEntry<'_> { + pub const LEN: usize = 1; +} + +fn main() {} |
