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

Commit

Permalink
Add ICEs 77696, 77910, 77911, 77919 (#504)
Browse files Browse the repository at this point in the history
* Add ICE 77696

* Add ICE 77919

* Add ICE 77911

* Add ICE 77910

* Add end of file newline
  • Loading branch information
oliviacrain authored Oct 14, 2020
1 parent 64bad42 commit 29ff851
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ices/77696.rs
Original file line number Diff line number Diff line change
@@ -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;
}
9 changes: 9 additions & 0 deletions ices/77910.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fn foo(s: &i32) -> &i32 {
let xs;
xs
}

fn main() {
let y;
assert_eq!(foo, y);
}
17 changes: 17 additions & 0 deletions ices/77911.sh
Original file line number Diff line number Diff line change
@@ -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<Item = String> {
BufReader::new(File::open("data.txt").unwrap())
.lines()
.map(Result::unwrap)
}
fn main() {
for _ in file_lines() {}
}
EOF
12 changes: 12 additions & 0 deletions ices/77919.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
trait TypeVal<T> {
const VAL: T;
}
struct Five;
struct Multiply<N, M> {
_n: PhantomData,
}
impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}

fn main() {
[1; <Multiply<Five, Five>>::VAL];
}

0 comments on commit 29ff851

Please sign in to comment.