-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #127176 - fee1-dead-contrib:fx-requires-next-solver, r=…
…compiler-errors Make `feature(effects)` require `-Znext-solver` Per #120639 (review) I made this a hard error because otherwise it should be a lint and that seemed more complicated. Not sure if this is the best place to put the error though. r? project-const-traits
- Loading branch information
Showing
121 changed files
with
543 additions
and
428 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//@ known-bug: #119924 | ||
//@ compile-flags: -Znext-solver | ||
#![feature(const_trait_impl, effects)] | ||
|
||
struct S; | ||
|
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
2 changes: 1 addition & 1 deletion
2
tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.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
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,27 @@ | ||
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated` | ||
--> $DIR/issue-88119.rs:21:5 | ||
| | ||
LL | [(); name_len::<T>()]:, | ||
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated` | ||
| | ||
note: required by a bound in `<&T as ConstName>` | ||
--> $DIR/issue-88119.rs:21:10 | ||
| | ||
LL | [(); name_len::<T>()]:, | ||
| ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>` | ||
|
||
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated` | ||
--> $DIR/issue-88119.rs:28:5 | ||
| | ||
LL | [(); name_len::<T>()]:, | ||
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated` | ||
| | ||
note: required by a bound in `<&mut T as ConstName>` | ||
--> $DIR/issue-88119.rs:28:10 | ||
| | ||
LL | [(); name_len::<T>()]:, | ||
| ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0284`. |
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,12 +1,17 @@ | ||
//@ known-bug: #110395 | ||
#![feature(const_type_id)] | ||
#![feature(const_trait_impl, effects)] | ||
//@ check-pass | ||
//@ compile-flags: -Znext-solver | ||
#![feature(const_type_id, const_trait_impl, effects)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::any::TypeId; | ||
|
||
const fn main() { | ||
assert!(TypeId::of::<u8>() == TypeId::of::<u8>()); | ||
assert!(TypeId::of::<()>() != TypeId::of::<u8>()); | ||
const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>(); | ||
// can't assert `_A` because it is not deterministic | ||
fn main() { | ||
const { | ||
// FIXME(effects) this isn't supposed to pass (right now) but it did. | ||
// revisit binops typeck please. | ||
assert!(TypeId::of::<u8>() == TypeId::of::<u8>()); | ||
assert!(TypeId::of::<()>() != TypeId::of::<u8>()); | ||
let _a = TypeId::of::<u8>() < TypeId::of::<u16>(); | ||
// can't assert `_a` because it is not deterministic | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,20 +1,11 @@ | ||
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/rustc-impl-const-stability.rs:5:30 | ||
| | ||
LL | #![feature(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: const `impl` for trait `Default` which is not marked with `#[const_trait]` | ||
--> $DIR/rustc-impl-const-stability.rs:15:12 | ||
--> $DIR/rustc-impl-const-stability.rs:16:12 | ||
| | ||
LL | impl const Default for Data { | ||
| ^^^^^^^ | ||
| | ||
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` | ||
= note: adding a non-const method body in the future would be a breaking change | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
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 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
1 change: 1 addition & 0 deletions
1
tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//@ compile-flags: -Znext-solver | ||
#![allow(incomplete_features)] | ||
#![feature(const_trait_impl, effects)] | ||
|
||
|
4 changes: 3 additions & 1 deletion
4
tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.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
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
Oops, something went wrong.