forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#137972 - BoxyUwU:ty_const_wf_before_eval, r=<…
…try> Ensure constants are WF before calling into CTFE Fixes rust-lang#127643 Fixes rust-lang#131046 Fixes rust-lang#131406 Fixes rust-lang#133066 I'll write a PR desc for this tommorow r? `@ghost`
- Loading branch information
Showing
22 changed files
with
544 additions
and
169 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
tests/ui/const-generics/associated_const_equality/wf_before_evaluate-2.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,20 @@ | ||
#![feature(associated_const_equality)] | ||
|
||
trait Owner<K> { | ||
const C: K; | ||
} | ||
impl<K: ConstDefault> Owner<K> for () { | ||
const C: K = K::DEFAULT; | ||
} | ||
|
||
trait ConstDefault { | ||
const DEFAULT: Self; | ||
} | ||
|
||
fn user() -> impl Owner<dyn Sized, C = 0> {} | ||
//~^ ERROR: the trait bound `(dyn Sized + 'static): ConstDefault` is not satisfied | ||
//~| ERROR: the size for values of type `(dyn Sized + 'static)` cannot be known at compilation time | ||
//~| ERROR: the trait `Sized` is not dyn compatible | ||
//~| ERROR: mismatched types | ||
|
||
fn main() {} |
Oops, something went wrong.