diff options
| author | bors <bors@rust-lang.org> | 2023-04-16 21:37:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-16 21:37:51 +0000 |
| commit | 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc (patch) | |
| tree | 45864520870b60ee1bb662685becc5f0b4804744 /tests/ui/mir | |
| parent | f18236dcd3d8191c91aca0c4ef43e1e27b6bc0dc (diff) | |
| parent | c2c413f56eca868a5b5335ba21efa08368735d01 (diff) | |
| download | rust-1.69.0.tar.gz rust-1.69.0.zip | |
Auto merge of #110413 - pietroalbini:pa-1.69.0-stable, r=pietroalbini 1.69.0
[stable] Prepare Rust 1.69.0 Last minute backports: * #109643 * #110135 * #109938 * #109937 * #109266 This PR also bumps the channel to stable, and backports the release notes from master. r? `@ghost` cc `@rust-lang/release`
Diffstat (limited to 'tests/ui/mir')
| -rw-r--r-- | tests/ui/mir/issue-109743.rs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/ui/mir/issue-109743.rs b/tests/ui/mir/issue-109743.rs new file mode 100644 index 00000000000..73f3405e3ad --- /dev/null +++ b/tests/ui/mir/issue-109743.rs @@ -0,0 +1,51 @@ +// build-pass +// compile-flags: --crate-type=lib + +use std::marker::PhantomData; + +pub trait StreamOnce { + type Token; +} + +impl StreamOnce for &str { + type Token = (); +} + +pub trait Parser<Input: StreamOnce> { + type PartialState: Default; + fn parse_mode(&self, _state: &Self::PartialState) {} + fn parse_mode_impl() {} +} + +pub fn parse_bool<'a>() -> impl Parser<&'a str> { + pub struct TokensCmp<C, Input> + where + Input: StreamOnce, + { + _cmp: C, + _marker: PhantomData<Input>, + } + + impl<Input, C> Parser<Input> for TokensCmp<C, Input> + where + C: FnMut(Input::Token), + Input: StreamOnce, + { + type PartialState = (); + } + + TokensCmp { _cmp: |_| (), _marker: PhantomData } +} + +pub struct ParseBool; + +impl<'a> Parser<&'a str> for ParseBool +where + &'a str: StreamOnce, +{ + type PartialState = (); + + fn parse_mode_impl() { + parse_bool().parse_mode(&Default::default()) + } +} |
