-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #74894 - JohnTitor:rollup-4ine62a, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #74266 (Clean up E0720 explanation) - #74671 (add const generics array coercion test) - #74707 (Add str::[r]split_once) - #74814 (Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy) - #74859 (Update outdated readme) - #74864 (ayu theme: Change doccomment color to `#a1ac88`) - #74872 (Enable to ping RISC-V group via triagebot) - #74891 (handle ConstEquate in rustdoc) Failed merges: r? @ghost
- Loading branch information
Showing
11 changed files
with
149 additions
and
8 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
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
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
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
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
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
An `impl Trait` type expands to a recursive type. | ||
|
||
An `impl Trait` type must be expandable to a concrete type that contains no | ||
`impl Trait` types. For example the following example tries to create an | ||
`impl Trait` type `T` that is equal to `[T, T]`: | ||
Erroneous code example: | ||
|
||
```compile_fail,E0720 | ||
fn make_recursive_type() -> impl Sized { | ||
[make_recursive_type(), make_recursive_type()] | ||
} | ||
``` | ||
|
||
An `impl Trait` type must be expandable to a concrete type that contains no | ||
`impl Trait` types. For example the previous example tries to create an | ||
`impl Trait` type `T` that is equal to `[T, T]`. |
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
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
18 changes: 18 additions & 0 deletions
18
src/test/rustdoc/lazy_normalization_consts/const-equate-pred.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,18 @@ | ||
#![crate_name = "foo"] | ||
#![feature(lazy_normalization_consts)] | ||
#![allow(incomplete_features)] | ||
|
||
// Checking if `Send` is implemented for `Hasher` requires us to evaluate a `ConstEquate` predicate, | ||
// which previously caused an ICE. | ||
|
||
pub struct Hasher<T> { | ||
cv_stack: T, | ||
} | ||
|
||
unsafe impl<T: Default> Send for Hasher<T> {} | ||
|
||
// @has foo/struct.Foo.html | ||
// @has - '//code' 'impl Send for Foo' | ||
pub struct Foo { | ||
hasher: Hasher<[u8; 3]>, | ||
} |
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,11 @@ | ||
// run-pass | ||
#![feature(const_generics)] | ||
#![allow(incomplete_features)] | ||
|
||
fn foo<const N: usize>(v: &[u8; N]) -> &[u8] { | ||
v | ||
} | ||
|
||
fn main() { | ||
assert_eq!(foo(&[1, 2]), &[1, 2]); | ||
} |
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