Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 2ced9fb

Browse files
authored
Merge pull request #1375 from matthiaskrgr/the_return_of_the_ice
add 6 ices
2 parents dfb66fc + cdf82aa commit 2ced9fb

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

ices/100075.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
trait Marker {}
2+
impl<T> Marker for T {}
3+
4+
fn maybe<T>(_t: T) ->
5+
Option<
6+
//removing the line below makes it compile
7+
&'static
8+
T> {
9+
None
10+
}
11+
12+
fn _g<T>(t: &'static T) -> &'static impl Marker {
13+
if let Some(t) = maybe(t) {
14+
return _g(t);
15+
}
16+
todo!()
17+
}
18+
19+
pub fn main() {}

ices/100103.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(let_else)]
2+
fn main() {
3+
let Some(x) = Some(()) else {
4+
match Err(()) {
5+
Err(()) => return (),
6+
Ok(val) => val,
7+
}
8+
};
9+
}

ices/100114.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![allow(warnings)]
2+
#![feature(never_type)]
3+
#![allow(const_err)]
4+
5+
use std::mem::MaybeUninit;
6+
7+
const fn never() -> ! {
8+
unsafe { MaybeUninit::uninit().assume_init() }
9+
}
10+
11+
const NEVER: ! = never();
12+
13+
fn main() {}

ices/100143.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
// struct Peekable<I: Iterator>
6+
use std::iter::Peekable;
7+
8+
pub struct Span<F: Fn(&i32)> {
9+
inner: Peekable<ConditionalIterator<F>>,
10+
}
11+
12+
struct ConditionalIterator<F> {
13+
f: F,
14+
}
15+
16+
impl<F: Fn(&i32)> Iterator for ConditionalIterator<F> {
17+
type Item = ();
18+
19+
fn next(&mut self) -> Option<Self::Item> {
20+
todo!()
21+
}
22+
}
23+
24+
EOF
25+
26+
rustdoc --edition=2021 out.rs
27+

ices/100183.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
struct Struct {
2+
y: (typeof("hey"),),
3+
}
4+
5+
pub fn main() {}

ices/100187.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
rustc "-Zsave-analysis" - <<'EOF'
4+
5+
trait Pattern<'a> {}
6+
7+
async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {}
8+
9+
EOF
10+

0 commit comments

Comments
 (0)