forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#102192 - matthiaskrgr:rollup-0ctjzco, r=matth…
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#102094 (Add missing documentation for `bool::from_str`) - rust-lang#102115 (Add examples to `bool::then` and `bool::then_some`) - rust-lang#102134 (Detect panic strategy using `rustc --print cfg`) - rust-lang#102137 (Don't convert valtree to constvalue during normalization) - rust-lang#102148 (add regression test for miri issue 2433) - rust-lang#102158 (rustdoc: clean up CSS/DOM for deprecation warnings) - rust-lang#102177 (Fix a typo in `std`'s root docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#![feature(type_alias_impl_trait)] | ||
|
||
trait T { type Item; } | ||
|
||
type Alias<'a> = impl T<Item = &'a ()>; | ||
|
||
struct S; | ||
impl<'a> T for &'a S { | ||
type Item = &'a (); | ||
} | ||
|
||
fn filter_positive<'a>() -> Alias<'a> { | ||
&S | ||
} | ||
|
||
fn with_positive(fun: impl Fn(Alias<'_>)) { | ||
fun(filter_positive()); | ||
} | ||
|
||
fn main() { | ||
with_positive(|_| ()); | ||
} |