Skip to content

Commit

Permalink
add latest batch of ICEs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jul 17, 2022
1 parent d4afad7 commit cb73b16
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ices/99318.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

rustc -Zunpretty=hir - <<'EOF'
#![feature(let_else)]
pub fn main() {
let Some(x) = &Some(3) else {
panic!();
};
*x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference
}
EOF

13 changes: 13 additions & 0 deletions ices/99319.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

rustc -Zunpretty=hir - <<'EOF'
#![feature(let_else)]
fn main() {
let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
let true = true || false else { return }; //~ ERROR a `||` expression cannot be directly assigned in `let...else`
}
EOF

18 changes: 18 additions & 0 deletions ices/99325.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

rustc -Zunpretty=mir - <<'EOF'
#![feature(adt_const_params)]
#![allow(incomplete_features)]
pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] {
BYTES
}
pub fn main() {
assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA");
}
EOF

10 changes: 10 additions & 0 deletions ices/99331.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

rustc -Zunpretty=expanded - <<'EOF'
extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
fn main() { }
EOF

25 changes: 25 additions & 0 deletions ices/99348.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![feature(type_alias_impl_trait)]

struct Concrete;

type Tait = impl Sized;

impl Foo for Concrete {
type Item = Concrete;
}

impl Bar for Concrete {
type Other = Tait;
}

trait Foo {
type Item: Bar<Other = Self>;
}

trait Bar {
type Other;
}

fn tait() -> Tait {}

pub fn main() {}
19 changes: 19 additions & 0 deletions ices/99363.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

rustc --edition=2021 - <<'EOF'
#![feature(type_alias_impl_trait)]
#[derive(Copy, Clone)]
struct Foo((u32, u32));
fn main() {
type T = impl Copy;
let foo: T = Foo((1u32, 2u32));
let x = move || {
let Foo((a, b)) = foo;
};
}
EOF

0 comments on commit cb73b16

Please sign in to comment.