bless ui tests
This commit is contained in:
parent
43dcc9b786
commit
e4f237d39e
35 changed files with 130 additions and 147 deletions
|
@ -1,5 +1,5 @@
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(const_closures, const_trait_impl)]
|
#![feature(const_closures, const_trait_impl, effects)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
pub const fn test() {
|
pub const fn test() {
|
||||||
|
|
|
@ -1,41 +1,24 @@
|
||||||
// compile-flags: -Zmir-opt-level=0
|
// compile-flags: -Zmir-opt-level=0
|
||||||
// known-bug: #110395
|
// run-pass
|
||||||
// FIXME run-pass
|
|
||||||
|
|
||||||
#![feature(const_float_bits_conv)]
|
#![feature(const_float_bits_conv)]
|
||||||
#![feature(const_float_classify)]
|
#![feature(const_float_classify)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
|
|
||||||
// Don't promote
|
// Don't promote
|
||||||
const fn nop<T>(x: T) -> T { x }
|
const fn nop<T>(x: T) -> T { x }
|
||||||
|
|
||||||
// FIXME(const-hack): replace with PartialEq
|
impl const PartialEq<NonDet> for bool {
|
||||||
#[const_trait]
|
fn eq(&self, _: &NonDet) -> bool {
|
||||||
trait MyEq<T> {
|
|
||||||
fn eq(self, b: T) -> bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl const MyEq<bool> for bool {
|
|
||||||
fn eq(self, b: bool) -> bool {
|
|
||||||
self == b
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl const MyEq<NonDet> for bool {
|
|
||||||
fn eq(self, _: NonDet) -> bool {
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn eq<A: ~const MyEq<B>, B>(x: A, y: B) -> bool {
|
|
||||||
x.eq(y)
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! const_assert {
|
macro_rules! const_assert {
|
||||||
($a:expr, $b:expr) => {
|
($a:expr, $b:expr) => {
|
||||||
{
|
{
|
||||||
const _: () = assert!(eq($a, $b));
|
const _: () = assert!($a == $b);
|
||||||
assert!(eq(nop($a), nop($b)));
|
assert!(nop($a) == nop($b));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
error[E0015]: cannot call non-const fn `<A as MyEq<B>>::eq` in constant functions
|
|
||||||
--> $DIR/const-float-classify.rs:31:7
|
|
||||||
|
|
|
||||||
LL | x.eq(y)
|
|
||||||
| ^^^^^
|
|
||||||
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
|
|
@ -10,6 +10,7 @@ note: impl defined here, but it is not `const`
|
||||||
LL | impl const Try for TryMe {
|
LL | impl const Try for TryMe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions
|
error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions
|
||||||
--> $DIR/const-try.rs:33:5
|
--> $DIR/const-try.rs:33:5
|
||||||
|
@ -23,6 +24,7 @@ note: impl defined here, but it is not `const`
|
||||||
LL | impl const FromResidual<Error> for TryMe {
|
LL | impl const FromResidual<Error> for TryMe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// known-bug: #110395
|
// known-bug: #110395
|
||||||
#![feature(const_type_id)]
|
#![feature(const_type_id)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
|
|
||||||
use std::any::TypeId;
|
use std::any::TypeId;
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,28 @@
|
||||||
error[E0015]: cannot call non-const operator in constant functions
|
error[E0131]: `main` function is not allowed to have generic parameters
|
||||||
|
--> $DIR/const_cmp_type_id.rs:7:14
|
||||||
|
|
|
||||||
|
LL | const fn main() {
|
||||||
|
| ^ `main` cannot have generic parameters
|
||||||
|
|
||||||
|
error[E0308]: mismatched types
|
||||||
--> $DIR/const_cmp_type_id.rs:8:13
|
--> $DIR/const_cmp_type_id.rs:8:13
|
||||||
|
|
|
|
||||||
LL | assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
|
LL | assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true`
|
||||||
|
|
|
|
||||||
note: impl defined here, but it is not `const`
|
= note: expected constant `host`
|
||||||
--> $SRC_DIR/core/src/any.rs:LL:COL
|
found constant `true`
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
||||||
|
|
||||||
error[E0015]: cannot call non-const operator in constant functions
|
error[E0308]: mismatched types
|
||||||
--> $DIR/const_cmp_type_id.rs:9:13
|
--> $DIR/const_cmp_type_id.rs:9:13
|
||||||
|
|
|
|
||||||
LL | assert!(TypeId::of::<()>() != TypeId::of::<u8>());
|
LL | assert!(TypeId::of::<()>() != TypeId::of::<u8>());
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true`
|
||||||
|
|
|
|
||||||
note: impl defined here, but it is not `const`
|
= note: expected constant `host`
|
||||||
--> $SRC_DIR/core/src/any.rs:LL:COL
|
found constant `true`
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
||||||
|
|
||||||
error[E0015]: cannot call non-const operator in constants
|
|
||||||
--> $DIR/const_cmp_type_id.rs:10:22
|
|
||||||
|
|
|
||||||
LL | const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
note: impl defined here, but it is not `const`
|
|
||||||
--> $SRC_DIR/core/src/any.rs:LL:COL
|
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
|
||||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
Some errors have detailed explanations: E0131, E0308.
|
||||||
|
For more information about an error, try `rustc --explain E0131`.
|
||||||
|
|
|
@ -14,6 +14,7 @@ LL | [0; T::a()]
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0015]: cannot call non-const fn `<T as Tr>::a` in constants
|
error[E0015]: cannot call non-const fn `<T as Tr>::a` in constants
|
||||||
--> $DIR/constifconst-call-in-const-position.rs:16:38
|
--> $DIR/constifconst-call-in-const-position.rs:16:38
|
||||||
|
@ -22,6 +23,7 @@ LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] {
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 2 previous errors; 1 warning emitted
|
error: aborting due to 2 previous errors; 1 warning emitted
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ LL | GetTypeId::<T>::VALUE == GetTypeId::<usize>::VALUE
|
||||||
note: impl defined here, but it is not `const`
|
note: impl defined here, but it is not `const`
|
||||||
--> $SRC_DIR/core/src/any.rs:LL:COL
|
--> $SRC_DIR/core/src/any.rs:LL:COL
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ LL | self.bar[0] = baz.len();
|
||||||
note: impl defined here, but it is not `const`
|
note: impl defined here, but it is not `const`
|
||||||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | const CREATE<T: Create>: T = T::create();
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | a.plus(b)
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0015]: cannot call non-const operator in constants
|
error[E0015]: cannot call non-const operator in constants
|
||||||
--> $DIR/call-const-trait-method-pass.rs:39:22
|
--> $DIR/call-const-trait-method-pass.rs:39:22
|
||||||
|
@ -18,6 +19,7 @@ note: impl defined here, but it is not `const`
|
||||||
LL | impl const std::ops::Add for Int {
|
LL | impl const std::ops::Add for Int {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
||||||
#![feature(const_closures, const_trait_impl)]
|
#![feature(const_closures, const_trait_impl, effects)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
pub const _: () = {
|
pub const _: () = {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
//
|
//
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
|
|
||||||
// aux-build: cross-crate.rs
|
// aux-build: cross-crate.rs
|
||||||
extern crate cross_crate;
|
extern crate cross_crate;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// check-pass
|
||||||
|
// FIXME(effects) this shouldn't pass
|
||||||
#![feature(const_closures, const_trait_impl, effects)]
|
#![feature(const_closures, const_trait_impl, effects)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
|
@ -11,5 +13,5 @@ impl Foo for () {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
(const || { (()).foo() })();
|
(const || { (()).foo() })();
|
||||||
//~^ ERROR: cannot call non-const fn
|
// FIXME(effects) ~^ ERROR: cannot call non-const fn
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
error[E0015]: cannot call non-const fn `<() as Foo>::foo` in constant functions
|
|
||||||
--> $DIR/const_closure-const_trait_impl-ice-113381.rs:13:22
|
|
||||||
|
|
|
||||||
LL | (const || { (()).foo() })();
|
|
||||||
| ^^^^^
|
|
||||||
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
|
|
@ -10,6 +10,7 @@ note: impl defined here, but it is not `const`
|
||||||
LL | impl<T> const std::ops::Add for S<T> {
|
LL | impl<T> const std::ops::Add for S<T> {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@ error[E0015]: cannot call non-const closure in constants
|
||||||
LL | n => n(),
|
LL | n => n(),
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
|
||||||
|
= note: closures need an RFC before allowed to be called in constants
|
||||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#![feature(const_fmt_arguments_new)]
|
#![feature(const_fmt_arguments_new)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
|
|
||||||
#[const_trait]
|
#[const_trait]
|
||||||
trait Tr {
|
trait Tr {
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | T::assoc()
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ LL | "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in
|
||||||
|
|
|
|
||||||
= note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
|
= note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | (const || { (()).foo() })();
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
|
= help: add `#![feature(effects)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(const_trait_impl, min_specialization, rustc_attrs)]
|
#![feature(const_trait_impl, effects, min_specialization, rustc_attrs)]
|
||||||
// known-bug: #110395
|
// known-bug: #110395
|
||||||
#[rustc_specialization_trait]
|
#[rustc_specialization_trait]
|
||||||
#[const_trait]
|
#[const_trait]
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
error[E0015]: cannot call non-const fn `<T as A>::a` in constant functions
|
error[E0119]: conflicting implementations of trait `A`
|
||||||
--> $DIR/specializing-constness-2.rs:27:5
|
--> $DIR/specializing-constness-2.rs:20:1
|
||||||
|
|
|
|
||||||
LL | <T as A>::a();
|
LL | impl<T: Default> A for T {
|
||||||
| ^^^^^^^^^^^^^
|
| ------------------------ first implementation here
|
||||||
|
|
...
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
LL | impl<T: Default + ~const Sup> const A for T {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
For more information about this error, try `rustc --explain E0119`.
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
error: `~const` is not allowed here
|
error: `~const` is not allowed here
|
||||||
--> $DIR/super-traits-fail-2.rs:11:12
|
--> $DIR/super-traits-fail-2.rs:10:12
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
||||||
--> $DIR/super-traits-fail-2.rs:11:1
|
--> $DIR/super-traits-fail-2.rs:10:1
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-2.rs:11:19
|
--> $DIR/super-traits-fail-2.rs:10:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-2.rs:11:19
|
--> $DIR/super-traits-fail-2.rs:10:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-2.rs:11:19
|
--> $DIR/super-traits-fail-2.rs:10:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-2.rs:11:19
|
--> $DIR/super-traits-fail-2.rs:10:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
// known-bug: #110395
|
|
||||||
// revisions: yy yn ny nn
|
// revisions: yy yn ny nn
|
||||||
|
|
||||||
#[cfg_attr(any(yy, yn), const_trait)]
|
#[cfg_attr(any(yy, yn), const_trait)]
|
||||||
|
@ -9,12 +8,14 @@ trait Foo {
|
||||||
|
|
||||||
#[cfg_attr(any(yy, ny), const_trait)]
|
#[cfg_attr(any(yy, ny), const_trait)]
|
||||||
trait Bar: ~const Foo {}
|
trait Bar: ~const Foo {}
|
||||||
// FIXME [ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
|
//[ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
|
||||||
// FIXME [ny,nn]~| ERROR: ~const can only be applied to `#[const_trait]`
|
//[ny,nn]~| ERROR: ~const can only be applied to `#[const_trait]`
|
||||||
|
//[yn,nn]~^^^ ERROR: `~const` is not allowed here
|
||||||
|
|
||||||
const fn foo<T: Bar>(x: &T) {
|
const fn foo<T: Bar>(x: &T) {
|
||||||
x.a();
|
x.a();
|
||||||
// FIXME [yn,yy]~^ ERROR the trait bound
|
//[yy,yn]~^ ERROR mismatched types
|
||||||
|
// FIXME(effects) diagnostic
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,14 +1,24 @@
|
||||||
error: `~const` is not allowed here
|
error: `~const` is not allowed here
|
||||||
--> $DIR/super-traits-fail-2.rs:11:12
|
--> $DIR/super-traits-fail-2.rs:10:12
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
||||||
--> $DIR/super-traits-fail-2.rs:11:1
|
--> $DIR/super-traits-fail-2.rs:10:1
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error[E0308]: mismatched types
|
||||||
|
--> $DIR/super-traits-fail-2.rs:16:5
|
||||||
|
|
|
||||||
|
LL | x.a();
|
||||||
|
| ^^^^^ expected `host`, found `true`
|
||||||
|
|
|
||||||
|
= note: expected constant `host`
|
||||||
|
found constant `true`
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0308`.
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
|
error[E0308]: mismatched types
|
||||||
--> $DIR/super-traits-fail-2.rs:16:7
|
--> $DIR/super-traits-fail-2.rs:16:5
|
||||||
|
|
|
|
||||||
LL | x.a();
|
LL | x.a();
|
||||||
| ^^^
|
| ^^^^^ expected `host`, found `true`
|
||||||
|
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
= note: expected constant `host`
|
||||||
|
found constant `true`
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
For more information about this error, try `rustc --explain E0308`.
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
error: `~const` is not allowed here
|
error: `~const` is not allowed here
|
||||||
--> $DIR/super-traits-fail-3.rs:13:12
|
--> $DIR/super-traits-fail-3.rs:12:12
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
||||||
--> $DIR/super-traits-fail-3.rs:13:1
|
--> $DIR/super-traits-fail-3.rs:12:1
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:13:19
|
--> $DIR/super-traits-fail-3.rs:12:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:13:19
|
--> $DIR/super-traits-fail-3.rs:12:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
@ -25,7 +25,7 @@ LL | trait Bar: ~const Foo {}
|
||||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:18:24
|
--> $DIR/super-traits-fail-3.rs:17:24
|
||||||
|
|
|
|
||||||
LL | const fn foo<T: ~const Bar>(x: &T) {
|
LL | const fn foo<T: ~const Bar>(x: &T) {
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:13:19
|
--> $DIR/super-traits-fail-3.rs:12:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:13:19
|
--> $DIR/super-traits-fail-3.rs:12:19
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
|
|
||||||
// revisions: yy yn ny nn
|
// revisions: yy yn ny nn
|
||||||
//[yy] known-bug: #110395
|
//[yy] check-pass
|
||||||
//FIXME [yy] check-pass
|
|
||||||
|
|
||||||
#[cfg_attr(any(yy, yn), const_trait)]
|
#[cfg_attr(any(yy, yn), const_trait)]
|
||||||
trait Foo {
|
trait Foo {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
error: `~const` is not allowed here
|
error: `~const` is not allowed here
|
||||||
--> $DIR/super-traits-fail-3.rs:13:12
|
--> $DIR/super-traits-fail-3.rs:12:12
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
|
|
|
||||||
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
||||||
--> $DIR/super-traits-fail-3.rs:13:1
|
--> $DIR/super-traits-fail-3.rs:12:1
|
||||||
|
|
|
|
||||||
LL | trait Bar: ~const Foo {}
|
LL | trait Bar: ~const Foo {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: ~const can only be applied to `#[const_trait]` traits
|
error: ~const can only be applied to `#[const_trait]` traits
|
||||||
--> $DIR/super-traits-fail-3.rs:18:24
|
--> $DIR/super-traits-fail-3.rs:17:24
|
||||||
|
|
|
|
||||||
LL | const fn foo<T: ~const Bar>(x: &T) {
|
LL | const fn foo<T: ~const Bar>(x: &T) {
|
||||||
| ^^^
|
| ^^^
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
|
|
||||||
--> $DIR/super-traits-fail-3.rs:20:7
|
|
||||||
|
|
|
||||||
LL | x.a();
|
|
||||||
| ^^^
|
|
||||||
|
|
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
|
|
@ -1,7 +1,7 @@
|
||||||
// known-bug: #110395
|
// known-bug: #110395
|
||||||
|
|
||||||
#![feature(staged_api)]
|
#![feature(staged_api)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl, effects)]
|
||||||
#![feature(const_t_try)]
|
#![feature(const_t_try)]
|
||||||
#![feature(const_try)]
|
#![feature(const_try)]
|
||||||
#![feature(try_trait_v2)]
|
#![feature(try_trait_v2)]
|
||||||
|
|
|
@ -1,29 +1,39 @@
|
||||||
error[E0015]: `?` cannot determine the branch of `T` in constant functions
|
error: const `impl` for trait `Try` which is not marked with `#[const_trait]`
|
||||||
--> $DIR/trait-default-body-stability.rs:44:9
|
--> $DIR/trait-default-body-stability.rs:18:12
|
||||||
|
|
|
||||||
LL | T?
|
|
||||||
| ^^
|
|
||||||
|
|
|
||||||
note: impl defined here, but it is not `const`
|
|
||||||
--> $DIR/trait-default-body-stability.rs:18:1
|
|
||||||
|
|
|
|
||||||
LL | impl const Try for T {
|
LL | impl const Try for T {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
||||||
|
= 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[E0015]: `?` cannot convert from residual of `T` in constant functions
|
error: const `impl` for trait `FromResidual` which is not marked with `#[const_trait]`
|
||||||
--> $DIR/trait-default-body-stability.rs:44:9
|
--> $DIR/trait-default-body-stability.rs:33:12
|
||||||
|
|
|
||||||
LL | T?
|
|
||||||
| ^^
|
|
||||||
|
|
|
||||||
note: impl defined here, but it is not `const`
|
|
||||||
--> $DIR/trait-default-body-stability.rs:33:1
|
|
||||||
|
|
|
|
||||||
LL | impl const FromResidual for T {
|
LL | impl const FromResidual for T {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
||||||
|
= 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 2 previous errors
|
error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates
|
||||||
|
--> $DIR/trait-default-body-stability.rs:18:6
|
||||||
|
|
|
||||||
|
LL | impl const Try for T {
|
||||||
|
| ^^^^^ unconstrained const parameter
|
||||||
|
|
|
||||||
|
= note: expressions using a const parameter must map each value to a distinct output value
|
||||||
|
= note: proving the result of expressions other than the parameter are unique is not supported
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0015`.
|
error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates
|
||||||
|
--> $DIR/trait-default-body-stability.rs:33:6
|
||||||
|
|
|
||||||
|
LL | impl const FromResidual for T {
|
||||||
|
| ^^^^^ unconstrained const parameter
|
||||||
|
|
|
||||||
|
= note: expressions using a const parameter must map each value to a distinct output value
|
||||||
|
= note: proving the result of expressions other than the parameter are unique is not supported
|
||||||
|
|
||||||
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0207`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue