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

Commit 37132b0

Browse files
authored
Merge pull request #1138 from matthiaskrgr/ices_feb18
add more (rustdoc) ices
2 parents 8da5a79 + 6b3e902 commit 37132b0

File tree

6 files changed

+101
-0
lines changed

6 files changed

+101
-0
lines changed

ices/79461.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
trait IAmATrait {
6+
type Item;
7+
fn function(&self) -> Self::Item;
8+
}
9+
10+
struct IAmAnObject(usize);
11+
12+
impl IAmATrait for IAmAnObject {
13+
type Item = _;
14+
fn function(&self) -> Self::Item {
15+
self.0
16+
}
17+
}
18+
19+
fn main() {}
20+
21+
EOF
22+
23+
rustdoc --edition=2021 out.rs

ices/79466.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
#![allow(dead_code)]
5+
#![feature(negative_impls)]
6+
7+
// Overlapping negative impls for `MyStruct` are not permitted:
8+
struct MyStruct;
9+
impl !Send for MyStruct {}
10+
impl !Send for MyStruct {}
11+
//~^ ERROR conflicting implementations of trait
12+
13+
fn main() {}
14+
15+
EOF
16+
17+
rustdoc --edition=2021 out.rs

ices/79468.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
const HUGE_SIZE: usize = !0usize / 8;
5+
static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
6+
7+
EOF
8+
9+
rustdoc --edition=2021 out.rs

ices/79494.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
const ZST1: &[u8] = unsafe { std::mem::transmute(1usize) };
6+
pub const ZST2: u8 = std::mem::transmute(1usize);
7+
8+
EOF
9+
10+
rustdoc --edition=2021 out.rs

ices/79496.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
#![crate_type="proc-macro"]
6+
7+
extern crate proc_macro;
8+
use proc_macro::TokenStream;
9+
10+
#[proc_macro_derive()]
11+
pub fn some_derive(_: TokenStream) -> TokenStream {
12+
TokenStream::new()
13+
}
14+
15+
16+
EOF
17+
18+
rustdoc --edition=2021 out.rs

ices/94073.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
rustc --emit=mir -Zmir-opt-level=3 - 2>&1 << EOF
2+
3+
use std::mem;
4+
5+
#[derive(Copy, Clone)]
6+
enum Never {}
7+
8+
union Foo {
9+
a: u64,
10+
b: Never
11+
}
12+
13+
fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }
14+
15+
fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }
16+
17+
fn main() {
18+
println!("{}", mem::size_of::<Foo>());
19+
20+
let f = [Foo { a: 42 }, Foo { a: 10 }];
21+
println!("{:?}", unsafe { f[0].a });
22+
}
23+
24+
EOF

0 commit comments

Comments
 (0)