This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1484 from JohnTitor/add-ices-20230109
- Loading branch information
Showing
8 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs << EOF | ||
#![feature(no_core)] | ||
#![no_core] | ||
#[doc(primitive = "usize")] | ||
/// This is the built-in type `usize`. | ||
mod usize { | ||
} | ||
EOF | ||
|
||
rustdoc --document-private-items -Zunstable-options --output-format=json out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(inline_const)] | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::mem; | ||
|
||
pub union AsBytes<T> { | ||
pub value: mem::ManuallyDrop<T>, | ||
pub as_bytes: [u8; const { mem::size_of::<T>() }], | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![feature(type_alias_impl_trait)] | ||
|
||
type Tait<'b> = impl Sized; | ||
|
||
fn foo(f: &dyn Fn(Tait)) {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![feature(type_alias_impl_trait)] | ||
#![feature(specialization)] | ||
#![allow(incomplete_features, dead_code)] | ||
|
||
trait OpaqueTrait {} | ||
impl<T> OpaqueTrait for T {} | ||
type OpaqueType = impl OpaqueTrait; | ||
fn mk_opaque() -> OpaqueType { | ||
|| 0 | ||
} | ||
trait AnotherTrait {} | ||
impl<T: Send> AnotherTrait for T {} | ||
impl AnotherTrait for OpaqueType {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![feature(associated_type_bounds)] | ||
|
||
struct Bug<T: ?Sized>(T); | ||
|
||
impl Bug<dyn Iterator<Item: Copy>> {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
cat > out.rs << EOF | ||
trait X { | ||
type Y<'a>; | ||
} | ||
const _: () = { | ||
fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {} | ||
//~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments | ||
//~| ERROR this associated type takes 0 generic arguments but 1 generic argument | ||
}; | ||
fn main() {} | ||
EOF | ||
|
||
rustdoc out.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zmir-opt-level=3 --crate-type=lib - <<'EOF' | ||
pub trait A { | ||
type B; | ||
} | ||
pub struct S<T: A>(T::B); | ||
pub fn foo<T: A>(p: *mut S<T>) { | ||
unsafe { core::ptr::drop_in_place(p) }; | ||
} | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
const DEFAULT: u32 = 1; | ||
|
||
struct V<const U: usize = DEFAULT> | ||
where | ||
[(); U]:; | ||
|
||
trait Tr {} | ||
|
||
impl Tr for V {} | ||
|
||
fn main() {} |