Skip to content

Commit

Permalink
add 6 ices
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Aug 6, 2022
1 parent dfb66fc commit cdf82aa
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ices/100075.rs
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() {}
9 changes: 9 additions & 0 deletions ices/100103.rs
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,
}
};
}
13 changes: 13 additions & 0 deletions ices/100114.rs
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() {}
27 changes: 27 additions & 0 deletions ices/100143.sh
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

5 changes: 5 additions & 0 deletions ices/100183.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
struct Struct {
y: (typeof("hey"),),
}

pub fn main() {}
10 changes: 10 additions & 0 deletions ices/100187.sh
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

0 comments on commit cdf82aa

Please sign in to comment.