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

Add some ICEs #670

Merged
merged 6 commits into from
Feb 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ices/77708.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

rustc --edition 2018 -C incremental=foo --crate-type lib - <<'EOF'
#![feature(const_generics, const_evaluatable_checked)]
#![allow(incomplete_features)]
use core::{convert::TryFrom, num::NonZeroUsize};

struct A<const N: NonZeroUsize>([u8; N.get()]) where [u8; N.get()]: Sized;

impl<'a, const N: NonZeroUsize> TryFrom<&'a [u8]> for A<N> where [u8; N.get()]: Sized {
type Error = ();
fn try_from(slice: &'a [u8]) -> Result<A<N>, ()> {
let _x = <&[u8; N.get()] as TryFrom<&[u8]>>::try_from(slice);
unimplemented!();
}
}
EOF
25 changes: 25 additions & 0 deletions ices/82418.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![feature(const_generics)]
#![feature(const_evaluatable_checked)]

pub struct Foobar<T, const N: usize> {
t: T,
}

pub trait Footrait {
const N: usize;
}

impl<T> Footrait for T {
const N: usize = 0;
}

pub fn new_foo<T>(t: T) -> Foobar<T, { <T as Footrait>::N }>
where
T: Footrait,
{
Foobar { t }
}

fn main() {
let foo = new_foo(0);
}
8 changes: 8 additions & 0 deletions ices/82438.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn main() {
JohnTitor marked this conversation as resolved.
Show resolved Hide resolved
let inner;
let outer = || {
inner = || {};
inner();
};
outer();
}
11 changes: 11 additions & 0 deletions ices/82455.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn map<T>(_: fn() -> Option<&'static T>) -> Option<T> {
None
}

fn value() -> Option<&'static _> {
Option::<&'static u8>::None
}

const _: Option<_> = {
let _: Option<_> = map(value);
};
17 changes: 17 additions & 0 deletions ices/82504.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![crate_type = "lib"]
#![feature(decl_macro)]

pub mod module {
mod private {
__helper__! { [$] recurse }

macro __helper__ ([$dol:tt] $exported_name:ident) {
macro_rules! $exported_name {() => ()}
pub(crate) use $exported_name;
}
// pub(crate) use recurse;
}
pub(super) use private::recurse;
}

module::recurse!();