This repository was archived by the owner on May 23, 2024. It is now read-only.
File tree 8 files changed +92
-0
lines changed
8 files changed +92
-0
lines changed Original file line number Diff line number Diff line change
1
+ pub trait MyComponent {
2
+ type Properties ;
3
+ }
4
+
5
+ impl < M > MyComponent for M
6
+ where
7
+ M : ' static ,
8
+ {
9
+ type Properties = ( ) ;
10
+ }
11
+
12
+ fn main ( ) {
13
+ |_: <& u8 as MyComponent >:: Properties | { } ;
14
+ }
Original file line number Diff line number Diff line change
1
+ pub trait MyComponent {
2
+ type Properties ;
3
+ }
4
+
5
+ impl < M > MyComponent for M
6
+ where
7
+ M : ' static ,
8
+ {
9
+ type Properties = TableProps < M > ;
10
+ }
11
+
12
+ pub struct TableProps < M >
13
+ where
14
+ M : ' static ,
15
+ {
16
+ pub entries : M ,
17
+ }
18
+
19
+ fn main ( ) {
20
+ |_: <& u32 as MyComponent >:: Properties | { } ;
21
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat > out.rs << 'EOF '
4
+
5
+ pub use std::*;
6
+
7
+ pub mod task {}
8
+
9
+ pub fn main() {
10
+ println!("Hello, world!");
11
+ }
12
+
13
+ EOF
14
+
15
+ rustdoc out.rs
Original file line number Diff line number Diff line change
1
+ pub fn test ( ) {
2
+ #[ doc( alias = "test" ) ]
3
+ let num_flags = 0 ;
4
+ }
Original file line number Diff line number Diff line change
1
+ pub fn test ( ) {
2
+ #[ doc( alias = "test" ) ]
3
+ let num_flags = 0 ;
4
+ }
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ match ( ) {
3
+ #[ doc( alias = "foo" ) ]
4
+ _ => { }
5
+ }
6
+ }
Original file line number Diff line number Diff line change
1
+ #![ feature( const_trait_impl) ]
2
+ #![ feature( fn_traits) ]
3
+ #![ feature( unboxed_closures) ]
4
+
5
+ struct Closure ;
6
+
7
+ impl const FnOnce < & usize > for Closure {
8
+ type Output = usize ;
9
+
10
+ extern "rust-call" fn call_once ( self , arg : & usize ) -> Self :: Output {
11
+ * arg
12
+ }
13
+ }
14
+
15
+ enum Bug < T = [ ( ) ; Closure . call_once ( & 0 ) ] > {
16
+ V ( T ) ,
17
+ }
18
+
19
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ fn get_iter ( vec : & [ i32 ] ) -> impl Iterator < Item = { } > + ' _ {
2
+ vec. iter ( )
3
+ }
4
+
5
+ fn main ( ) {
6
+ let vec = Vec :: new ( ) ;
7
+ let mut iter = get_iter ( & vec) ;
8
+ iter. next ( ) ;
9
+ }
You can’t perform that action at this time.
0 commit comments