diff --git a/ices/77696.rs b/ices/77696.rs new file mode 100644 index 00000000..f9b8290a --- /dev/null +++ b/ices/77696.rs @@ -0,0 +1,10 @@ +#![feature(impl_trait_in_bindings)] + +struct S; +trait Trait { + fn demo(&self) {} +} +impl Trait for S {} +fn main() { + let a: &impl Trait = &S; +} diff --git a/ices/77910.rs b/ices/77910.rs new file mode 100644 index 00000000..52255bc9 --- /dev/null +++ b/ices/77910.rs @@ -0,0 +1,9 @@ +fn foo(s: &i32) -> &i32 { + let xs; + xs +} + +fn main() { + let y; + assert_eq!(foo, y); +} diff --git a/ices/77911.sh b/ices/77911.sh new file mode 100644 index 00000000..5a31eb5f --- /dev/null +++ b/ices/77911.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +rustc -Z mir-opt-level=2 - << EOF +use std::fs::File; +use std::io::{BufRead, BufReader}; + +fn file_lines() -> impl Iterator { + BufReader::new(File::open("data.txt").unwrap()) + .lines() + .map(Result::unwrap) +} + +fn main() { + for _ in file_lines() {} +} + +EOF diff --git a/ices/77919.rs b/ices/77919.rs new file mode 100644 index 00000000..d9f0bf1f --- /dev/null +++ b/ices/77919.rs @@ -0,0 +1,12 @@ +trait TypeVal { + const VAL: T; +} +struct Five; +struct Multiply { + _n: PhantomData, +} +impl TypeVal for Multiply where N: TypeVal {} + +fn main() { + [1; >::VAL]; +}