This repository was archived by the owner on May 23, 2024. It is now read-only.
File tree 4 files changed +95
-0
lines changed
4 files changed +95
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ rustc --edition=2021 -Zmir-opt-level=3 -Zvalidate-mir - << EOF
4
+
5
+ #![crate_type = "lib"]
6
+ #![feature(portable_simd)]
7
+
8
+ use std::simd::Simd;
9
+ const N: usize = 8;
10
+
11
+ #[no_mangle]
12
+ // CHECK-LABEL: @wider_reduce_into_iter
13
+ pub fn wider_reduce_into_iter(x: Simd<u8, N>) -> u16 {
14
+ // CHECK: zext <8 x i8>
15
+ // CHECK-SAME: to <8 x i16>
16
+ // CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16>
17
+ x.to_array().into_iter().map(u16::from).sum()
18
+ }
19
+
20
+ EOF
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat > out.rs << 'EOF '
4
+
5
+ // Issue 22443: Reject code using non-regular types that would
6
+ // otherwise cause dropck to loop infinitely.
7
+
8
+ use std::marker::PhantomData;
9
+
10
+ struct Digit<T> {
11
+ elem: T
12
+ }
13
+
14
+ struct Node<T:'static> { m: PhantomData<&'static T> }
15
+
16
+
17
+ enum FingerTree<T:'static> {
18
+ Single(T),
19
+ // Bug report said Digit after Box would stack overflow (versus
20
+ // Digit before Box; see dropck_no_diverge_on_nonregular_2).
21
+ Deep(
22
+ Box<FingerTree<Node<T>>>,
23
+ Digit<T>,
24
+ )
25
+ }
26
+
27
+ fn main() {
28
+ let ft = //~ ERROR overflow while adding drop-check rules for FingerTree
29
+ FingerTree::Single(1);
30
+ //~^ ERROR overflow while adding drop-check rules for FingerTree
31
+ }
32
+
33
+
34
+ EOF
35
+
36
+ rustdoc out.rs
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat > out.rs << 'EOF '
4
+
5
+ #![feature(type_alias_impl_trait)]
6
+
7
+ type Foo = impl PartialEq<(Foo, i32)>;
8
+
9
+ struct Bar;
10
+
11
+ impl PartialEq<(Foo, i32)> for Bar {
12
+ //~^ ERROR cannot implement trait on type alias impl trait
13
+ fn eq(&self, _other: &(Foo, i32)) -> bool {
14
+ true
15
+ }
16
+ }
17
+
18
+ fn foo() -> Foo {
19
+ Bar
20
+ }
21
+
22
+ fn main() {}
23
+
24
+
25
+ EOF
26
+
27
+ rustdoc out.rs
Original file line number Diff line number Diff line change
1
+ struct Struct < T > ( T ) ;
2
+
3
+ impl < T > Struct < T > {
4
+ const CONST : fn ( ) = || {
5
+ struct _Obligation
6
+ where
7
+ T : ;
8
+ } ;
9
+ }
10
+
11
+ fn main ( ) { }
12
+
You can’t perform that action at this time.
0 commit comments