This repository was archived by the owner on May 23, 2024. It is now read-only.
File tree 8 files changed +99
-0
lines changed
8 files changed +99
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat > out.rs << EOF
4
+ #![feature(no_core)]
5
+ #![no_core]
6
+
7
+ #[doc(primitive = "usize")]
8
+ /// This is the built-in type ` usize` .
9
+ mod usize {
10
+ }
11
+ EOF
12
+
13
+ rustdoc --document-private-items -Zunstable-options --output-format=json out.rs
Original file line number Diff line number Diff line change
1
+ #![ feature( inline_const) ]
2
+ #![ feature( generic_const_exprs) ]
3
+ #![ allow( incomplete_features) ]
4
+
5
+ use std:: mem;
6
+
7
+ pub union AsBytes < T > {
8
+ pub value : mem:: ManuallyDrop < T > ,
9
+ pub as_bytes : [ u8 ; const { mem:: size_of :: < T > ( ) } ] ,
10
+ }
11
+
12
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ #![ feature( type_alias_impl_trait) ]
2
+
3
+ type Tait < ' b > = impl Sized ;
4
+
5
+ fn foo ( f : & dyn Fn ( Tait ) ) { }
6
+
7
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ #![ feature( type_alias_impl_trait) ]
2
+ #![ feature( specialization) ]
3
+ #![ allow( incomplete_features, dead_code) ]
4
+
5
+ trait OpaqueTrait { }
6
+ impl < T > OpaqueTrait for T { }
7
+ type OpaqueType = impl OpaqueTrait ;
8
+ fn mk_opaque ( ) -> OpaqueType {
9
+ || 0
10
+ }
11
+ trait AnotherTrait { }
12
+ impl < T : Send > AnotherTrait for T { }
13
+ impl AnotherTrait for OpaqueType { }
14
+
15
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ #![ feature( associated_type_bounds) ]
2
+
3
+ struct Bug < T : ?Sized > ( T ) ;
4
+
5
+ impl Bug < dyn Iterator < Item : Copy > > { }
6
+
7
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ cat > out.rs << EOF
4
+ trait X {
5
+ type Y<'a>;
6
+ }
7
+
8
+ const _: () = {
9
+ fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
10
+ //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
11
+ //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
12
+ };
13
+
14
+ fn main() {}
15
+ EOF
16
+
17
+ rustdoc out.rs
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ rustc -Zmir-opt-level=3 --crate-type=lib - << 'EOF '
4
+ pub trait A {
5
+ type B;
6
+ }
7
+
8
+ pub struct S<T: A>(T::B);
9
+
10
+ pub fn foo<T: A>(p: *mut S<T>) {
11
+ unsafe { core::ptr::drop_in_place(p) };
12
+ }
13
+
14
+ EOF
Original file line number Diff line number Diff line change
1
+ #![ feature( generic_const_exprs) ]
2
+ #![ allow( incomplete_features) ]
3
+
4
+ const DEFAULT : u32 = 1 ;
5
+
6
+ struct V < const U : usize = DEFAULT >
7
+ where
8
+ [ ( ) ; U ] : ;
9
+
10
+ trait Tr { }
11
+
12
+ impl Tr for V { }
13
+
14
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments