Skip to content

Commit 371597a

Browse files
committed
1 parent 24bd796 commit 371597a

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

ices/97695.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
rustc -Zmir-opt-level=3 --emit=mir - << EOF
4+
5+
pub trait Associate {
6+
type Associated;
7+
}
8+
9+
pub struct Wrap<'a> {
10+
pub field: &'a i32,
11+
}
12+
13+
pub trait Create<T> {
14+
fn create() -> Self;
15+
}
16+
17+
pub fn oh_no<'a, T>()
18+
where
19+
Wrap<'a>: Associate,
20+
<Wrap<'a> as Associate>::Associated: Create<T>,
21+
{
22+
<Wrap<'a> as Associate>::Associated::create();
23+
}
24+
25+
pub fn main() {}
26+
27+
EOF

ices/97698.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use std::ffi::CString;
2+
3+
impl Lock {
4+
pub fn new() {
5+
if () == -1 {
6+
CString::new();
7+
}
8+
}
9+
}

ices/97706.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pub fn compose(
2+
f1: impl FnOnce(f64) -> f64 + Clone,
3+
f2: impl FnOnce(f64) -> f64 + Clone,
4+
) -> impl FnOnce(f64) -> f64 + Clone {
5+
move |x| f1(f2(x))
6+
}
7+
8+
pub fn double(f: impl FnOnce(f64) -> f64 + Clone) -> impl FnOnce(f64) -> f64 + Clone {
9+
compose(f.clone(), f)
10+
}
11+
12+
13+
fn repeat_helper(f: impl FnOnce(f64) -> f64 + Clone, res: impl FnOnce(f64) -> f64 + Clone, times: usize) -> impl FnOnce(f64) -> f64 + Clone {
14+
if times == 1 {
15+
return res;
16+
}
17+
repeat_helper(f.clone(), compose(f, res), times - 1)
18+
}
19+
20+
pub fn repeat(f: impl FnOnce(f64) -> f64 + Clone, times: usize) -> impl FnOnce(f64) -> f64 + Clone {
21+
repeat_helper(f.clone(), f, times)
22+
}
23+
24+
pub fn main() {}

0 commit comments

Comments
 (0)