This repository was archived by the owner on May 23, 2024. It is now read-only.
File tree 3 files changed +75
-0
lines changed
3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ rustc --edition=2021 - << EOF
4
+
5
+ pub enum Request {
6
+ Resolve {
7
+ url: String,
8
+ },
9
+ }
10
+
11
+ pub async fn handle_event(
12
+ event: Request,
13
+ ) {
14
+ async move {
15
+ let Request::Resolve { url } = event;
16
+ }.await;
17
+ }
18
+
19
+ pub fn main() {}
20
+
21
+ EOF
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ rustc --edition=2021 - << EOF
4
+
5
+ pub enum Request {
6
+ Resolve { url: String },
7
+ }
8
+
9
+ pub fn handle_event(event: Request) {
10
+ (move || {
11
+ let Request::Resolve { url: _url } = event;
12
+ })();
13
+ }
14
+
15
+ pub fn main() {}
16
+
17
+ EOF
Original file line number Diff line number Diff line change
1
+ use std:: ops:: Deref ;
2
+
3
+ trait MyTrait : Deref < Target = u32 > { }
4
+
5
+ struct MyStruct ( u32 ) ;
6
+
7
+ impl MyTrait for MyStruct { }
8
+
9
+ impl Deref for MyStruct {
10
+ type Target = u32 ;
11
+
12
+ fn deref ( & self ) -> & Self :: Target {
13
+ & self . 0
14
+ }
15
+ }
16
+
17
+ fn get_concrete_value ( i : u32 ) -> MyStruct {
18
+ MyStruct ( i)
19
+ }
20
+
21
+ fn get_boxed_value ( i : u32 ) -> Box < dyn MyTrait > {
22
+ Box :: new ( get_concrete_value ( i) )
23
+ }
24
+
25
+ fn main ( ) {
26
+ let v = [ 1 , 2 , 3 ]
27
+ . iter ( )
28
+ . map ( |i| get_boxed_value ( * i) )
29
+ . collect :: < Vec < _ > > ( ) ;
30
+
31
+ let el = & v[ 0 ] ;
32
+
33
+ for _ in v {
34
+ // this triggers bug
35
+ println ! ( "{}" , * * * el > 0 ) ;
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments