-
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.
Implement ~const Fn trait goals in the new solver
- Loading branch information
1 parent
d8ea700
commit 76614e4
Showing
7 changed files
with
164 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//@ aux-build:minicore.rs | ||
//@ compile-flags: --crate-type=lib -Znext-solver | ||
|
||
#![feature(no_core, const_trait_impl, effects)] | ||
//~^ WARN the feature `effects` is incomplete | ||
#![no_std] | ||
#![no_core] | ||
|
||
extern crate minicore; | ||
use minicore::*; | ||
|
||
const fn call_indirect<T: ~const Fn()>(t: &T) { t() } | ||
|
||
#[const_trait] | ||
trait Foo {} | ||
impl Foo for () {} | ||
const fn foo<T: ~const Foo>() {} | ||
|
||
const fn test() { | ||
call_indirect(&foo::<()>); | ||
//~^ ERROR the trait bound `(): ~const Foo` is not satisfied | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr
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 @@ | ||
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/minicore-fn-fail.rs:4:39 | ||
| | ||
LL | #![feature(no_core, const_trait_impl, effects)] | ||
| ^^^^^^^ | ||
| | ||
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0277]: the trait bound `(): ~const Foo` is not satisfied | ||
--> $DIR/minicore-fn-fail.rs:20:5 | ||
| | ||
LL | call_indirect(&foo::<()>); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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