From 3b14b756d87835bf1484ee33eb5b074d3646671c Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sun, 16 Jun 2024 15:04:37 +0000 Subject: [PATCH 1/4] Remove `feature(effects)` from the standard library --- library/alloc/src/lib.rs | 1 - library/core/src/cmp.rs | 4 +--- library/core/src/escape.rs | 2 +- library/core/src/ffi/c_str.rs | 4 +++- library/core/src/lib.rs | 2 -- library/core/src/marker.rs | 1 - library/core/src/num/nonzero.rs | 6 ++---- library/core/src/ops/arith.rs | 4 +--- library/core/src/task/wake.rs | 4 ++-- library/std/src/lib.rs | 1 - 10 files changed, 10 insertions(+), 19 deletions(-) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 022a14b931a3c..43213dce243e8 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -175,7 +175,6 @@ #![feature(const_mut_refs)] #![feature(const_precise_live_drops)] #![feature(const_ptr_write)] -#![feature(const_trait_impl)] #![feature(const_try)] #![feature(decl_macro)] #![feature(dropck_eyepatch)] diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index f3f757ce69df7..cff75870790c5 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -245,7 +245,6 @@ use self::Ordering::*; append_const_msg )] #[rustc_diagnostic_item = "PartialEq"] -#[const_trait] pub trait PartialEq { /// This method tests for `self` and `other` values to be equal, and is used /// by `==`. @@ -1475,8 +1474,7 @@ mod impls { macro_rules! partial_eq_impl { ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_cmp", issue = "92391")] - impl const PartialEq for $t { + impl PartialEq for $t { #[inline] fn eq(&self, other: &$t) -> bool { (*self) == (*other) } #[inline] diff --git a/library/core/src/escape.rs b/library/core/src/escape.rs index f6ec30b9f793a..b213cc2b9167c 100644 --- a/library/core/src/escape.rs +++ b/library/core/src/escape.rs @@ -60,7 +60,7 @@ const fn escape_ascii(byte: u8) -> ([ascii::Char; N], Range) const fn escape_unicode(c: char) -> ([ascii::Char; N], Range) { const { assert!(N >= 10 && N < u8::MAX as usize) }; - let c = u32::from(c); + let c = c as u32; // OR-ing `1` ensures that for `c == 0` the code computes that // one digit should be printed. diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs index 297f52e756bc6..fbc0c7232c4e5 100644 --- a/library/core/src/ffi/c_str.rs +++ b/library/core/src/ffi/c_str.rs @@ -515,7 +515,9 @@ impl CStr { #[inline] #[must_use] const fn as_non_null_ptr(&self) -> NonNull { - NonNull::from(&self.inner).as_non_null_ptr() + // FIXME(effects) replace with `NonNull::from` + // SAFETY: a reference is never null + unsafe { NonNull::new_unchecked(&self.inner as *const [c_char] as *mut [c_char]) }.as_non_null_ptr() } /// Returns the length of `self`. Like C's `strlen`, this does not include the nul terminator. diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 94ad8fbd5df07..51452e3b7b02f 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -214,13 +214,11 @@ #![feature(const_mut_refs)] #![feature(const_precise_live_drops)] #![feature(const_refs_to_cell)] -#![feature(const_trait_impl)] #![feature(decl_macro)] #![feature(deprecated_suggestion)] #![feature(doc_cfg)] #![feature(doc_cfg_hide)] #![feature(doc_notable_trait)] -#![feature(effects)] #![feature(extern_types)] #![feature(f128)] #![feature(f16)] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 1d073a6d649b8..2e8be7bde4bc3 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -944,7 +944,6 @@ marker_impls! { #[lang = "destruct"] #[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)] #[rustc_deny_explicit_impl(implement_via_object = false)] -#[const_trait] pub trait Destruct {} /// A marker for tuple types. diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 5956a08593ad4..0c6f06dc017e7 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -33,7 +33,6 @@ use super::{IntErrorKind, ParseIntError}; reason = "implementation detail which may disappear or be replaced at any time", issue = "none" )] -#[const_trait] pub unsafe trait ZeroablePrimitive: Sized + Copy + private::Sealed { #[doc(hidden)] type NonZeroInner: Sized + Copy; @@ -47,7 +46,6 @@ macro_rules! impl_zeroable_primitive { reason = "implementation detail which may disappear or be replaced at any time", issue = "none" )] - #[const_trait] pub trait Sealed {} $( @@ -70,14 +68,14 @@ macro_rules! impl_zeroable_primitive { reason = "implementation detail which may disappear or be replaced at any time", issue = "none" )] - impl const private::Sealed for $primitive {} + impl private::Sealed for $primitive {} #[unstable( feature = "nonzero_internals", reason = "implementation detail which may disappear or be replaced at any time", issue = "none" )] - unsafe impl const ZeroablePrimitive for $primitive { + unsafe impl ZeroablePrimitive for $primitive { type NonZeroInner = private::$NonZeroInner; } )+ diff --git a/library/core/src/ops/arith.rs b/library/core/src/ops/arith.rs index 5e77788d8ea36..133ae04f02618 100644 --- a/library/core/src/ops/arith.rs +++ b/library/core/src/ops/arith.rs @@ -73,7 +73,6 @@ append_const_msg )] #[doc(alias = "+")] -#[const_trait] pub trait Add { /// The resulting type after applying the `+` operator. #[stable(feature = "rust1", since = "1.0.0")] @@ -95,8 +94,7 @@ pub trait Add { macro_rules! add_impl { ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_ops", issue = "90080")] - impl const Add for $t { + impl Add for $t { type Output = $t; #[inline] diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index 3d21b09fa8a02..86a965f68e085 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -282,7 +282,7 @@ impl<'a> Context<'a> { pub const fn ext(&mut self) -> &mut dyn Any { // FIXME: this field makes Context extra-weird about unwind safety // can we justify AssertUnwindSafe if we stabilize this? do we care? - match &mut *self.ext { + match &mut self.ext.0 { ExtData::Some(data) => *data, ExtData::None(unit) => unit, } @@ -356,7 +356,7 @@ impl<'a> ContextBuilder<'a> { #[rustc_const_unstable(feature = "const_waker", issue = "102012")] #[unstable(feature = "context_ext", issue = "123392")] pub const fn from(cx: &'a mut Context<'_>) -> Self { - let ext = match &mut *cx.ext { + let ext = match &mut cx.ext.0 { ExtData::Some(ext) => ExtData::Some(*ext), ExtData::None(()) => ExtData::None(()), }; diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 80f67838ac002..caa8c7375ec45 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -284,7 +284,6 @@ #![feature(cfi_encoding)] #![feature(concat_idents)] #![feature(const_mut_refs)] -#![feature(const_trait_impl)] #![feature(decl_macro)] #![feature(deprecated_suggestion)] #![feature(doc_cfg)] From 02aaea18032cd409d7a07ded6d42fc5855484419 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sun, 16 Jun 2024 15:12:22 +0000 Subject: [PATCH 2/4] update intrinsic const param counting --- .../rustc_hir_analysis/src/check/intrinsic.rs | 24 +++++++++---------- library/core/src/ffi/c_str.rs | 3 ++- library/core/src/lib.rs | 1 + 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 13180fa2673ba..683709f43f2db 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -429,17 +429,17 @@ pub fn check_intrinsic_type( sym::ptr_guaranteed_cmp => ( 1, - 1, + 0, vec![Ty::new_imm_ptr(tcx, param(0)), Ty::new_imm_ptr(tcx, param(0))], tcx.types.u8, ), sym::const_allocate => { - (0, 1, vec![tcx.types.usize, tcx.types.usize], Ty::new_mut_ptr(tcx, tcx.types.u8)) + (0, 0, vec![tcx.types.usize, tcx.types.usize], Ty::new_mut_ptr(tcx, tcx.types.u8)) } sym::const_deallocate => ( 0, - 1, + 0, vec![Ty::new_mut_ptr(tcx, tcx.types.u8), tcx.types.usize, tcx.types.usize], tcx.types.unit, ), @@ -478,16 +478,16 @@ pub fn check_intrinsic_type( | sym::frem_algebraic => (1, 0, vec![param(0), param(0)], param(0)), sym::float_to_int_unchecked => (2, 0, vec![param(0)], param(1)), - sym::assume => (0, 1, vec![tcx.types.bool], tcx.types.unit), - sym::likely => (0, 1, vec![tcx.types.bool], tcx.types.bool), - sym::unlikely => (0, 1, vec![tcx.types.bool], tcx.types.bool), + sym::assume => (0, 0, vec![tcx.types.bool], tcx.types.unit), + sym::likely => (0, 0, vec![tcx.types.bool], tcx.types.bool), + sym::unlikely => (0, 0, vec![tcx.types.bool], tcx.types.bool), sym::read_via_copy => (1, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(0)), sym::write_via_move => { (1, 0, vec![Ty::new_mut_ptr(tcx, param(0)), param(0)], tcx.types.unit) } - sym::typed_swap => (1, 1, vec![Ty::new_mut_ptr(tcx, param(0)); 2], tcx.types.unit), + sym::typed_swap => (1, 0, vec![Ty::new_mut_ptr(tcx, param(0)); 2], tcx.types.unit), sym::discriminant_value => { let assoc_items = tcx.associated_item_def_ids( @@ -566,9 +566,9 @@ pub fn check_intrinsic_type( sym::black_box => (1, 0, vec![param(0)], param(0)), - sym::is_val_statically_known => (1, 1, vec![param(0)], tcx.types.bool), + sym::is_val_statically_known => (1, 0, vec![param(0)], tcx.types.bool), - sym::const_eval_select => (4, 1, vec![param(0), param(1), param(2)], param(3)), + sym::const_eval_select => (4, 0, vec![param(0), param(1), param(2)], param(3)), sym::vtable_size | sym::vtable_align => { (0, 0, vec![Ty::new_imm_ptr(tcx, tcx.types.unit)], tcx.types.usize) @@ -576,10 +576,10 @@ pub fn check_intrinsic_type( // This type check is not particularly useful, but the `where` bounds // on the definition in `core` do the heavy lifting for checking it. - sym::aggregate_raw_ptr => (3, 1, vec![param(1), param(2)], param(0)), - sym::ptr_metadata => (2, 1, vec![Ty::new_imm_ptr(tcx, param(0))], param(1)), + sym::aggregate_raw_ptr => (3, 0, vec![param(1), param(2)], param(0)), + sym::ptr_metadata => (2, 0, vec![Ty::new_imm_ptr(tcx, param(0))], param(1)), - sym::ub_checks => (0, 1, Vec::new(), tcx.types.bool), + sym::ub_checks => (0, 0, Vec::new(), tcx.types.bool), sym::simd_eq | sym::simd_ne diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs index fbc0c7232c4e5..d2a408485d162 100644 --- a/library/core/src/ffi/c_str.rs +++ b/library/core/src/ffi/c_str.rs @@ -517,7 +517,8 @@ impl CStr { const fn as_non_null_ptr(&self) -> NonNull { // FIXME(effects) replace with `NonNull::from` // SAFETY: a reference is never null - unsafe { NonNull::new_unchecked(&self.inner as *const [c_char] as *mut [c_char]) }.as_non_null_ptr() + unsafe { NonNull::new_unchecked(&self.inner as *const [c_char] as *mut [c_char]) } + .as_non_null_ptr() } /// Returns the length of `self`. Like C's `strlen`, this does not include the nul terminator. diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 51452e3b7b02f..2d0b8825f433b 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -200,6 +200,7 @@ // Language features: // tidy-alphabetical-start #![cfg_attr(bootstrap, feature(c_unwind))] +#![cfg_attr(bootstrap, feature(effects))] #![feature(abi_unadjusted)] #![feature(adt_const_params)] #![feature(allow_internal_unsafe)] From a6a83d3d4ed4666ccc5cff4043e2ce89279ad6a4 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Fri, 21 Jun 2024 11:57:24 +0000 Subject: [PATCH 3/4] bless tests --- tests/crashes/120503.rs | 10 - tests/crashes/121536.rs | 20 -- .../ui/consts/const-block-const-bound.stderr | 8 +- tests/ui/consts/const-float-classify.rs | 3 +- tests/ui/consts/const-float-classify.stderr | 214 +++++++++++++++ tests/ui/consts/const_cmp_type_id.stderr | 22 +- tests/ui/consts/fn_trait_refs.stderr | 32 ++- .../impl-trait/normalize-tait-in-const.stderr | 8 +- tests/ui/intrinsics/not-overridden.rs | 2 +- .../ui/intrinsics/safe-intrinsic-mismatch.rs | 4 +- .../intrinsics/safe-intrinsic-mismatch.stderr | 11 +- .../call-generic-in-impl.rs | 3 +- .../call-generic-in-impl.stderr | 8 + .../call-generic-method-chain.rs | 3 +- .../call-generic-method-chain.stderr | 62 +++++ .../call-generic-method-dup-bound.rs | 3 +- .../call-generic-method-dup-bound.stderr | 76 ++++++ .../call-generic-method-fail.rs | 4 +- .../call-generic-method-fail.stderr | 12 - .../call-generic-method-pass.rs | 3 +- .../call-generic-method-pass.stderr | 56 ++++ .../const-and-non-const-impl.stderr | 18 +- .../const-drop-bound.stderr | 20 +- .../const-drop-fail-2.stderr | 8 +- .../const-drop-fail.precise.stderr | 8 +- .../const-drop-fail.stock.stderr | 8 +- .../const-drop.precise.stderr | 8 +- .../const-drop.stock.stderr | 8 +- .../const-impl-trait.stderr | 256 ++++++++++++++++-- .../const_derives/derive-const-use.stderr | 78 +++++- .../const_derives/derive-const-with-params.rs | 3 +- .../derive-const-with-params.stderr | 40 +++ .../ice-112822-expected-type-for-param.rs | 3 +- .../ice-112822-expected-type-for-param.stderr | 47 +--- .../effects/minicore.rs | 4 +- .../effects/minicore.stderr | 9 + .../ice-120503-async-const-method.rs | 18 ++ .../ice-120503-async-const-method.stderr | 92 +++++++ .../ice-121536-const-method.rs | 17 ++ .../ice-121536-const-method.stderr | 19 ++ .../issue-92111.stderr | 8 +- tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr | 26 +- 42 files changed, 1077 insertions(+), 185 deletions(-) delete mode 100644 tests/crashes/120503.rs delete mode 100644 tests/crashes/121536.rs create mode 100644 tests/ui/consts/const-float-classify.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr delete mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr diff --git a/tests/crashes/120503.rs b/tests/crashes/120503.rs deleted file mode 100644 index 28f1e3dfd94c4..0000000000000 --- a/tests/crashes/120503.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ known-bug: #120503 -#![feature(effects)] - -trait MyTrait {} - -impl MyTrait for i32 { - async const fn bar(&self) { - main8().await; - } -} diff --git a/tests/crashes/121536.rs b/tests/crashes/121536.rs deleted file mode 100644 index 000e7cb15eb2f..0000000000000 --- a/tests/crashes/121536.rs +++ /dev/null @@ -1,20 +0,0 @@ -//@ known-bug: #121536 -#![feature(effects)] - -#[derive(Debug, Clone, Copy)] -pub struct Vec3 { - pub x: f32, - pub y: f32, - pub z: f32, -} - -impl std::ops::Add for Vec3 { - type Output = Vec3; - const fn add(self, b: Vec3) -> Self::Output { - Vec3 { - x: self.x + b.x, - y: self.y + b.y, - z: self.z + b.z, - } - } -} diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr index 81790a62f61da..42a42ae3938b7 100644 --- a/tests/ui/consts/const-block-const-bound.stderr +++ b/tests/ui/consts/const-block-const-bound.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-block-const-bound.rs:8:22 + | +LL | const fn f(x: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/const-block-const-bound.rs:8:32 | @@ -6,6 +12,6 @@ LL | const fn f(x: T) {} | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/consts/const-float-classify.rs b/tests/ui/consts/const-float-classify.rs index 44772fb731369..ae094003c89e2 100644 --- a/tests/ui/consts/const-float-classify.rs +++ b/tests/ui/consts/const-float-classify.rs @@ -1,5 +1,6 @@ //@ compile-flags: -Zmir-opt-level=0 -//@ run-pass +//@ known-bug: #110395 +// FIXME(effects) run-pass #![feature(const_float_bits_conv)] #![feature(const_float_classify)] diff --git a/tests/ui/consts/const-float-classify.stderr b/tests/ui/consts/const-float-classify.stderr new file mode 100644 index 0000000000000..9ecd7b83681e1 --- /dev/null +++ b/tests/ui/consts/const-float-classify.stderr @@ -0,0 +1,214 @@ +error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ^^^^^^^^^^^^^^^^^ + | + = 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[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + --> $DIR/const-float-classify.rs:12:6 + | +LL | impl const PartialEq for bool { + | ^^^^^ 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[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0284]: type annotations needed + --> $DIR/const-float-classify.rs:21:35 + | +LL | const _: () = assert!($a == $b); + | ^^ cannot infer the value of the constant `_` +... +LL | / suite! { +LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative] +LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet] +... | +LL | | -1.0 / 0.0 => [ false, true, false, false, false, true] +LL | | } + | |_- in this macro invocation + | +note: required for `bool` to implement `PartialEq` + --> $DIR/const-float-classify.rs:12:12 + | +LL | impl const PartialEq for bool { + | ----- ^^^^^^^^^^^^^^^^^ ^^^^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 10 previous errors + +Some errors have detailed explanations: E0207, E0284. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr index 98f5b3a5e90d3..f9628e5443b8d 100644 --- a/tests/ui/consts/const_cmp_type_id.stderr +++ b/tests/ui/consts/const_cmp_type_id.stderr @@ -10,25 +10,7 @@ error[E0080]: evaluation of constant value failed LL | const _A: bool = TypeId::of::() < TypeId::of::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `::lt` -error[E0308]: mismatched types - --> $DIR/const_cmp_type_id.rs:8:13 - | -LL | assert!(TypeId::of::() == TypeId::of::()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true` - | - = note: expected constant `host` - found constant `true` - -error[E0308]: mismatched types - --> $DIR/const_cmp_type_id.rs:9:13 - | -LL | assert!(TypeId::of::<()>() != TypeId::of::()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true` - | - = note: expected constant `host` - found constant `true` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0080, E0131, E0308. +Some errors have detailed explanations: E0080, E0131. For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr index 4fb82c0683dc6..42a6026cfbad3 100644 --- a/tests/ui/consts/fn_trait_refs.stderr +++ b/tests/ui/consts/fn_trait_refs.stderr @@ -4,12 +4,24 @@ error[E0635]: unknown feature `const_fn_trait_ref_impls` LL | #![feature(const_fn_trait_ref_impls)] | ^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0635]: unknown feature `const_cmp` + --> $DIR/fn_trait_refs.rs:8:12 + | +LL | #![feature(const_cmp)] + | ^^^^^^^^^ + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/fn_trait_refs.rs:15:15 | LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/fn_trait_refs.rs:15:31 + | +LL | T: ~const Fn<()> + ~const Destruct, + | ^^^^^^^^ + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/fn_trait_refs.rs:15:15 | @@ -24,6 +36,12 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/fn_trait_refs.rs:22:34 + | +LL | T: ~const FnMut<()> + ~const Destruct, + | ^^^^^^^^ + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/fn_trait_refs.rs:22:15 | @@ -52,6 +70,12 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | T: ~const Fn<()> + ~const Destruct, | ^^^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/fn_trait_refs.rs:36:31 + | +LL | T: ~const Fn<()> + ~const Destruct, + | ^^^^^^^^ + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/fn_trait_refs.rs:36:15 | @@ -66,6 +90,12 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | T: ~const FnMut<()> + ~const Destruct, | ^^^^^^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/fn_trait_refs.rs:50:34 + | +LL | T: ~const FnMut<()> + ~const Destruct, + | ^^^^^^^^ + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/fn_trait_refs.rs:50:15 | @@ -182,7 +212,7 @@ LL | const fn test_fn_mut(mut f: T) -> (T::Output, T::Output) LL | } | - value is dropped here -error: aborting due to 20 previous errors +error: aborting due to 25 previous errors Some errors have detailed explanations: E0015, E0493, E0635. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index 5e3c0ea054bdd..73f4d4c388563 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -4,6 +4,12 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | const fn with_positive Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { | ^^^^^^^^^^^^^^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/normalize-tait-in-const.rs:27:69 + | +LL | const fn with_positive Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { + | ^^^^^^^^ + error[E0015]: cannot call non-const closure in constant functions --> $DIR/normalize-tait-in-const.rs:28:5 | @@ -29,7 +35,7 @@ LL | fun(filter_positive()); LL | } | - value is dropped here -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0015, E0493. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/intrinsics/not-overridden.rs b/tests/ui/intrinsics/not-overridden.rs index d6655b51905ae..a53071e304d89 100644 --- a/tests/ui/intrinsics/not-overridden.rs +++ b/tests/ui/intrinsics/not-overridden.rs @@ -1,6 +1,6 @@ //! Check that intrinsics that do not get overridden, but are marked as such, //! cause an error instead of silently invoking the body. -#![feature(rustc_attrs, effects)] +#![feature(rustc_attrs/* , effects*/)] // FIXME(effects) //@ build-fail //@ failure-status:101 //@ normalize-stderr-test ".*note: .*\n\n" -> "" diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.rs b/tests/ui/intrinsics/safe-intrinsic-mismatch.rs index 23cd5f1083534..c116ba7a62eeb 100644 --- a/tests/ui/intrinsics/safe-intrinsic-mismatch.rs +++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.rs @@ -1,6 +1,6 @@ #![feature(intrinsics)] #![feature(rustc_attrs)] -#![feature(effects)] +// FIXME(effects) do this with revisions #![feature(effects)] extern "rust-intrinsic" { fn size_of() -> usize; //~ ERROR intrinsic safety mismatch @@ -19,7 +19,7 @@ const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} mod foo { #[rustc_intrinsic] unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} - //~^ ERROR wrong number of const parameters + // FIXME(effects) ~^ ERROR wrong number of const parameters } fn main() {} diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr b/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr index d73d5bab8d76a..7f37e0f821118 100644 --- a/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr +++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.stderr @@ -42,13 +42,6 @@ LL | const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} = note: expected signature `unsafe fn(_, _, _)` found signature `fn(_, _, _)` -error[E0094]: intrinsic has wrong number of const parameters: found 0, expected 1 - --> $DIR/safe-intrinsic-mismatch.rs:21:31 - | -LL | unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} - | ^ expected 1 const parameter - -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors -Some errors have detailed explanations: E0094, E0308. -For more information about an error, try `rustc --explain E0094`. +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs index b63458b39e95d..6b3a4ae1b95ee 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs @@ -1,4 +1,5 @@ -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass #![feature(const_trait_impl)] #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr new file mode 100644 index 0000000000000..12027c4d71362 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr @@ -0,0 +1,8 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-in-impl.rs:10:16 + | +LL | impl const MyPartialEq for T { + | ^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs index 37b2de0fd2d49..9df694a02f596 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs @@ -1,6 +1,7 @@ //! Basic test for calling methods on generic type parameters in `const fn`. -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass #![feature(const_trait_impl, effects)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr new file mode 100644 index 0000000000000..4b0d304c5bee2 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr @@ -0,0 +1,62 @@ +error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/call-generic-method-chain.rs:10:12 + | +LL | impl const PartialEq for S { + | ^^^^^^^^^ + | + = 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[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + --> $DIR/call-generic-method-chain.rs:10:6 + | +LL | impl const PartialEq for S { + | ^^^^^ 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: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-method-chain.rs:19:32 + | +LL | const fn equals_self(t: &T) -> bool { + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-method-chain.rs:23:40 + | +LL | const fn equals_self_wrapper(t: &T) -> bool { + | ^^^^^^^^^ + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-chain.rs:27:22 + | +LL | pub const EQ: bool = equals_self_wrapper(&S); + | ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-chain.rs:10:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-chain.rs:15:10 + | +LL | !self.eq(other) + | ^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-chain.rs:10:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0207, E0284. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs index ea8fd00556191..f46a34911f193 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs @@ -1,4 +1,5 @@ -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass #![feature(const_trait_impl, effects)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr new file mode 100644 index 0000000000000..69f7029516091 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr @@ -0,0 +1,76 @@ +error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/call-generic-method-dup-bound.rs:8:12 + | +LL | impl const PartialEq for S { + | ^^^^^^^^^ + | + = 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[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + --> $DIR/call-generic-method-dup-bound.rs:8:6 + | +LL | impl const PartialEq for S { + | ^^^^^ 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: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-method-dup-bound.rs:19:44 + | +LL | const fn equals_self(t: &T) -> bool { + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-method-dup-bound.rs:26:37 + | +LL | const fn equals_self2(t: &T) -> bool { + | ^^^^^^^^^ + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-dup-bound.rs:30:22 + | +LL | pub const EQ: bool = equals_self(&S) && equals_self2(&S); + | ^^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-dup-bound.rs:8:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-dup-bound.rs:30:41 + | +LL | pub const EQ: bool = equals_self(&S) && equals_self2(&S); + | ^^^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-dup-bound.rs:8:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-dup-bound.rs:13:10 + | +LL | !self.eq(other) + | ^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-dup-bound.rs:8:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error: aborting due to 7 previous errors + +Some errors have detailed explanations: E0207, E0284. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs index 043939750a856..cc5f218ae2def 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs @@ -1,8 +1,10 @@ +//@ check-pass + #![feature(const_trait_impl, effects)] pub const fn equals_self(t: &T) -> bool { *t == *t - //~^ ERROR mismatched types + // FIXME(effects) ~^ ERROR mismatched types // FIXME(effects): diagnostic } diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr deleted file mode 100644 index 5074c4a22610b..0000000000000 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/call-generic-method-fail.rs:4:5 - | -LL | *t == *t - | ^^^^^^^^ expected `host`, found `true` - | - = note: expected constant `host` - found constant `true` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs index 55d8afa8d47c6..413685d8b3443 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs @@ -1,6 +1,7 @@ //! Basic test for calling methods on generic type parameters in `const fn`. -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass #![feature(const_trait_impl, effects)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr new file mode 100644 index 0000000000000..1bba23e2892ee --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr @@ -0,0 +1,56 @@ +error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/call-generic-method-pass.rs:10:12 + | +LL | impl const PartialEq for S { + | ^^^^^^^^^ + | + = 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[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + --> $DIR/call-generic-method-pass.rs:10:6 + | +LL | impl const PartialEq for S { + | ^^^^^ 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: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/call-generic-method-pass.rs:19:32 + | +LL | const fn equals_self(t: &T) -> bool { + | ^^^^^^^^^ + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-pass.rs:23:22 + | +LL | pub const EQ: bool = equals_self(&S); + | ^^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-pass.rs:10:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error[E0284]: type annotations needed + --> $DIR/call-generic-method-pass.rs:15:10 + | +LL | !self.eq(other) + | ^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/call-generic-method-pass.rs:10:12 + | +LL | impl const PartialEq for S { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0207, E0284. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 54bc434772297..8916450df2d4b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -1,3 +1,12 @@ +error[E0119]: conflicting implementations of trait `Add` for type `Int` + --> $DIR/const-and-non-const-impl.rs:23:1 + | +LL | impl std::ops::Add for Int { + | -------------------------- first implementation here +... +LL | impl const std::ops::Add for Int { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Int` + error[E0117]: only traits defined in the current crate can be implemented for primitive types --> $DIR/const-and-non-const-impl.rs:7:1 | @@ -10,15 +19,6 @@ LL | impl const std::ops::Add for i32 { | = note: define and implement a trait or new type instead -error[E0119]: conflicting implementations of trait `Add` for type `Int` - --> $DIR/const-and-non-const-impl.rs:23:1 - | -LL | impl std::ops::Add for Int { - | -------------------------- first implementation here -... -LL | impl const std::ops::Add for Int { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Int` - error: aborting due to 2 previous errors Some errors have detailed explanations: E0117, E0119. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr index 16ed615907b13..be197006f021a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr @@ -1,9 +1,27 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-bound.rs:9:68 + | +LL | const fn foo(res: Result) -> Option where E: ~const Destruct { + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-bound.rs:20:15 + | +LL | T: ~const Destruct, + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-bound.rs:21:15 + | +LL | E: ~const Destruct, + | ^^^^^^^^ + error[E0493]: destructor of `E` cannot be evaluated at compile-time --> $DIR/const-drop-bound.rs:12:13 | LL | Err(_e) => None, | ^^ the destructor for this type cannot be evaluated in constant functions -error: aborting due to 1 previous error +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr index 6f75924f0aa64..085d9e710125a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-fail-2.rs:21:26 + | +LL | const fn check(_: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/const-drop-fail-2.rs:21:36 | @@ -6,6 +12,6 @@ LL | const fn check(_: T) {} | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr index 9afa2072dde95..e95215d471566 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-fail.rs:24:26 + | +LL | const fn check(_: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/const-drop-fail.rs:24:36 | @@ -54,7 +60,7 @@ LL | | } | |_- in this macro invocation = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0080, E0493. For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr index 09ebf55c57c7a..f9bd9953fcfd3 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop-fail.rs:24:26 + | +LL | const fn check(_: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/const-drop-fail.rs:24:36 | @@ -6,6 +12,6 @@ LL | const fn check(_: T) {} | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr index 5ff3be713a7ca..6aace10589605 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop.rs:19:22 + | +LL | const fn a(_: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time --> $DIR/const-drop.rs:24:13 | @@ -86,7 +92,7 @@ LL | | } | |_- in this macro invocation = note: this error originates in the macro `implements_const_drop` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors Some errors have detailed explanations: E0080, E0493. For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr index 40e39cbefbc6d..18dd4543c3d39 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-drop.rs:19:22 + | +LL | const fn a(_: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time --> $DIR/const-drop.rs:24:13 | @@ -14,6 +20,6 @@ LL | const fn a(_: T) {} | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr index 03038eb5c84ad..af50a115c69f7 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr @@ -1,28 +1,244 @@ -error[E0277]: can't compare `()` with `()` - --> $DIR/const-impl-trait.rs:36:17 +error[E0635]: unknown feature `const_cmp` + --> $DIR/const-impl-trait.rs:8:5 | -LL | assert!(cmp(&())); - | --- ^^^ no implementation for `() == ()` +LL | const_cmp, + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:13:30 + | +LL | const fn cmp(a: &impl ~const PartialEq) -> bool { + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:17:30 + | +LL | const fn wrap(x: impl ~const PartialEq + ~const Destruct) + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:17:49 + | +LL | const fn wrap(x: impl ~const PartialEq + ~const Destruct) + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:18:20 + | +LL | -> impl ~const PartialEq + ~const Destruct + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:18:39 + | +LL | -> impl ~const PartialEq + ~const Destruct + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:18:20 + | +LL | -> impl ~const PartialEq + ~const Destruct + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:18:39 + | +LL | -> impl ~const PartialEq + ~const Destruct + | ^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:29:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { + | ^^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:29:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:29:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:29:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { + | ^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:50:41 + | +LL | const fn apit(_: impl ~const T + ~const Destruct) {} + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:54:73 + | +LL | const fn apit_assoc_bound(_: impl IntoIterator + ~const Destruct) {} + | ^^^^^^^^ + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:29 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-impl-trait.rs:25:48 + | +LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; + | ^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:37:26 + | +LL | assert!(wrap(123) == wrap(123)); + | ^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:37:26 + | +LL | assert!(wrap(123) == wrap(123)); + | ^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:37:13 + | +LL | assert!(wrap(123) == wrap(123)); + | ^^^^^^^^^ - value is dropped here | | - | required by a bound introduced by this call + | the destructor for this type cannot be evaluated in constants + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:37:13 | - = help: the trait `const PartialEq` is not implemented for `()` - = help: the trait `PartialEq` is implemented for `()` -note: required by a bound in `cmp` - --> $DIR/const-impl-trait.rs:13:23 +LL | assert!(wrap(123) == wrap(123)); + | ^^^^^^^^^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constants | -LL | const fn cmp(a: &impl ~const PartialEq) -> bool { - | ^^^^^^^^^^^^^^^^ required by this bound in `cmp` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:38:26 + | +LL | assert!(wrap(123) != wrap(456)); + | ^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:38:26 + | +LL | assert!(wrap(123) != wrap(456)); + | ^^^^^^^^^- value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:38:13 + | +LL | assert!(wrap(123) != wrap(456)); + | ^^^^^^^^^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + +error[E0493]: destructor of `impl PartialEq + Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:38:13 + | +LL | assert!(wrap(123) != wrap(456)); + | ^^^^^^^^^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constants + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0493]: destructor of `impl ~const T + ~const Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:50:15 + | +LL | const fn apit(_: impl ~const T + ~const Destruct) {} + | ^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions -error[E0369]: binary operation `==` cannot be applied to type `&impl ~const PartialEq` - --> $DIR/const-impl-trait.rs:14:7 +error[E0493]: destructor of `impl IntoIterator + ~const Destruct` cannot be evaluated at compile-time + --> $DIR/const-impl-trait.rs:54:27 | -LL | a == a - | - ^^ - &impl ~const PartialEq - | | - | &impl ~const PartialEq +LL | const fn apit_assoc_bound(_: impl IntoIterator + ~const Destruct) {} + | ^ - value is dropped here + | | + | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 2 previous errors +error: aborting due to 32 previous errors -Some errors have detailed explanations: E0277, E0369. -For more information about an error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0493, E0635. +For more information about an error, try `rustc --explain E0493`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr index 86dfc521fea72..82a971a36a8da 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr @@ -1,3 +1,9 @@ +error[E0635]: unknown feature `const_cmp` + --> $DIR/derive-const-use.rs:3:30 + | +LL | #![feature(const_trait_impl, const_cmp, const_default_impls, derive_const, effects)] + | ^^^^^^^^^ + error[E0635]: unknown feature `const_default_impls` --> $DIR/derive-const-use.rs:3:41 | @@ -22,6 +28,24 @@ LL | impl const Default for A { = 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: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/derive-const-use.rs:11:12 + | +LL | impl const PartialEq for A { + | ^^^^^^^^^ + | + = 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[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + --> $DIR/derive-const-use.rs:11:6 + | +LL | impl const PartialEq for A { + | ^^^^^ 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: const `impl` for trait `Default` which is not marked with `#[const_trait]` --> $DIR/derive-const-use.rs:15:16 | @@ -37,6 +61,22 @@ error[E0207]: the const parameter `host` is not constrained by the impl trait, s = 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: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/derive-const-use.rs:15:25 + | +LL | #[derive_const(Default, PartialEq)] + | ^^^^^^^^^ + | + = 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 + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + | + = 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 + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0284]: type annotations needed --> $DIR/derive-const-use.rs:18:35 | @@ -50,16 +90,17 @@ LL | #[derive_const(Default, PartialEq)] | ^^^^^^^ unsatisfied trait bound introduced in this `derive` macro = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0308]: mismatched types - --> $DIR/derive-const-use.rs:16:14 +error[E0284]: type annotations needed + --> $DIR/derive-const-use.rs:18:23 | -LL | #[derive_const(Default, PartialEq)] - | --------- in this derive macro expansion -LL | pub struct S((), A); - | ^^ expected `host`, found `true` +LL | const _: () = assert!(S((), A) == S::default()); + | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer the value of the constant `_` + | +note: required for `S` to implement `PartialEq` + --> $DIR/derive-const-use.rs:15:25 | - = note: expected constant `host` - found constant `true` +LL | #[derive_const(Default, PartialEq)] + | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0284]: type annotations needed @@ -79,7 +120,24 @@ LL | impl const Default for A { | unsatisfied trait bound introduced here = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 8 previous errors +error[E0284]: type annotations needed + --> $DIR/derive-const-use.rs:16:18 + | +LL | #[derive_const(Default, PartialEq)] + | --------- in this derive macro expansion +LL | pub struct S((), A); + | ^ cannot infer the value of the constant `_` + | +note: required for `A` to implement `PartialEq` + --> $DIR/derive-const-use.rs:11:12 + | +LL | impl const PartialEq for A { + | ----- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 14 previous errors -Some errors have detailed explanations: E0207, E0284, E0308, E0635. +Some errors have detailed explanations: E0207, E0284, E0635. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs index 0eb422728c631..c032c76d38f6d 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs @@ -1,4 +1,5 @@ -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass #![feature(derive_const)] #![feature(const_trait_impl, effects)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr new file mode 100644 index 0000000000000..0e7d826db5435 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr @@ -0,0 +1,40 @@ +error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` + --> $DIR/derive-const-with-params.rs:7:16 + | +LL | #[derive_const(PartialEq)] + | ^^^^^^^^^ + | + = 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 + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/derive-const-with-params.rs:7:16 + | +LL | #[derive_const(PartialEq)] + | ^^^^^^^^^ + | + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates + | + = 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[E0284]: type annotations needed + --> $DIR/derive-const-with-params.rs:11:5 + | +LL | a == b + | ^^^^^^ cannot infer the value of the constant `_` + | +note: required for `Reverse` to implement `PartialEq` + --> $DIR/derive-const-with-params.rs:7:16 + | +LL | #[derive_const(PartialEq)] + | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0207, E0284. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs index 21197fcaa273a..306770fc245b9 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs @@ -3,14 +3,13 @@ const fn test() -> impl ~const Fn() { //~^ ERROR `~const` can only be applied to `#[const_trait]` traits //~| ERROR `~const` can only be applied to `#[const_trait]` traits - //~| ERROR cycle detected const move || { //~ ERROR const closures are experimental let sl: &[u8] = b"foo"; match sl { [first, remainder @ ..] => { assert_eq!(first, &b'f'); - //~^ ERROR can't compare `&u8` with `&u8` + //~^ ERROR cannot call non-const fn } [] => panic!(), } diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr index 2f8051109173d..e15f697b29e9f 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr @@ -1,5 +1,5 @@ error[E0658]: const closures are experimental - --> $DIR/ice-112822-expected-type-for-param.rs:7:5 + --> $DIR/ice-112822-expected-type-for-param.rs:6:5 | LL | const move || { | ^^^^^ @@ -22,47 +22,16 @@ LL | const fn test() -> impl ~const Fn() { | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0277]: can't compare `&u8` with `&u8` - --> $DIR/ice-112822-expected-type-for-param.rs:12:17 +error[E0015]: cannot call non-const fn `core::panicking::assert_failed::<&u8, &u8>` in constant functions + --> $DIR/ice-112822-expected-type-for-param.rs:11:17 | LL | assert_eq!(first, &b'f'); - | ^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `&u8 == &u8` + | ^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: the trait `~const PartialEq<&u8>` is not implemented for `&u8` + = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0391]: cycle detected when computing type of opaque `test::{opaque#0}` - --> $DIR/ice-112822-expected-type-for-param.rs:3:20 - | -LL | const fn test() -> impl ~const Fn() { - | ^^^^^^^^^^^^^^^^ - | -note: ...which requires borrow-checking `test`... - --> $DIR/ice-112822-expected-type-for-param.rs:3:1 - | -LL | const fn test() -> impl ~const Fn() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires promoting constants in MIR for `test`... - --> $DIR/ice-112822-expected-type-for-param.rs:3:1 - | -LL | const fn test() -> impl ~const Fn() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires const checking `test`... - --> $DIR/ice-112822-expected-type-for-param.rs:3:1 - | -LL | const fn test() -> impl ~const Fn() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which requires computing whether `test::{opaque#0}` is freeze... - = note: ...which requires evaluating trait selection obligation `test::{opaque#0}: core::marker::Freeze`... - = note: ...which again requires computing type of opaque `test::{opaque#0}`, completing the cycle -note: cycle used when computing type of `test::{opaque#0}` - --> $DIR/ice-112822-expected-type-for-param.rs:3:20 - | -LL | const fn test() -> impl ~const Fn() { - | ^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0277, E0391, E0658. -For more information about an error, try `rustc --explain E0277`. +Some errors have detailed explanations: E0015, E0658. +For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs index 281cfdaef28cc..af88a73b4d692 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs @@ -1,4 +1,6 @@ -//@ check-pass +//@ known-bug: #110395 +// FIXME(effects) check-pass +// FIXME(effects) fix intrinsics const parameter counting #![crate_type = "lib"] #![feature(no_core, lang_items, unboxed_closures, auto_traits, intrinsics, rustc_attrs, staged_api)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr new file mode 100644 index 0000000000000..d9450216dacb5 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr @@ -0,0 +1,9 @@ +error[E0094]: intrinsic has wrong number of const parameters: found 1, expected 0 + --> $DIR/minicore.rs:517:27 + | +LL | const fn const_eval_select( + | ^^^^^^^^^^^^^^^^^^^^^^^ expected 0 const parameters + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0094`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs new file mode 100644 index 0000000000000..482a1aef06b57 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs @@ -0,0 +1,18 @@ +//@ edition: 2021 +#![feature(effects)] + +trait MyTrait {} + +impl MyTrait for i32 { + async const fn bar(&self) { + //~^ ERROR expected one of `extern` + //~| ERROR functions in trait impls cannot be declared const + //~| ERROR functions cannot be both `const` and `async` + //~| ERROR method `bar` is not a member + //~| ERROR cycle detected when computing type + main8().await; + //~^ ERROR cannot find function + } +} + +fn main() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr new file mode 100644 index 0000000000000..1110b799c6c47 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr @@ -0,0 +1,92 @@ +error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const` + --> $DIR/ice-120503-async-const-method.rs:7:11 + | +LL | async const fn bar(&self) { + | ------^^^^^ + | | | + | | expected one of `extern`, `fn`, `safe`, or `unsafe` + | help: `const` must come before `async`: `const async` + | + = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` + +error[E0379]: functions in trait impls cannot be declared const + --> $DIR/ice-120503-async-const-method.rs:7:11 + | +LL | async const fn bar(&self) { + | ^^^^^- + | | + | functions in trait impls cannot be const + | help: remove the `const` + +error: functions cannot be both `const` and `async` + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | -^^^^ ^^^^^ `const` because of this + | | + | _____`async` because of this + | | +LL | | +LL | | +LL | | +... | +LL | | +LL | | } + | |_____- + +error[E0407]: method `bar` is not a member of trait `MyTrait` + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | / async const fn bar(&self) { +LL | | +LL | | +LL | | +... | +LL | | +LL | | } + | |_____^ not a member of trait `MyTrait` + +error[E0425]: cannot find function `main8` in this scope + --> $DIR/ice-120503-async-const-method.rs:13:9 + | +LL | main8().await; + | ^^^^^ help: a function with a similar name exists: `main` +... +LL | fn main() {} + | --------- similarly named function `main` defined here + +error[E0391]: cycle detected when computing type of opaque `::bar::{opaque#0}` + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: ...which requires borrow-checking `::bar`... + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...which requires promoting constants in MIR for `::bar`... + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...which requires const checking `::bar`... + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires computing whether `::bar::{opaque#0}` is freeze... + = note: ...which requires evaluating trait selection obligation `::bar::{opaque#0}: core::marker::Freeze`... + = note: ...which again requires computing type of opaque `::bar::{opaque#0}`, completing the cycle +note: cycle used when computing type of `::bar::{opaque#0}` + --> $DIR/ice-120503-async-const-method.rs:7:5 + | +LL | async const fn bar(&self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0379, E0391, E0407, E0425. +For more information about an error, try `rustc --explain E0379`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs new file mode 100644 index 0000000000000..fee0a2073e8dd --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs @@ -0,0 +1,17 @@ +#![feature(const_trait_impl, effects)] + +pub struct Vec3; + +#[const_trait] +pub trait Add { + fn add(self) -> Vec3; +} + +impl Add for Vec3 { + const fn add(self) -> Vec3 { + //~^ ERROR functions in trait impls cannot be declared const + self + } +} + +fn main() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr new file mode 100644 index 0000000000000..408958abf6307 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr @@ -0,0 +1,19 @@ +error[E0379]: functions in trait impls cannot be declared const + --> $DIR/ice-121536-const-method.rs:11:5 + | +LL | const fn add(self) -> Vec3 { + | ^^^^^ functions in trait impls cannot be const + | +help: remove the `const` ... + | +LL - const fn add(self) -> Vec3 { +LL + fn add(self) -> Vec3 { + | +help: ... and declare the impl to be const instead + | +LL | impl const Add for Vec3 { + | +++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0379`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr index 2edaca606235b..ecc994a3fe658 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr @@ -1,3 +1,9 @@ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/issue-92111.rs:20:22 + | +LL | const fn a(t: T) {} + | ^^^^^^^^ + error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/issue-92111.rs:20:32 | @@ -6,6 +12,6 @@ LL | const fn a(t: T) {} | | | the destructor for this type cannot be evaluated in constant functions -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0493`. diff --git a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr index 5b8a49d22c739..a0430240dc43b 100644 --- a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -11,19 +11,6 @@ LL | >::add(1, 2); `i32` implements `Add<&i32>` `i32` implements `Add` -error[E0277]: cannot add `u32` to `i32` - --> $DIR/ufcs-qpath-self-mismatch.rs:4:5 - | -LL | >::add(1, 2); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32` - | - = help: the trait `Add` is not implemented for `i32` - = help: the following other types implement trait `Add`: - `&'a i32` implements `Add` - `&i32` implements `Add<&i32>` - `i32` implements `Add<&i32>` - `i32` implements `Add` - error[E0308]: mismatched types --> $DIR/ufcs-qpath-self-mismatch.rs:7:28 | @@ -68,6 +55,19 @@ help: change the type of the numeric literal from `u32` to `i32` LL | >::add(1, 2i32); | ~~~ +error[E0277]: cannot add `u32` to `i32` + --> $DIR/ufcs-qpath-self-mismatch.rs:4:5 + | +LL | >::add(1, 2); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32` + | + = help: the trait `Add` is not implemented for `i32` + = help: the following other types implement trait `Add`: + `&'a i32` implements `Add` + `&i32` implements `Add<&i32>` + `i32` implements `Add<&i32>` + `i32` implements `Add` + error: aborting due to 4 previous errors Some errors have detailed explanations: E0277, E0308. From 81da6a6d400ee333b397d47abe33da64d959e0e5 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Fri, 21 Jun 2024 12:22:29 +0000 Subject: [PATCH 4/4] Make `effects` an incomplete feature --- compiler/rustc_feature/src/unstable.rs | 2 +- .../src/language-features/intrinsics.md | 4 ++-- .../tests/fail/intrinsic_fallback_is_spec.rs | 2 +- tests/rustdoc/const-effect-param.rs | 1 + tests/rustdoc/const-fn-effects.rs | 1 + tests/rustdoc/rfc-2632-const-trait-impl.rs | 21 ++++++++++--------- .../const_trait_fn-issue-88433.rs | 2 +- .../const_trait_fn-issue-88433.stderr | 11 ++++++++++ .../auxiliary/closure-in-foreign-crate.rs | 2 +- tests/ui/consts/const-float-classify.stderr | 11 +++++++++- tests/ui/consts/const_cmp_type_id.stderr | 11 +++++++++- .../consts/rustc-impl-const-stability.stderr | 11 +++++++++- .../impls-nested-within-fns-semantic-1.rs | 2 +- .../impls-nested-within-fns-semantic-1.stderr | 11 ++++++++++ ...-type-const-bound-usage-0.qualified.stderr | 11 +++++++++- .../assoc-type-const-bound-usage-0.rs | 2 +- ...ype-const-bound-usage-0.unqualified.stderr | 11 ++++++++++ .../rfc-2632-const-trait-impl/assoc-type.rs | 2 +- .../assoc-type.stderr | 11 +++++++++- .../auxiliary/cross-crate.rs | 2 +- .../auxiliary/staged-api.rs | 2 +- .../call-const-trait-method-fail.rs | 2 +- .../call-const-trait-method-fail.stderr | 11 +++++++++- .../call-generic-method-chain.stderr | 11 +++++++++- .../call-generic-method-dup-bound.stderr | 11 +++++++++- .../call-generic-method-fail.rs | 2 +- .../call-generic-method-fail.stderr | 11 ++++++++++ .../call-generic-method-nonconst.rs | 2 +- .../call-generic-method-nonconst.stderr | 11 +++++++++- .../call-generic-method-pass.stderr | 11 +++++++++- .../const-bounds-non-const-trait.rs | 2 +- .../const-bounds-non-const-trait.stderr | 11 +++++++++- .../const-check-fns-in-const-impl.rs | 2 +- .../const-check-fns-in-const-impl.stderr | 11 +++++++++- .../const-default-method-bodies.rs | 2 +- .../const-default-method-bodies.stderr | 11 +++++++++- .../const-fns-are-early-bound.rs | 2 +- .../const-fns-are-early-bound.stderr | 11 ++++++++++ .../const-impl-requires-const-trait.stderr | 11 +++++++++- .../const-trait-bounds-trait-objects.rs | 2 +- .../const-trait-bounds-trait-objects.stderr | 11 +++++++++- .../derive-const-non-const-type.stderr | 11 +++++++++- .../const_derives/derive-const-use.stderr | 11 +++++++++- .../derive-const-with-params.stderr | 11 +++++++++- ...ross-crate-default-method-body-is-const.rs | 2 +- ...-crate-default-method-body-is-const.stderr | 11 ++++++++++ .../cross-crate.gated.stderr | 11 ++++++++++ .../cross-crate.gatednc.stderr | 13 ++++++++++-- .../rfc-2632-const-trait-impl/cross-crate.rs | 1 + .../cross-crate.stock.stderr | 2 +- .../cross-crate.stocknc.stderr | 4 ++-- ...ault-method-body-is-const-same-trait-ck.rs | 2 +- ...-method-body-is-const-same-trait-ck.stderr | 11 +++++++++- .../do-not-const-check-override.rs | 2 +- .../do-not-const-check-override.stderr | 11 ++++++++++ .../effects/auxiliary/cross-crate.rs | 2 +- .../effects/effect-param-infer.rs | 2 +- .../effects/effect-param-infer.stderr | 11 ++++++++++ .../effects/fallback.rs | 2 +- .../effects/fallback.stderr | 11 ++++++++++ .../effects/helloworld.rs | 7 ++++++- .../effects/helloworld.stderr | 11 ++++++++++ .../ice-112822-expected-type-for-param.rs | 2 +- .../ice-112822-expected-type-for-param.stderr | 11 +++++++++- .../effects/infer-fallback.rs | 2 +- .../effects/infer-fallback.stderr | 11 ++++++++++ .../effects/minicore.stderr | 11 +++++++++- .../effects/no-explicit-const-params.rs | 2 +- .../effects/no-explicit-const-params.stderr | 11 +++++++++- .../effects/project.stderr | 11 +++++++++- .../effects/span-bug-issue-121418.rs | 2 +- .../effects/span-bug-issue-121418.stderr | 11 +++++++++- .../effects/spec-effectvar-ice.rs | 2 +- .../effects/spec-effectvar-ice.stderr | 11 +++++++++- .../effects/trait-fn-const.rs | 2 +- .../effects/trait-fn-const.stderr | 11 +++++++++- .../hir-const-check.rs | 2 +- .../hir-const-check.stderr | 11 +++++++++- .../ice-120503-async-const-method.rs | 2 +- .../ice-120503-async-const-method.stderr | 11 +++++++++- .../ice-121536-const-method.rs | 2 +- .../ice-121536-const-method.stderr | 11 +++++++++- .../rfc-2632-const-trait-impl/issue-79450.rs | 2 +- .../issue-79450.stderr | 11 +++++++++- .../const-default-const-specialized.rs | 2 +- .../const-default-const-specialized.stderr | 11 ++++++++++ ...default-impl-non-const-specialized-impl.rs | 2 +- ...ult-impl-non-const-specialized-impl.stderr | 11 +++++++++- ...non-const-default-const-specialized.stderr | 11 +++++++++- .../specializing-constness-2.stderr | 11 +++++++++- .../specializing-constness.rs | 2 +- .../specializing-constness.stderr | 11 +++++++++- .../rfc-2632-const-trait-impl/staged-api.rs | 2 +- .../staged-api.stable.stderr | 11 +++++++++- .../staged-api.unstable.stderr | 11 +++++++++- .../super-traits-fail-2.nn.stderr | 11 +++++++++- .../super-traits-fail-2.ny.stderr | 11 +++++++++- .../super-traits-fail-2.rs | 2 +- .../super-traits-fail-2.yn.stderr | 11 +++++++++- .../super-traits-fail-2.yy.stderr | 11 +++++++++- .../super-traits-fail-3.nn.stderr | 11 +++++++++- .../super-traits-fail-3.ny.stderr | 11 +++++++++- .../super-traits-fail-3.rs | 2 +- .../super-traits-fail-3.yn.stderr | 11 +++++++++- .../super-traits-fail-3.yy.stderr | 11 ++++++++++ .../rfc-2632-const-trait-impl/super-traits.rs | 2 +- .../super-traits.stderr | 11 ++++++++++ .../tilde-const-assoc-fn-in-trait-impl.rs | 2 +- .../tilde-const-assoc-fn-in-trait-impl.stderr | 11 ++++++++++ .../tilde-const-inherent-assoc-const-fn.rs | 2 +- ...tilde-const-inherent-assoc-const-fn.stderr | 11 ++++++++++ .../tilde-const-trait-assoc-tys.rs | 2 +- .../tilde-const-trait-assoc-tys.stderr | 11 ++++++++++ .../trait-default-body-stability.stderr | 11 +++++++++- .../trait-where-clause-const.stderr | 11 +++++++++- .../trait-where-clause-run.rs | 2 +- .../trait-where-clause-run.stderr | 11 ++++++++++ .../trait-where-clause-self-referential.rs | 2 +- ...trait-where-clause-self-referential.stderr | 11 ++++++++++ .../missing-const-stability.rs | 2 +- .../missing-const-stability.stderr | 11 +++++++++- .../next-solver/canonical/effect-var.rs | 2 +- .../next-solver/canonical/effect-var.stderr | 11 ++++++++++ 123 files changed, 774 insertions(+), 111 deletions(-) create mode 100644 tests/ui/const-generics/const_trait_fn-issue-88433.stderr create mode 100644 tests/ui/parser/impls-nested-within-fns-semantic-1.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.unqualified.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gated.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yy.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.stderr create mode 100644 tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.stderr create mode 100644 tests/ui/traits/next-solver/canonical/effect-var.stderr diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 45527bec2f2ef..fbd67657e3b4c 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -449,7 +449,7 @@ declare_features! ( /// Allows `dyn* Trait` objects. (incomplete, dyn_star, "1.65.0", Some(102425)), /// Uses generic effect parameters for ~const bounds - (unstable, effects, "1.72.0", Some(102090)), + (incomplete, effects, "1.72.0", Some(102090)), /// Allows exhaustive pattern matching on types that contain uninhabited types. (unstable, exhaustive_patterns, "1.13.0", Some(51085)), /// Allows explicit tail calls via `become` expression. diff --git a/src/doc/unstable-book/src/language-features/intrinsics.md b/src/doc/unstable-book/src/language-features/intrinsics.md index 02a009d56d38c..c262d3f6da1f7 100644 --- a/src/doc/unstable-book/src/language-features/intrinsics.md +++ b/src/doc/unstable-book/src/language-features/intrinsics.md @@ -18,7 +18,7 @@ All intrinsic fallback bodies are automatically made cross-crate inlineable (lik by the codegen backend, but not the MIR inliner. ```rust -#![feature(rustc_attrs, effects)] +#![feature(rustc_attrs)] #![allow(internal_features)] #[rustc_intrinsic] @@ -28,7 +28,7 @@ const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {} Since these are just regular functions, it is perfectly ok to create the intrinsic twice: ```rust -#![feature(rustc_attrs, effects)] +#![feature(rustc_attrs)] #![allow(internal_features)] #[rustc_intrinsic] diff --git a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs index 888c548e49b5b..fa7c0bf5c0cbe 100644 --- a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs +++ b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs @@ -1,4 +1,4 @@ -#![feature(rustc_attrs, effects)] +#![feature(rustc_attrs)] #[rustc_intrinsic] #[rustc_nounwind] diff --git a/tests/rustdoc/const-effect-param.rs b/tests/rustdoc/const-effect-param.rs index b6379c05a8592..f3f1fcfda6594 100644 --- a/tests/rustdoc/const-effect-param.rs +++ b/tests/rustdoc/const-effect-param.rs @@ -2,6 +2,7 @@ #![crate_name = "foo"] #![feature(effects, const_trait_impl)] +#![allow(incomplete_features)] #[const_trait] pub trait Tr { diff --git a/tests/rustdoc/const-fn-effects.rs b/tests/rustdoc/const-fn-effects.rs index 7c19b4b2c0cf6..c495a4faa873c 100644 --- a/tests/rustdoc/const-fn-effects.rs +++ b/tests/rustdoc/const-fn-effects.rs @@ -1,5 +1,6 @@ #![crate_name = "foo"] #![feature(effects)] +#![allow(incomplete_features)] // @has foo/fn.bar.html // @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> ' diff --git a/tests/rustdoc/rfc-2632-const-trait-impl.rs b/tests/rustdoc/rfc-2632-const-trait-impl.rs index 6f264969e54ce..d165a406f564c 100644 --- a/tests/rustdoc/rfc-2632-const-trait-impl.rs +++ b/tests/rustdoc/rfc-2632-const-trait-impl.rs @@ -7,6 +7,7 @@ // not remove this test. // // FIXME(effects) add `const_trait` to `Fn` so we use `~const` +// FIXME(effects) restore `const_trait` to `Destruct` #![feature(const_trait_impl)] #![crate_name = "foo"] @@ -24,9 +25,9 @@ pub trait Tr { // @has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' // @!has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const' // @has - '//section[@id="method.a"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' - fn a() + fn a() where - Option: /* ~const */ Fn() + ~const Destruct, + Option: /* ~const */ Fn() /* + ~const Destruct */, { } } @@ -36,13 +37,13 @@ pub trait Tr { // @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Fn' // @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const' // @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/div[@class="where"]' ': Fn' -impl const Tr for T +impl const Tr for T where - Option: /* ~const */ Fn() + ~const Destruct, + Option: /* ~const */ Fn() /* + ~const Destruct */, { - fn a() + fn a() where - Option: /* ~const */ Fn() + ~const Destruct, + Option: /* ~const */ Fn() /* + ~const Destruct */, { } } @@ -51,9 +52,9 @@ where // @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn' // @!has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' '~const' // @has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' ': Fn' -pub const fn foo() +pub const fn foo() where - Option: /* ~const */ Fn() + ~const Destruct, + Option: /* ~const */ Fn() /* + ~const Destruct */, { F::a() } @@ -63,9 +64,9 @@ impl S { // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const' // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' - pub const fn foo() + pub const fn foo() where - B: /* ~const */ Fn() + ~const Destruct, + B: /* ~const */ Fn() /* + ~const Destruct */, { B::a() } diff --git a/tests/ui/const-generics/const_trait_fn-issue-88433.rs b/tests/ui/const-generics/const_trait_fn-issue-88433.rs index 89bcd54c46186..cd008aa2c9f2d 100644 --- a/tests/ui/const-generics/const_trait_fn-issue-88433.rs +++ b/tests/ui/const-generics/const_trait_fn-issue-88433.rs @@ -1,6 +1,6 @@ //@ build-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Func { diff --git a/tests/ui/const-generics/const_trait_fn-issue-88433.stderr b/tests/ui/const-generics/const_trait_fn-issue-88433.stderr new file mode 100644 index 0000000000000..4e0d6370fbd50 --- /dev/null +++ b/tests/ui/const-generics/const_trait_fn-issue-88433.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const_trait_fn-issue-88433.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/consts/auxiliary/closure-in-foreign-crate.rs b/tests/ui/consts/auxiliary/closure-in-foreign-crate.rs index 8adf3ba433d96..eb58233d1b1f8 100644 --- a/tests/ui/consts/auxiliary/closure-in-foreign-crate.rs +++ b/tests/ui/consts/auxiliary/closure-in-foreign-crate.rs @@ -1,5 +1,5 @@ #![crate_type = "lib"] -#![feature(const_closures, const_trait_impl, effects)] +#![feature(const_closures, const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete pub const fn test() { let cl = const || {}; diff --git a/tests/ui/consts/const-float-classify.stderr b/tests/ui/consts/const-float-classify.stderr index 9ecd7b83681e1..1de27a072cf73 100644 --- a/tests/ui/consts/const-float-classify.stderr +++ b/tests/ui/consts/const-float-classify.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-float-classify.rs:7:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/const-float-classify.rs:12:12 | @@ -208,7 +217,7 @@ LL | impl const PartialEq for bool { | unsatisfied trait bound introduced here = note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 10 previous errors +error: aborting due to 10 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr index f9628e5443b8d..e0e673d5fbdcf 100644 --- a/tests/ui/consts/const_cmp_type_id.stderr +++ b/tests/ui/consts/const_cmp_type_id.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const_cmp_type_id.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0131]: `main` function is not allowed to have generic parameters --> $DIR/const_cmp_type_id.rs:7:14 | @@ -10,7 +19,7 @@ error[E0080]: evaluation of constant value failed LL | const _A: bool = TypeId::of::() < TypeId::of::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `::lt` -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted Some errors have detailed explanations: E0080, E0131. For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/rustc-impl-const-stability.stderr b/tests/ui/consts/rustc-impl-const-stability.stderr index ba8e6c1555ce2..250d1c3fc0553 100644 --- a/tests/ui/consts/rustc-impl-const-stability.stderr +++ b/tests/ui/consts/rustc-impl-const-stability.stderr @@ -1,3 +1,12 @@ +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 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 | @@ -16,6 +25,6 @@ LL | impl const Default for Data { = 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 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0207`. diff --git a/tests/ui/parser/impls-nested-within-fns-semantic-1.rs b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs index 43530e41a66c1..0e95fc757f3e8 100644 --- a/tests/ui/parser/impls-nested-within-fns-semantic-1.rs +++ b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs @@ -1,7 +1,7 @@ // Regression test for part of issue #119924. //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Trait { diff --git a/tests/ui/parser/impls-nested-within-fns-semantic-1.stderr b/tests/ui/parser/impls-nested-within-fns-semantic-1.stderr new file mode 100644 index 0000000000000..6670b3772db12 --- /dev/null +++ b/tests/ui/parser/impls-nested-within-fns-semantic-1.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/impls-nested-within-fns-semantic-1.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.qualified.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.qualified.stderr index 62c8a442ab9bd..3aec4383eab3a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.qualified.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.qualified.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/assoc-type-const-bound-usage-0.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `T: Trait` is not satisfied --> $DIR/assoc-type-const-bound-usage-0.rs:21:6 | @@ -9,6 +18,6 @@ help: consider further restricting this bound LL | const fn qualified() -> i32 { | +++++++ -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.rs index 6b55e82629bbc..eecd6e6109c1e 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.rs @@ -3,7 +3,7 @@ //@[unqualified] check-pass //@[qualified] known-bug: unknown -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //[unqualified]~ WARN the feature `effects` is incomplete #[const_trait] trait Trait { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.unqualified.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.unqualified.stderr new file mode 100644 index 0000000000000..3d592834600e0 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.unqualified.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/assoc-type-const-bound-usage-0.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs index 886fa6577d76c..645fff4e01471 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs @@ -1,5 +1,5 @@ // FIXME(effects): Replace `Add` with `std::ops::Add` once the latter a `#[const_trait]` again. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Add { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr index a9cae2a70be90..cc3abea25eb56 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/assoc-type.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied --> $DIR/assoc-type.rs:35:16 | @@ -11,6 +20,6 @@ note: required by a bound in `Foo::Bar` LL | type Bar: ~const Add; | ^^^^^^^^^^ required by this bound in `Foo::Bar` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs index f40dc27cb4c6f..62609384cff08 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] pub trait MyTrait { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs index 687cb128b05be..fd4e1ff803da6 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #![feature(staged_api)] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs index 771c35cf6ab9d..bb9e9045f8fb5 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] pub trait Plus { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr index 93d520f29ef28..0e4dcf0f3026a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-const-trait-method-fail.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `u32: ~const Plus` is not satisfied --> $DIR/call-const-trait-method-fail.rs:25:5 | @@ -6,6 +15,6 @@ LL | a.plus(b) | = help: the trait `Plus` is implemented for `u32` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr index 4b0d304c5bee2..36c7a6544305b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-generic-method-chain.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/call-generic-method-chain.rs:10:12 | @@ -56,7 +65,7 @@ LL | impl const PartialEq for S { | | | unsatisfied trait bound introduced here -error: aborting due to 6 previous errors +error: aborting due to 6 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr index 69f7029516091..320e420b80a30 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-generic-method-dup-bound.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/call-generic-method-dup-bound.rs:8:12 | @@ -70,7 +79,7 @@ LL | impl const PartialEq for S { | | | unsatisfied trait bound introduced here -error: aborting due to 7 previous errors +error: aborting due to 7 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs index cc5f218ae2def..a9ed5a639d73a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete pub const fn equals_self(t: &T) -> bool { *t == *t diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr new file mode 100644 index 0000000000000..74b74052da079 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-generic-method-fail.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs index 8d6176a5bace4..222bff2db8807 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete struct S; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr index 3581b1fcd7dfb..fa59e5ee03dd0 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-generic-method-nonconst.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `S: const Foo` is not satisfied --> $DIR/call-generic-method-nonconst.rs:23:34 | @@ -13,6 +22,6 @@ note: required by a bound in `equals_self` LL | const fn equals_self(t: &T) -> bool { | ^^^^^^^^^^ required by this bound in `equals_self` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr index 1bba23e2892ee..6b9d290839e5f 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/call-generic-method-pass.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/call-generic-method-pass.rs:10:12 | @@ -50,7 +59,7 @@ LL | impl const PartialEq for S { | | | unsatisfied trait bound introduced here -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.rs index 3582e5e050c98..db446f8bc2eab 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.rs @@ -1,5 +1,5 @@ // Regression test for issue #117244. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete trait NonConst {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.stderr index 08954987d3192..d04e5490b7639 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-bounds-non-const-trait.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/const-bounds-non-const-trait.rs:6:28 | @@ -10,5 +19,5 @@ error: `const` can only be applied to `#[const_trait]` traits LL | fn operate() {} | ^^^^^^^^ -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs index 4854f41bf04f4..a1710e6525292 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete struct S; #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr index ae035b26ec582..d93327cea1b2c 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-check-fns-in-const-impl.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0015]: cannot call non-const fn `non_const` in constant functions --> $DIR/const-check-fns-in-const-impl.rs:12:16 | @@ -6,6 +15,6 @@ LL | fn foo() { non_const() } | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs index be668b4f13a85..2fd58b05178c2 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait ConstDefaultFn: Sized { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr index f39e6dcadbaa6..8e04d0bd20da0 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-default-method-bodies.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satisfied --> $DIR/const-default-method-bodies.rs:24:18 | @@ -6,6 +15,6 @@ LL | NonConstImpl.a(); | = help: the trait `ConstDefaultFn` is implemented for `NonConstImpl` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs index f6bba19a19eae..faa913c759884 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs @@ -7,7 +7,7 @@ #![feature( auto_traits, const_trait_impl, - effects, + effects, //~ WARN the feature `effects` is incomplete lang_items, no_core, staged_api, diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.stderr new file mode 100644 index 0000000000000..42b19fce28e9c --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-fns-are-early-bound.rs:10:5 + | +LL | effects, + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr index d20404e63b3fb..fb282d9ee2b47 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-impl-requires-const-trait.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `A` which is not marked with `#[const_trait]` --> $DIR/const-impl-requires-const-trait.rs:8:12 | @@ -19,6 +28,6 @@ LL | impl const A for () {} = 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 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.rs index 79719dae44f7c..8e71fa4d51902 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete //@ edition: 2021 #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.stderr index 04c2dc2e2e0fd..7d774bef0e94a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds-trait-objects.stderr @@ -26,5 +26,14 @@ LL | const fn take(_: &dyn ~const NonConst) {} | = note: trait objects cannot have `~const` trait bounds -error: aborting due to 4 previous errors +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-trait-bounds-trait-objects.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr index 4b009446dbc00..1e091283510d6 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/derive-const-non-const-type.rs:2:26 + | +LL | #![feature(derive_const, effects)] + | ^^^^^^^ + | + = note: see issue #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/derive-const-non-const-type.rs:10:16 | @@ -13,6 +22,6 @@ error[E0207]: the const parameter `host` is not constrained by the impl trait, s = 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 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr index 82a971a36a8da..925b2c58ed77b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/derive-const-use.rs:3:76 + | +LL | #![feature(const_trait_impl, const_cmp, const_default_impls, derive_const, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0635]: unknown feature `const_cmp` --> $DIR/derive-const-use.rs:3:30 | @@ -137,7 +146,7 @@ LL | impl const PartialEq for A { | unsatisfied trait bound introduced here = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 14 previous errors +error: aborting due to 14 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284, E0635. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr index 0e7d826db5435..5d3aa250d1854 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/derive-const-with-params.rs:5:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]` --> $DIR/derive-const-with-params.rs:7:16 | @@ -34,7 +43,7 @@ LL | #[derive_const(PartialEq)] | ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 4 previous errors +error: aborting due to 4 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs index 54e5c95c259ff..d8be8b13d0822 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs @@ -3,7 +3,7 @@ // //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete //@ aux-build: cross-crate.rs extern crate cross_crate; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.stderr new file mode 100644 index 0000000000000..2f1e1e6b8d2b9 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/cross-crate-default-method-body-is-const.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gated.stderr new file mode 100644 index 0000000000000..2ce29a74eaeb0 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gated.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/cross-crate.rs:3:60 + | +LL | #![cfg_attr(any(gated, gatednc), feature(const_trait_impl, effects))] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr index f0ac953fd5d20..ddb5b3c7c5078 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr @@ -1,11 +1,20 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/cross-crate.rs:3:60 + | +LL | #![cfg_attr(any(gated, gatednc), feature(const_trait_impl, effects))] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrait` is not satisfied - --> $DIR/cross-crate.rs:17:14 + --> $DIR/cross-crate.rs:18:14 | LL | NonConst.func(); | ^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst` | = help: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs index 587dd70c18b29..04c101d0fc5fb 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs @@ -1,6 +1,7 @@ //@ revisions: stock gated stocknc gatednc //@ [gated] check-pass #![cfg_attr(any(gated, gatednc), feature(const_trait_impl, effects))] +//[gated,gatednc]~^ WARN the feature `effects` is incomplete //@ aux-build: cross-crate.rs extern crate cross_crate; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr index a0c50ac7e61b4..3df875057f2c8 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr @@ -1,5 +1,5 @@ error[E0015]: cannot call non-const fn `::func` in constant functions - --> $DIR/cross-crate.rs:20:11 + --> $DIR/cross-crate.rs:21:11 | LL | Const.func(); | ^^^^^^ diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr index 312818ae6313e..e56a5e4165ce3 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr @@ -1,5 +1,5 @@ error[E0015]: cannot call non-const fn `::func` in constant functions - --> $DIR/cross-crate.rs:17:14 + --> $DIR/cross-crate.rs:18:14 | LL | NonConst.func(); | ^^^^^^ @@ -11,7 +11,7 @@ LL + #![feature(const_trait_impl)] | error[E0015]: cannot call non-const fn `::func` in constant functions - --> $DIR/cross-crate.rs:20:11 + --> $DIR/cross-crate.rs:21:11 | LL | Const.func(); | ^^^^^^ diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs index da27724007d27..64f23824b397d 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] pub trait Tr { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr index 29db6109a98c4..67a936d0882f4 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/default-method-body-is-const-same-trait-ck.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `(): ~const Tr` is not satisfied --> $DIR/default-method-body-is-const-same-trait-ck.rs:8:12 | @@ -6,6 +15,6 @@ LL | ().a() | = help: the trait `Tr` is implemented for `()` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs index 8b51f65fd04ff..be5e66478dfaf 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(const_trait_impl, rustc_attrs, effects)] +#![feature(const_trait_impl, rustc_attrs, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Foo { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.stderr new file mode 100644 index 0000000000000..4be1160b58cb2 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/do-not-const-check-override.rs:2:43 + | +LL | #![feature(const_trait_impl, rustc_attrs, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/auxiliary/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/auxiliary/cross-crate.rs index a74c50cc8fa47..5c32eee8737e8 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/auxiliary/cross-crate.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/auxiliary/cross-crate.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete pub const fn foo() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs index d35e9bb7f1efd..b354591e0070f 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs @@ -3,7 +3,7 @@ // //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] pub trait Foo { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.stderr new file mode 100644 index 0000000000000..7ceb3669e5983 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/effect-param-infer.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.rs index aa75aa9c989d6..d949e4b829fc4 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(effects)] +#![feature(effects)] //~ WARN the feature `effects` is incomplete pub const fn owo() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.stderr new file mode 100644 index 0000000000000..f7d5de829b200 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/fallback.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/fallback.rs:3:12 + | +LL | #![feature(effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs index 502062a559c11..eed8cdc447c55 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.rs @@ -3,7 +3,12 @@ // gate-test-effects // ^ effects doesn't have a gate so we will trick tidy into thinking this is a gate test -#![feature(const_trait_impl, effects, core_intrinsics, const_eval_select)] +#![feature( + const_trait_impl, + effects, //~ WARN the feature `effects` is incomplete + core_intrinsics, + const_eval_select +)] // ensure we are passing in the correct host effect in always const contexts. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.stderr new file mode 100644 index 0000000000000..8719c5cbcef0f --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/helloworld.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/helloworld.rs:8:5 + | +LL | effects, + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs index 306770fc245b9..9a9016de3a0d9 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete const fn test() -> impl ~const Fn() { //~^ ERROR `~const` can only be applied to `#[const_trait]` traits diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr index e15f697b29e9f..3f0ed13d665f8 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr @@ -8,6 +8,15 @@ LL | const move || { = help: add `#![feature(const_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/ice-112822-expected-type-for-param.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/ice-112822-expected-type-for-param.rs:3:32 | @@ -31,7 +40,7 @@ LL | assert_eq!(first, &b'f'); = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 4 previous errors +error: aborting due to 4 previous errors; 1 warning emitted Some errors have detailed explanations: E0015, E0658. For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.rs index 85aabe46640e7..ff3a27c3ee479 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete const fn a() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.stderr new file mode 100644 index 0000000000000..49c7d3958466a --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/infer-fallback.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/infer-fallback.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr index d9450216dacb5..e4a5f3686084e 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr @@ -1,9 +1,18 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/minicore.rs:8:30 + | +LL | #![feature(const_trait_impl, effects, const_mut_refs)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0094]: intrinsic has wrong number of const parameters: found 1, expected 0 --> $DIR/minicore.rs:517:27 | LL | const fn const_eval_select( | ^^^^^^^^^^^^^^^^^^^^^^^ expected 0 const parameters -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0094`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.rs index 929da1ca8fa99..84f5f2803e156 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete const fn foo() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr index 0745d0304b9e6..39aa5825611f3 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/no-explicit-const-params.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params.rs:22:5 | @@ -63,7 +72,7 @@ note: trait defined here, with 0 generic parameters LL | trait Bar { | ^^^ -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted Some errors have detailed explanations: E0107, E0308. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/project.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/project.stderr index eac3ee9e4e22b..ab5f7b55a4e47 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/project.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/project.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/project.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `Self: Uwu` is not satisfied --> $DIR/project.rs:12:1 | @@ -60,6 +69,6 @@ help: consider further restricting `Self` LL | pub trait Uwu: Owo + Uwu { | +++++ -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.rs index 7bead45b35ab7..987a162cd6cae 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.rs @@ -1,5 +1,5 @@ #![feature(const_trait_impl)] -#![feature(effects)] +#![feature(effects)] //~ WARN the feature `effects` is incomplete struct S; trait T {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr index 3ff1efb59883d..f24d7c7a16017 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/span-bug-issue-121418.stderr @@ -8,6 +8,15 @@ LL | impl const dyn T { | = note: only trait implementations may be annotated with `const` +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/span-bug-issue-121418.rs:2:12 + | +LL | #![feature(effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates --> $DIR/span-bug-issue-121418.rs:7:6 | @@ -39,7 +48,7 @@ note: required because it appears within the type `Mutex<(dyn T + 'static)>` --> $SRC_DIR/std/src/sync/mutex.rs:LL:COL = note: the return type of a function must have a statically known size -error: aborting due to 4 previous errors +error: aborting due to 4 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0277, E0308. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.rs index 6b5ba5bb6241d..00465b0f53d5a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.rs @@ -1,7 +1,7 @@ //@ check-fail // Fixes #119830 -#![feature(effects)] +#![feature(effects)] //~ WARN the feature `effects` is incomplete #![feature(min_specialization)] #![feature(const_trait_impl)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.stderr index 70dd0350dc427..8d69151bf74c3 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/spec-effectvar-ice.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/spec-effectvar-ice.rs:4:12 + | +LL | #![feature(effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `Foo` which is not marked with `#[const_trait]` --> $DIR/spec-effectvar-ice.rs:12:15 | @@ -55,7 +64,7 @@ LL | impl const Foo for T where T: const Specialize {} = 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 6 previous errors +error: aborting due to 6 previous errors; 1 warning emitted Some errors have detailed explanations: E0119, E0207. For more information about an error, try `rustc --explain E0119`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.rs index 891e87d3b97d4..d63dbfbf57d4a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.rs @@ -1,5 +1,5 @@ // Regression test for issue #113378. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Trait { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.stderr index 4d0b03046d27d..33914cb306dc6 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/trait-fn-const.stderr @@ -54,6 +54,15 @@ LL + #[const_trait] LL | trait NonConst { | -error: aborting due to 4 previous errors +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/trait-fn-const.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +error: aborting due to 4 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0379`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs index 426534deb67e7..f5fb0fd516a71 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs @@ -1,6 +1,6 @@ // Regression test for #69615. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] pub trait MyTrait { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr index 5b14ef46d25d3..416ba248a5f31 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/hir-const-check.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0658]: `?` is not allowed in a `const fn` --> $DIR/hir-const-check.rs:12:9 | @@ -8,6 +17,6 @@ LL | Some(())?; = help: add `#![feature(const_try)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs index 482a1aef06b57..ab46d49073c7a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.rs @@ -1,5 +1,5 @@ //@ edition: 2021 -#![feature(effects)] +#![feature(effects)] //~ WARN the feature `effects` is incomplete trait MyTrait {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr index 1110b799c6c47..011232f30b8a6 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr @@ -46,6 +46,15 @@ LL | | LL | | } | |_____^ not a member of trait `MyTrait` +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/ice-120503-async-const-method.rs:2:12 + | +LL | #![feature(effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0425]: cannot find function `main8` in this scope --> $DIR/ice-120503-async-const-method.rs:13:9 | @@ -86,7 +95,7 @@ LL | async const fn bar(&self) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error: aborting due to 6 previous errors +error: aborting due to 6 previous errors; 1 warning emitted Some errors have detailed explanations: E0379, E0391, E0407, E0425. For more information about an error, try `rustc --explain E0379`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs index fee0a2073e8dd..a01329278d78a 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete pub struct Vec3; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr index 408958abf6307..4fe88f263c81b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-121536-const-method.stderr @@ -14,6 +14,15 @@ help: ... and declare the impl to be const instead LL | impl const Add for Vec3 { | +++++ -error: aborting due to 1 previous error +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/ice-121536-const-method.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0379`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs index 269fd87ba0d49..36c82dfe68485 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs @@ -1,5 +1,5 @@ #![feature(const_fmt_arguments_new)] -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Tr { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr index 85996c212118f..9da31486faaff 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-79450.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0015]: cannot call non-const fn `_print` in constant functions --> $DIR/issue-79450.rs:9:9 | @@ -7,6 +16,6 @@ LL | println!("lul"); = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0015`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs index 6153e2770a4b0..c653e62032e6e 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs @@ -3,7 +3,7 @@ //@ run-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #![feature(min_specialization)] #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr new file mode 100644 index 0000000000000..f533fb61aad75 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-default-const-specialized.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs index 9a93d01ed06e9..40fc3b17ae48b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs @@ -1,6 +1,6 @@ // Tests that specializing trait impls must be at least as const as the default impl. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #![feature(min_specialization)] #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr index e356621ba47ed..363fbee1f8bfb 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr @@ -1,8 +1,17 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/const-default-impl-non-const-specialized-impl.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: cannot specialize on const impl with non-const impl --> $DIR/const-default-impl-non-const-specialized-impl.rs:19:1 | LL | impl Value for FortyTwo { | ^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr index 68eac990aaab0..bcccc855aab52 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/non-const-default-const-specialized.rs:6:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0119]: conflicting implementations of trait `Value` for type `FortyTwo` --> $DIR/non-const-default-const-specialized.rs:27:1 | @@ -7,6 +16,6 @@ LL | impl Value for T { LL | impl const Value for FortyTwo { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `FortyTwo` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr index e5b9493b3ce11..7404b6a8b11f2 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/specializing-constness-2.rs:1:30 + | +LL | #![feature(const_trait_impl, effects, min_specialization, rustc_attrs)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0119]: conflicting implementations of trait `A` --> $DIR/specializing-constness-2.rs:20:1 | @@ -16,7 +25,7 @@ LL | ::a(); = note: expected constant `host` found constant `true` -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted Some errors have detailed explanations: E0119, E0308. For more information about an error, try `rustc --explain E0119`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs index 7206a89e5c58c..3aabaf137d54c 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects, min_specialization, rustc_attrs)] +#![feature(const_trait_impl, effects, min_specialization, rustc_attrs)] //~ WARN the feature `effects` is incomplete #[rustc_specialization_trait] #[const_trait] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr index 21e21c2cb71aa..226295bf949df 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr @@ -1,8 +1,17 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/specializing-constness.rs:1:30 + | +LL | #![feature(const_trait_impl, effects, min_specialization, rustc_attrs)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: cannot specialize on const impl with non-const impl --> $DIR/specializing-constness.rs:23:1 | LL | impl A for T { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs index 31ca9419589cb..460c2ef617438 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs @@ -1,7 +1,7 @@ //@ revisions: stable unstable #![cfg_attr(unstable, feature(unstable))] // The feature from the ./auxiliary/staged-api.rs file. -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #![feature(staged_api)] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr index 9512953977003..0604b22ecbb3e 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/staged-api.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: trait implementations cannot be const stable yet --> $DIR/staged-api.rs:19:1 | @@ -45,5 +54,5 @@ LL | Unstable::func(); | = help: const-stable functions can only call other const-stable functions -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr index c9ca15d5b565f..b53e7b6f6acec 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/staged-api.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `::func` is not yet stable as a const fn --> $DIR/staged-api.rs:34:5 | @@ -38,5 +47,5 @@ LL | const_context_not_const_stable() | = help: const-stable functions can only call other const-stable functions -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr index ac25812c42dfb..3a36a5b750932 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr @@ -10,6 +10,15 @@ note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bou LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-2.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/super-traits-fail-2.rs:10:19 | @@ -32,5 +41,5 @@ LL | trait Bar: ~const Foo {} | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 4 previous errors +error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr index 5273f7e48eb8a..beb931570cb85 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-2.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/super-traits-fail-2.rs:10:19 | @@ -20,5 +29,5 @@ LL | trait Bar: ~const Foo {} | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs index 6d57a4f5798f6..2f26eebbe32f9 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete //@ revisions: yy yn ny nn #[cfg_attr(any(yy, yn), const_trait)] diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr index 53445d2559036..f96e6fb4ae468 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr @@ -10,6 +10,15 @@ note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bou LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-2.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0308]: mismatched types --> $DIR/super-traits-fail-2.rs:17:5 | @@ -19,6 +28,6 @@ LL | x.a(); = note: expected constant `host` found constant `true` -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr index 681647945d0a7..ffc259e590e80 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-2.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0308]: mismatched types --> $DIR/super-traits-fail-2.rs:17:5 | @@ -7,6 +16,6 @@ LL | x.a(); = note: expected constant `host` found constant `true` -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr index 77aee6a8bb8f8..cde4b1ff77f35 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr @@ -10,6 +10,15 @@ note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bou LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-3.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/super-traits-fail-3.rs:12:19 | @@ -38,5 +47,5 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | const fn foo(x: &T) { | ^^^ -error: aborting due to 5 previous errors +error: aborting due to 5 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr index f737cb243df41..6f1840181481c 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-3.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/super-traits-fail-3.rs:12:19 | @@ -20,5 +29,5 @@ LL | trait Bar: ~const Foo {} | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs index 1e02a13510013..f7e85902a41b2 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs @@ -1,4 +1,4 @@ -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete //@ revisions: yy yn ny nn //@[yy] check-pass diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr index de7a11cf15511..b0a3b39631dca 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr @@ -10,6 +10,15 @@ note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bou LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-3.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: `~const` can only be applied to `#[const_trait]` traits --> $DIR/super-traits-fail-3.rs:18:24 | @@ -25,6 +34,6 @@ LL | x.a(); = note: expected constant `host` found constant `true` -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yy.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yy.stderr new file mode 100644 index 0000000000000..e354c66919ec6 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yy.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits-fail-3.rs:1:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs index 0515380564d4e..cfbb8e9f6be57 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Foo { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.stderr new file mode 100644 index 0000000000000..2ff1a880d84f0 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/super-traits.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.rs index ad0f10f7ee832..86a2bbe35ed7d 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.rs @@ -1,7 +1,7 @@ // Regression test for issue #119700. //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Main { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.stderr new file mode 100644 index 0000000000000..70019ce57f29e --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-assoc-fn-in-trait-impl.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/tilde-const-assoc-fn-in-trait-impl.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.rs index 5c8f5f4db3b54..0f5729e3daf62 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Foo { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.stderr new file mode 100644 index 0000000000000..4ec8dac1f0d3a --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-inherent-assoc-const-fn.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/tilde-const-inherent-assoc-const-fn.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.rs index b400678308291..c2d3b2036c638 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Trait { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.stderr new file mode 100644 index 0000000000000..1ead23d5c2c1d --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-trait-assoc-tys.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/tilde-const-trait-assoc-tys.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr index b58af6bb9d007..adb1b01f08704 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/trait-default-body-stability.rs:4:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: const `impl` for trait `Try` which is not marked with `#[const_trait]` --> $DIR/trait-default-body-stability.rs:18:12 | @@ -121,7 +130,7 @@ LL | impl const Try for T { | unsatisfied trait bound introduced here = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 10 previous errors +error: aborting due to 10 previous errors; 1 warning emitted Some errors have detailed explanations: E0207, E0284. For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr index 0141dcfb06f6b..95c32b12241c9 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/trait-where-clause-const.rs:7:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error[E0277]: the trait bound `T: ~const Bar` is not satisfied --> $DIR/trait-where-clause-const.rs:21:5 | @@ -30,6 +39,6 @@ help: consider further restricting this bound LL | const fn test1() { | ++++++++++++ -error: aborting due to 2 previous errors +error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs index 65e605a4a2fec..afc5b1c836993 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs @@ -1,6 +1,6 @@ //@ run-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Bar { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.stderr new file mode 100644 index 0000000000000..aef4f569d5e11 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/trait-where-clause-run.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs index 18d0267fed365..59ddc2f748ede 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #[const_trait] trait Foo { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.stderr new file mode 100644 index 0000000000000..6e9e948e45cd3 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/trait-where-clause-self-referential.rs:3:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/stability-attribute/missing-const-stability.rs b/tests/ui/stability-attribute/missing-const-stability.rs index 621e857624910..62bb0239168e0 100644 --- a/tests/ui/stability-attribute/missing-const-stability.rs +++ b/tests/ui/stability-attribute/missing-const-stability.rs @@ -1,5 +1,5 @@ #![feature(staged_api)] -#![feature(const_trait_impl, effects)] +#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete #![stable(feature = "stable", since = "1.0.0")] #[stable(feature = "stable", since = "1.0.0")] diff --git a/tests/ui/stability-attribute/missing-const-stability.stderr b/tests/ui/stability-attribute/missing-const-stability.stderr index 4cfbe152891ba..4e488124fe394 100644 --- a/tests/ui/stability-attribute/missing-const-stability.stderr +++ b/tests/ui/stability-attribute/missing-const-stability.stderr @@ -1,3 +1,12 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/missing-const-stability.rs:2:30 + | +LL | #![feature(const_trait_impl, effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + error: function has missing const stability attribute --> $DIR/missing-const-stability.rs:6:1 | @@ -19,5 +28,5 @@ error: associated function has missing const stability attribute LL | pub const fn foo() {} | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 3 previous errors; 1 warning emitted diff --git a/tests/ui/traits/next-solver/canonical/effect-var.rs b/tests/ui/traits/next-solver/canonical/effect-var.rs index 6d0f09bb9be63..d1e3e18cdc807 100644 --- a/tests/ui/traits/next-solver/canonical/effect-var.rs +++ b/tests/ui/traits/next-solver/canonical/effect-var.rs @@ -1,7 +1,7 @@ //@ compile-flags: -Znext-solver //@ check-pass -#![feature(effects)] +#![feature(effects)] //~ WARN the feature `effects` is incomplete #![feature(const_trait_impl)] #[const_trait] diff --git a/tests/ui/traits/next-solver/canonical/effect-var.stderr b/tests/ui/traits/next-solver/canonical/effect-var.stderr new file mode 100644 index 0000000000000..994228c51e5e1 --- /dev/null +++ b/tests/ui/traits/next-solver/canonical/effect-var.stderr @@ -0,0 +1,11 @@ +warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/effect-var.rs:4:12 + | +LL | #![feature(effects)] + | ^^^^^^^ + | + = note: see issue #102090 for more information + = note: `#[warn(incomplete_features)]` on by default + +warning: 1 warning emitted +