forked from rust-lang/glacier
-
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.
rust-lang/rust#100075 rust-lang/rust#100103 rust-lang/rust#100114 rust-lang/rust#100143 rust-lang/rust#100183 rust-lang/rust#100187
- Loading branch information
1 parent
dfb66fc
commit cdf82aa
Showing
6 changed files
with
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
trait Marker {} | ||
impl<T> Marker for T {} | ||
|
||
fn maybe<T>(_t: T) -> | ||
Option< | ||
//removing the line below makes it compile | ||
&'static | ||
T> { | ||
None | ||
} | ||
|
||
fn _g<T>(t: &'static T) -> &'static impl Marker { | ||
if let Some(t) = maybe(t) { | ||
return _g(t); | ||
} | ||
todo!() | ||
} | ||
|
||
pub fn main() {} |
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,9 @@ | ||
#![feature(let_else)] | ||
fn main() { | ||
let Some(x) = Some(()) else { | ||
match Err(()) { | ||
Err(()) => return (), | ||
Ok(val) => val, | ||
} | ||
}; | ||
} |
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,13 @@ | ||
#![allow(warnings)] | ||
#![feature(never_type)] | ||
#![allow(const_err)] | ||
|
||
use std::mem::MaybeUninit; | ||
|
||
const fn never() -> ! { | ||
unsafe { MaybeUninit::uninit().assume_init() } | ||
} | ||
|
||
const NEVER: ! = never(); | ||
|
||
fn main() {} |
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,27 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs <<'EOF' | ||
// struct Peekable<I: Iterator> | ||
use std::iter::Peekable; | ||
pub struct Span<F: Fn(&i32)> { | ||
inner: Peekable<ConditionalIterator<F>>, | ||
} | ||
struct ConditionalIterator<F> { | ||
f: F, | ||
} | ||
impl<F: Fn(&i32)> Iterator for ConditionalIterator<F> { | ||
type Item = (); | ||
fn next(&mut self) -> Option<Self::Item> { | ||
todo!() | ||
} | ||
} | ||
EOF | ||
|
||
rustdoc --edition=2021 out.rs | ||
|
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,5 @@ | ||
struct Struct { | ||
y: (typeof("hey"),), | ||
} | ||
|
||
pub fn main() {} |
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,10 @@ | ||
#!/bin/bash | ||
|
||
rustc "-Zsave-analysis" - <<'EOF' | ||
trait Pattern<'a> {} | ||
async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {} | ||
EOF | ||
|