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

add 5 ices #1402

Merged
merged 1 commit into from
Aug 28, 2022
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
5 changes: 5 additions & 0 deletions fixed/100878.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#![crate_type = "lib"]
pub fn get_u16_from_unaligned_manual(data: [u8; 1]) -> u8 {
data[0] << 8
}

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

rustc --crate-type lib -Zmeta-stats - <<'EOF'

pub fn a() {}

EOF

33 changes: 33 additions & 0 deletions ices/101020.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#![feature(generic_associated_types)]
pub trait LendingIterator {
type Item<'a>
where
Self: 'a;

fn consume<F>(self, _f: F)
where
Self: Sized,
for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
{
}
}

impl<I: LendingIterator + ?Sized> LendingIterator for &mut I {
type Item<'a> = I::Item<'a> where Self: 'a;
}
struct EmptyIter;
impl LendingIterator for EmptyIter {
type Item<'a> = &'a mut () where Self:'a;
}
pub trait FuncInput<'a, F>
where
F: Foo<Self>,
Self: Sized,
{
}
impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
trait Foo<T> {}

fn map_test() {
(&mut EmptyIter).consume(());
}
13 changes: 13 additions & 0 deletions ices/101036.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![feature(generic_const_exprs)]

const fn t<const N: usize>() -> u8 {
N as u8
}

#[repr(u8)]
enum T<const N: u8 = { T::<0>::A as u8 + T::<0>::B as u8 }>
where
[(); N as usize]:
{
A = t::<N>() as u8, B
}
20 changes: 20 additions & 0 deletions ices/101076.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

cat > out.rs <<'EOF'

const _: () = {
#[macro_export]
macro_rules! first_macro {
() => {}
}
mod foo {
#[macro_export]
macro_rules! second_macro {
() => {}
}
}
};

EOF

rustdoc out.rs