Rollup merge of #122158 - estebank:feature-sugg, r=WaffleLapkin

Provide structured suggestion for `#![feature(foo)]`

```
error: `S2<'_>` is forbidden as the type of a const generic parameter
  --> $DIR/lifetime-in-const-param.rs:5:23
   |
LL | struct S<'a, const N: S2>(&'a ());
   |                       ^^
   |
   = note: the only supported types are integers, `bool` and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
   |
LL + #![feature(adt_const_params)]
   |
```

Fix #55941.
This commit is contained in:
Matthias Krüger 2024-03-18 22:24:38 +01:00 committed by GitHub
commit 980248605a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
98 changed files with 755 additions and 253 deletions

View File

@ -99,7 +99,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
#[allow(rustc::untranslatable_diagnostic)] #[allow(rustc::untranslatable_diagnostic)]
fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, _: Span) -> Diag<'tcx> { fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, _: Span) -> Diag<'tcx> {
let FnCallNonConst { caller, callee, args, span, call_source, feature } = *self; let FnCallNonConst { caller, callee, args, span, call_source, feature } = *self;
let ConstCx { tcx, param_env, .. } = *ccx; let ConstCx { tcx, param_env, body, .. } = *ccx;
let diag_trait = |err, self_ty: Ty<'_>, trait_id| { let diag_trait = |err, self_ty: Ty<'_>, trait_id| {
let trait_ref = TraitRef::from_method(tcx, trait_id, args); let trait_ref = TraitRef::from_method(tcx, trait_id, args);
@ -297,10 +297,12 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
ccx.const_kind(), ccx.const_kind(),
)); ));
if let Some(feature) = feature if let Some(feature) = feature {
&& ccx.tcx.sess.is_nightly_build() ccx.tcx.disabled_nightly_features(
{ &mut err,
err.help(format!("add `#![feature({feature})]` to the crate attributes to enable",)); body.source.def_id().as_local().map(|local| ccx.tcx.local_def_id_to_hir_id(local)),
[(String::new(), feature)],
);
} }
if let ConstContext::Static(_) = ccx.const_kind() { if let ConstContext::Static(_) = ccx.const_kind() {

View File

@ -16,7 +16,7 @@ use rustc_middle::ty::{
self, GenericArgsRef, GenericParamDef, GenericParamDefKind, IsSuggestable, Ty, TyCtxt, self, GenericArgsRef, GenericParamDef, GenericParamDefKind, IsSuggestable, Ty, TyCtxt,
}; };
use rustc_session::lint::builtin::LATE_BOUND_LIFETIME_ARGUMENTS; use rustc_session::lint::builtin::LATE_BOUND_LIFETIME_ARGUMENTS;
use rustc_span::symbol::kw; use rustc_span::symbol::{kw, sym};
use smallvec::SmallVec; use smallvec::SmallVec;
/// Report an error that a generic argument did not match the generic parameter that was /// Report an error that a generic argument did not match the generic parameter that was
@ -41,9 +41,11 @@ fn generic_arg_mismatch_err(
if let GenericParamDefKind::Const { .. } = param.kind { if let GenericParamDefKind::Const { .. } = param.kind {
if matches!(arg, GenericArg::Type(hir::Ty { kind: hir::TyKind::Infer, .. })) { if matches!(arg, GenericArg::Type(hir::Ty { kind: hir::TyKind::Infer, .. })) {
err.help("const arguments cannot yet be inferred with `_`"); err.help("const arguments cannot yet be inferred with `_`");
if sess.is_nightly_build() { tcx.disabled_nightly_features(
err.help("add `#![feature(generic_arg_infer)]` to the crate attributes to enable"); &mut err,
} param.def_id.as_local().map(|local| tcx.local_def_id_to_hir_id(local)),
[(String::new(), sym::generic_arg_infer)],
);
} }
} }

View File

@ -291,12 +291,16 @@ fn default_body_is_unstable(
reason: reason_str, reason: reason_str,
}); });
let inject_span = item_did
.as_local()
.and_then(|id| tcx.crate_level_attribute_injection_span(tcx.local_def_id_to_hir_id(id)));
rustc_session::parse::add_feature_diagnostics_for_issue( rustc_session::parse::add_feature_diagnostics_for_issue(
&mut err, &mut err,
&tcx.sess, &tcx.sess,
feature, feature,
rustc_feature::GateIssue::Library(issue), rustc_feature::GateIssue::Library(issue),
false, false,
inject_span,
); );
err.emit(); err.emit();

View File

@ -999,9 +999,14 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) -> Result<(),
// Implments `ConstParamTy`, suggest adding the feature to enable. // Implments `ConstParamTy`, suggest adding the feature to enable.
Ok(..) => true, Ok(..) => true,
}; };
if may_suggest_feature && tcx.sess.is_nightly_build() { if may_suggest_feature {
diag.help( tcx.disabled_nightly_features(
"add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types", &mut diag,
Some(param.hir_id),
[(
" more complex and user defined types".to_string(),
sym::adt_const_params,
)],
); );
} }

View File

@ -1420,15 +1420,13 @@ impl<'tcx> Pick<'tcx> {
} }
_ => {} _ => {}
} }
if tcx.sess.is_nightly_build() { tcx.disabled_nightly_features(
for (candidate, feature) in &self.unstable_candidates { lint,
lint.help(format!( Some(scope_expr_id),
"add `#![feature({})]` to the crate attributes to enable `{}`", self.unstable_candidates.iter().map(|(candidate, feature)| {
feature, (format!(" `{}`", tcx.def_path_str(candidate.item.def_id)), *feature)
tcx.def_path_str(candidate.item.def_id), }),
)); );
}
}
}, },
); );
} }

View File

@ -1078,6 +1078,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
feature, feature,
GateIssue::Language, GateIssue::Language,
lint_from_cli, lint_from_cli,
None,
); );
}, },
); );

View File

@ -43,7 +43,9 @@ use rustc_data_structures::sync::{self, FreezeReadGuard, Lock, Lrc, WorkerLocal}
#[cfg(parallel_compiler)] #[cfg(parallel_compiler)]
use rustc_data_structures::sync::{DynSend, DynSync}; use rustc_data_structures::sync::{DynSend, DynSync};
use rustc_data_structures::unord::UnordSet; use rustc_data_structures::unord::UnordSet;
use rustc_errors::{Diag, DiagCtxt, DiagMessage, ErrorGuaranteed, LintDiagnostic, MultiSpan}; use rustc_errors::{
Applicability, Diag, DiagCtxt, DiagMessage, ErrorGuaranteed, LintDiagnostic, MultiSpan,
};
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE}; use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
@ -2174,6 +2176,45 @@ impl<'tcx> TyCtxt<'tcx> {
lint_level(self.sess, lint, level, src, Some(span.into()), msg, decorate); lint_level(self.sess, lint, level, src, Some(span.into()), msg, decorate);
} }
/// Find the crate root and the appropriate span where `use` and outer attributes can be
/// inserted at.
pub fn crate_level_attribute_injection_span(self, hir_id: HirId) -> Option<Span> {
for (_hir_id, node) in self.hir().parent_iter(hir_id) {
if let hir::Node::Crate(m) = node {
return Some(m.spans.inject_use_span.shrink_to_lo());
}
}
None
}
pub fn disabled_nightly_features<E: rustc_errors::EmissionGuarantee>(
self,
diag: &mut Diag<'_, E>,
hir_id: Option<HirId>,
features: impl IntoIterator<Item = (String, Symbol)>,
) {
if !self.sess.is_nightly_build() {
return;
}
let span = hir_id.and_then(|id| self.crate_level_attribute_injection_span(id));
for (desc, feature) in features {
// FIXME: make this string translatable
let msg =
format!("add `#![feature({feature})]` to the crate attributes to enable{desc}");
if let Some(span) = span {
diag.span_suggestion_verbose(
span,
msg,
format!("#![feature({feature})]\n"),
Applicability::MachineApplicable,
);
} else {
diag.help(msg);
}
}
}
/// Emit a lint from a lint struct (some type that implements `LintDiagnostic`, typically /// Emit a lint from a lint struct (some type that implements `LintDiagnostic`, typically
/// generated by `#[derive(LintDiagnostic)]`). /// generated by `#[derive(LintDiagnostic)]`).
#[track_caller] #[track_caller]

View File

@ -155,16 +155,11 @@ impl<'tcx> CheckConstVisitor<'tcx> {
// //
// FIXME(ecstaticmorse): Maybe this could be incorporated into `feature_err`? This // FIXME(ecstaticmorse): Maybe this could be incorporated into `feature_err`? This
// is a pretty narrow case, however. // is a pretty narrow case, however.
if tcx.sess.is_nightly_build() { tcx.disabled_nightly_features(
for gate in missing_secondary { &mut err,
// FIXME: make this translatable def_id.map(|id| tcx.local_def_id_to_hir_id(id)),
#[allow(rustc::diagnostic_outside_of_impl)] missing_secondary.into_iter().map(|gate| (String::new(), *gate)),
#[allow(rustc::untranslatable_diagnostic)] );
err.help(format!(
"add `#![feature({gate})]` to the crate attributes to enable"
));
}
}
err.emit(); err.emit();
} }

View File

@ -24,6 +24,9 @@ session_feature_diagnostic_for_issue =
session_feature_diagnostic_help = session_feature_diagnostic_help =
add `#![feature({$feature})]` to the crate attributes to enable add `#![feature({$feature})]` to the crate attributes to enable
session_feature_diagnostic_suggestion =
add `#![feature({$feature})]` to the crate attributes to enable
session_feature_suggest_upgrade_compiler = session_feature_suggest_upgrade_compiler =
this compiler was built on {$date}; consider upgrading it if it is out of date this compiler was built on {$date}; consider upgrading it if it is out of date

View File

@ -54,6 +54,18 @@ pub struct FeatureDiagnosticHelp {
pub feature: Symbol, pub feature: Symbol,
} }
#[derive(Subdiagnostic)]
#[suggestion(
session_feature_diagnostic_suggestion,
applicability = "maybe-incorrect",
code = "#![feature({feature})]\n"
)]
pub struct FeatureDiagnosticSuggestion {
pub feature: Symbol,
#[primary_span]
pub span: Span,
}
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
#[help(session_cli_feature_diagnostic_help)] #[help(session_cli_feature_diagnostic_help)]
pub struct CliFeatureDiagnosticHelp { pub struct CliFeatureDiagnosticHelp {

View File

@ -3,8 +3,8 @@
use crate::config::{Cfg, CheckCfg}; use crate::config::{Cfg, CheckCfg};
use crate::errors::{ use crate::errors::{
CliFeatureDiagnosticHelp, FeatureDiagnosticForIssue, FeatureDiagnosticHelp, FeatureGateError, CliFeatureDiagnosticHelp, FeatureDiagnosticForIssue, FeatureDiagnosticHelp,
SuggestUpgradeCompiler, FeatureDiagnosticSuggestion, FeatureGateError, SuggestUpgradeCompiler,
}; };
use crate::lint::{ use crate::lint::{
builtin::UNSTABLE_SYNTAX_PRE_EXPANSION, BufferedEarlyLint, BuiltinLintDiag, Lint, LintId, builtin::UNSTABLE_SYNTAX_PRE_EXPANSION, BufferedEarlyLint, BuiltinLintDiag, Lint, LintId,
@ -112,7 +112,7 @@ pub fn feature_err_issue(
} }
let mut err = sess.psess.dcx.create_err(FeatureGateError { span, explain: explain.into() }); let mut err = sess.psess.dcx.create_err(FeatureGateError { span, explain: explain.into() });
add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false); add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false, None);
err err
} }
@ -141,7 +141,7 @@ pub fn feature_warn_issue(
explain: &'static str, explain: &'static str,
) { ) {
let mut err = sess.psess.dcx.struct_span_warn(span, explain); let mut err = sess.psess.dcx.struct_span_warn(span, explain);
add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false); add_feature_diagnostics_for_issue(&mut err, sess, feature, issue, false, None);
// Decorate this as a future-incompatibility lint as in rustc_middle::lint::lint_level // Decorate this as a future-incompatibility lint as in rustc_middle::lint::lint_level
let lint = UNSTABLE_SYNTAX_PRE_EXPANSION; let lint = UNSTABLE_SYNTAX_PRE_EXPANSION;
@ -160,7 +160,7 @@ pub fn add_feature_diagnostics<G: EmissionGuarantee>(
sess: &Session, sess: &Session,
feature: Symbol, feature: Symbol,
) { ) {
add_feature_diagnostics_for_issue(err, sess, feature, GateIssue::Language, false); add_feature_diagnostics_for_issue(err, sess, feature, GateIssue::Language, false, None);
} }
/// Adds the diagnostics for a feature to an existing error. /// Adds the diagnostics for a feature to an existing error.
@ -175,6 +175,7 @@ pub fn add_feature_diagnostics_for_issue<G: EmissionGuarantee>(
feature: Symbol, feature: Symbol,
issue: GateIssue, issue: GateIssue,
feature_from_cli: bool, feature_from_cli: bool,
inject_span: Option<Span>,
) { ) {
if let Some(n) = find_feature_issue(feature, issue) { if let Some(n) = find_feature_issue(feature, issue) {
err.subdiagnostic(sess.dcx(), FeatureDiagnosticForIssue { n }); err.subdiagnostic(sess.dcx(), FeatureDiagnosticForIssue { n });
@ -184,6 +185,8 @@ pub fn add_feature_diagnostics_for_issue<G: EmissionGuarantee>(
if sess.psess.unstable_features.is_nightly_build() { if sess.psess.unstable_features.is_nightly_build() {
if feature_from_cli { if feature_from_cli {
err.subdiagnostic(sess.dcx(), CliFeatureDiagnosticHelp { feature }); err.subdiagnostic(sess.dcx(), CliFeatureDiagnosticHelp { feature });
} else if let Some(span) = inject_span {
err.subdiagnostic(sess.dcx(), FeatureDiagnosticSuggestion { feature, span });
} else { } else {
err.subdiagnostic(sess.dcx(), FeatureDiagnosticHelp { feature }); err.subdiagnostic(sess.dcx(), FeatureDiagnosticHelp { feature });
} }

View File

@ -3510,9 +3510,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
} }
ObligationCauseCode::TrivialBound => { ObligationCauseCode::TrivialBound => {
err.help("see issue #48214"); err.help("see issue #48214");
if tcx.sess.opts.unstable_features.is_nightly_build() { tcx.disabled_nightly_features(
err.help("add `#![feature(trivial_bounds)]` to the crate attributes to enable"); err,
} Some(tcx.local_def_id_to_hir_id(body_id)),
[(String::new(), sym::trivial_bounds)],
);
} }
ObligationCauseCode::OpaqueReturnType(expr_info) => { ObligationCauseCode::OpaqueReturnType(expr_info) => {
if let Some((expr_ty, expr_span)) = expr_info { if let Some((expr_ty, expr_span)) = expr_info {

View File

@ -75,6 +75,7 @@ pub(crate) fn look_for_custom_classes<'tcx>(cx: &DocContext<'tcx>, item: &Item)
sym::custom_code_classes_in_docs, sym::custom_code_classes_in_docs,
GateIssue::Language, GateIssue::Language,
false, false,
None,
); );
err.note( err.note(

View File

@ -36,8 +36,11 @@ LL | field2: SafeEnum::Variant4("str".to_string()),
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0010]: allocations are not allowed in statics error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:96:5 --> $DIR/check-static-values-constraints.rs:96:5

View File

@ -5,11 +5,16 @@
// Can never be used as const generics. // Can never be used as const generics.
fn uwu_0<const N: &'static mut ()>() {} fn uwu_0<const N: &'static mut ()>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~| HELP: add `#![feature(adt_const_params)]`
//~| HELP: add `#![feature(adt_const_params)]`
//~| HELP: add `#![feature(adt_const_params)]`
//~| HELP: add `#![feature(adt_const_params)]`
//~| HELP: add `#![feature(adt_const_params)]`
//~| HELP: add `#![feature(adt_const_params)]`
// Needs the feature but can be used, so suggest adding the feature. // Needs the feature but can be used, so suggest adding the feature.
fn owo_0<const N: &'static u32>() {} fn owo_0<const N: &'static u32>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
// Can only be used in const generics with changes. // Can only be used in const generics with changes.
struct Meow { struct Meow {
@ -18,22 +23,17 @@ struct Meow {
fn meow_0<const N: Meow>() {} fn meow_0<const N: Meow>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
fn meow_1<const N: &'static Meow>() {} fn meow_1<const N: &'static Meow>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
fn meow_2<const N: [Meow; 100]>() {} fn meow_2<const N: [Meow; 100]>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
fn meow_3<const N: (Meow, u8)>() {} fn meow_3<const N: (Meow, u8)>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
// This is suboptimal that it thinks it can be used // This is suboptimal that it thinks it can be used
// but better to suggest the feature to the user. // but better to suggest the feature to the user.
fn meow_4<const N: (Meow, String)>() {} fn meow_4<const N: (Meow, String)>() {}
//~^ ERROR: forbidden as the type of a const generic //~^ ERROR: forbidden as the type of a const generic
//~^^ HELP: add `#![feature(adt_const_params)]`
// Non-local ADT that does not impl `ConstParamTy` // Non-local ADT that does not impl `ConstParamTy`
fn nya_0<const N: String>() {} fn nya_0<const N: String>() {}

View File

@ -7,58 +7,76 @@ LL | fn uwu_0<const N: &'static mut ()>() {}
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
error: `&'static u32` is forbidden as the type of a const generic parameter error: `&'static u32` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:10:19 --> $DIR/suggest_feature_only_when_possible.rs:16:19
| |
LL | fn owo_0<const N: &'static u32>() {} LL | fn owo_0<const N: &'static u32>() {}
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `Meow` is forbidden as the type of a const generic parameter error: `Meow` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:19:20 --> $DIR/suggest_feature_only_when_possible.rs:24:20
| |
LL | fn meow_0<const N: Meow>() {} LL | fn meow_0<const N: Meow>() {}
| ^^^^ | ^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&'static Meow` is forbidden as the type of a const generic parameter error: `&'static Meow` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:22:20 --> $DIR/suggest_feature_only_when_possible.rs:26:20
| |
LL | fn meow_1<const N: &'static Meow>() {} LL | fn meow_1<const N: &'static Meow>() {}
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `[Meow; 100]` is forbidden as the type of a const generic parameter error: `[Meow; 100]` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:25:20 --> $DIR/suggest_feature_only_when_possible.rs:28:20
| |
LL | fn meow_2<const N: [Meow; 100]>() {} LL | fn meow_2<const N: [Meow; 100]>() {}
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `(Meow, u8)` is forbidden as the type of a const generic parameter error: `(Meow, u8)` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:28:20 --> $DIR/suggest_feature_only_when_possible.rs:30:20
| |
LL | fn meow_3<const N: (Meow, u8)>() {} LL | fn meow_3<const N: (Meow, u8)>() {}
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `(Meow, String)` is forbidden as the type of a const generic parameter error: `(Meow, String)` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:34:20 --> $DIR/suggest_feature_only_when_possible.rs:35:20
| |
LL | fn meow_4<const N: (Meow, String)>() {} LL | fn meow_4<const N: (Meow, String)>() {}
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `String` is forbidden as the type of a const generic parameter error: `String` is forbidden as the type of a const generic parameter
--> $DIR/suggest_feature_only_when_possible.rs:39:19 --> $DIR/suggest_feature_only_when_possible.rs:39:19

View File

@ -35,7 +35,10 @@ LL | struct A<const N: &u8>;
| ^^^ | ^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&u8` is forbidden as the type of a const generic parameter error: `&u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:14:15 --> $DIR/const-param-elided-lifetime.rs:14:15
@ -44,7 +47,10 @@ LL | impl<const N: &u8> A<N> {
| ^^^ | ^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&u8` is forbidden as the type of a const generic parameter error: `&u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:22:15 --> $DIR/const-param-elided-lifetime.rs:22:15
@ -53,7 +59,10 @@ LL | impl<const N: &u8> B for A<N> {}
| ^^^ | ^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&u8` is forbidden as the type of a const generic parameter error: `&u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:26:17 --> $DIR/const-param-elided-lifetime.rs:26:17
@ -62,7 +71,10 @@ LL | fn bar<const N: &u8>() {}
| ^^^ | ^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&u8` is forbidden as the type of a const generic parameter error: `&u8` is forbidden as the type of a const generic parameter
--> $DIR/const-param-elided-lifetime.rs:17:21 --> $DIR/const-param-elided-lifetime.rs:17:21
@ -71,7 +83,10 @@ LL | fn foo<const M: &u8>(&self) {}
| ^^^ | ^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 10 previous errors error: aborting due to 10 previous errors

View File

@ -21,7 +21,10 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `[u8; N]` is forbidden as the type of a const generic parameter error: `[u8; N]` is forbidden as the type of a const generic parameter
--> $DIR/const-param-type-depends-on-const-param.rs:15:35 --> $DIR/const-param-type-depends-on-const-param.rs:15:35
@ -30,7 +33,10 @@ LL | pub struct SelfDependent<const N: [u8; N]>;
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -23,7 +23,10 @@ LL | struct B<const CFG: Config> {
| ^^^^^^ | ^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -54,7 +54,10 @@ note: impl defined here, but it is not `const`
LL | impl const std::ops::Add for Foo { LL | impl const std::ops::Add for Foo {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<Foo as Add>::add` in constants error[E0015]: cannot call non-const fn `<Foo as Add>::add` in constants
--> $DIR/unify-op-with-fn-call.rs:21:13 --> $DIR/unify-op-with-fn-call.rs:21:13
@ -63,7 +66,10 @@ LL | bar::<{ std::ops::Add::add(N, N) }>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<usize as Add>::add` in constants error[E0015]: cannot call non-const fn `<usize as Add>::add` in constants
--> $DIR/unify-op-with-fn-call.rs:30:14 --> $DIR/unify-op-with-fn-call.rs:30:14
@ -72,7 +78,10 @@ LL | bar2::<{ std::ops::Add::add(N, N) }>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View File

@ -14,7 +14,10 @@ LL | trait Trait<const S: &'static str> {}
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -6,7 +6,10 @@ LL | (||1usize)()
| |
= note: closures need an RFC before allowed to be called in constants = note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -13,7 +13,10 @@ LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -13,7 +13,10 @@ LL | fn foo<const N: usize, const A: [u8; N]>() {}
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error[E0747]: type provided when a constant was expected error[E0747]: type provided when a constant was expected
--> $DIR/issue-62878.rs:10:11 --> $DIR/issue-62878.rs:10:11
@ -22,7 +25,10 @@ LL | foo::<_, { [1] }>();
| ^ | ^
| |
= help: const arguments cannot yet be inferred with `_` = help: const arguments cannot yet be inferred with `_`
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
|
LL + #![feature(generic_arg_infer)]
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -5,7 +5,10 @@ LL | fn test<const T: &'static dyn A>() {
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -8,7 +8,10 @@ LL | <u8 as Baz>::Quaks: Bar,
[u16; 4] [u16; 4]
[[u16; 3]; 3] [[u16; 3]; 3]
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
--> $DIR/issue-67185-2.rs:14:5 --> $DIR/issue-67185-2.rs:14:5
@ -20,7 +23,10 @@ LL | [<u8 as Baz>::Quaks; 2]: Bar,
[u16; 4] [u16; 4]
[[u16; 3]; 3] [[u16; 3]; 3]
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
--> $DIR/issue-67185-2.rs:21:6 --> $DIR/issue-67185-2.rs:21:6

View File

@ -5,7 +5,10 @@ LL | struct Collatz<const N: Option<usize>>;
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:12:7 --> $DIR/issue-68366.rs:12:7

View File

@ -14,7 +14,10 @@ LL | struct Collatz<const N: Option<usize>>;
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:12:7 --> $DIR/issue-68366.rs:12:7

View File

@ -5,7 +5,10 @@ LL | struct Const<const V: [usize; 0]> {}
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | struct Foo<const V: [usize; 0] > {}
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -13,7 +13,10 @@ LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,7 +5,10 @@ LL | fn hoge<const IN: [u32; LEN]>() {}
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | fn a<const X: &'static [u32]>() {}
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | fn test<const N: [u8; 1 + 2]>() {}
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `[u8; 1 + 2]` is forbidden as the type of a const generic parameter error: `[u8; 1 + 2]` is forbidden as the type of a const generic parameter
--> $DIR/issue-74101.rs:9:21 --> $DIR/issue-74101.rs:9:21
@ -14,7 +17,10 @@ LL | struct Foo<const N: [u8; 1 + 2]>;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,7 +5,10 @@ LL | fn ice_struct_fn<const I: IceEnum>() {}
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | struct Outer<const I: Inner>;
| ^^^^^ | ^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `Inner` is forbidden as the type of a const generic parameter error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:19:23 --> $DIR/issue-74950.rs:19:23
@ -14,8 +17,11 @@ LL | struct Outer<const I: Inner>;
| ^^^^^ | ^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `Inner` is forbidden as the type of a const generic parameter error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:19:23 --> $DIR/issue-74950.rs:19:23
@ -24,8 +30,11 @@ LL | struct Outer<const I: Inner>;
| ^^^^^ | ^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `Inner` is forbidden as the type of a const generic parameter error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:19:23 --> $DIR/issue-74950.rs:19:23
@ -34,8 +43,11 @@ LL | struct Outer<const I: Inner>;
| ^^^^^ | ^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -5,7 +5,10 @@ LL | struct Foo<const N: [u8; Bar::<u32>::value()]>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -29,7 +29,10 @@ LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/any.rs:LL:COL --> $SRC_DIR/core/src/any.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const operator in constants error[E0015]: cannot call non-const operator in constants
--> $DIR/issue-90318.rs:22:10 --> $DIR/issue-90318.rs:22:10
@ -40,7 +43,10 @@ LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/any.rs:LL:COL --> $SRC_DIR/core/src/any.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -11,7 +11,10 @@ LL | struct S<'a, const N: S2>(&'a ());
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,7 +5,10 @@ LL | struct Foo<const N: [u8; 0]>;
| ^^^^^^^ | ^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `()` is forbidden as the type of a const generic parameter error: `()` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:6:21 --> $DIR/complex-types.rs:6:21
@ -14,7 +17,10 @@ LL | struct Bar<const N: ()>;
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `No` is forbidden as the type of a const generic parameter error: `No` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:11:21 --> $DIR/complex-types.rs:11:21
@ -23,7 +29,10 @@ LL | struct Fez<const N: No>;
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&'static u8` is forbidden as the type of a const generic parameter error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:14:21 --> $DIR/complex-types.rs:14:21
@ -32,7 +41,10 @@ LL | struct Faz<const N: &'static u8>;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `!` is forbidden as the type of a const generic parameter error: `!` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:17:21 --> $DIR/complex-types.rs:17:21
@ -49,7 +61,10 @@ LL | enum Goo<const N: ()> { A, B }
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `()` is forbidden as the type of a const generic parameter error: `()` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:23:20 --> $DIR/complex-types.rs:23:20
@ -58,7 +73,10 @@ LL | union Boo<const N: ()> { a: () }
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View File

@ -30,7 +30,10 @@ LL | | }]>;
| |__^ | |__^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,7 +5,10 @@ LL | struct ConstString<const T: &'static str>;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&'static [u8]` is forbidden as the type of a const generic parameter error: `&'static [u8]` is forbidden as the type of a const generic parameter
--> $DIR/slice-const-param-mismatch.rs:9:28 --> $DIR/slice-const-param-mismatch.rs:9:28
@ -14,7 +17,10 @@ LL | struct ConstBytes<const T: &'static [u8]>;
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/slice-const-param-mismatch.rs:14:35 --> $DIR/slice-const-param-mismatch.rs:14:35

View File

@ -5,7 +5,10 @@ LL | struct _Range<const R: std::ops::Range<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `RangeFrom<usize>` is forbidden as the type of a const generic parameter error: `RangeFrom<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:13:28 --> $DIR/const-generics-range.rs:13:28
@ -14,7 +17,10 @@ LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `RangeFull` is forbidden as the type of a const generic parameter error: `RangeFull` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:18:28 --> $DIR/const-generics-range.rs:18:28
@ -23,7 +29,10 @@ LL | struct _RangeFull<const R: std::ops::RangeFull>;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `RangeInclusive<usize>` is forbidden as the type of a const generic parameter error: `RangeInclusive<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:24:33 --> $DIR/const-generics-range.rs:24:33
@ -32,7 +41,10 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `RangeTo<usize>` is forbidden as the type of a const generic parameter error: `RangeTo<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:29:26 --> $DIR/const-generics-range.rs:29:26
@ -41,7 +53,10 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `RangeToInclusive<usize>` is forbidden as the type of a const generic parameter error: `RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:34:35 --> $DIR/const-generics-range.rs:34:35
@ -50,7 +65,10 @@ LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View File

@ -5,7 +5,10 @@ LL | struct Const<const P: &'static ()>;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | trait Get<'a, const N: &'static str> {
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: `&'static str` is forbidden as the type of a const generic parameter error: `&'static str` is forbidden as the type of a const generic parameter
--> $DIR/issue-71348.rs:18:25 --> $DIR/issue-71348.rs:18:25
@ -14,7 +17,10 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a <Self as Get<N>>::Ta
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -23,7 +23,10 @@ LL | for i in 0..x {
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0658]: mutable references are not allowed in constant functions error[E0658]: mutable references are not allowed in constant functions
--> $DIR/const-fn-error.rs:5:14 --> $DIR/const-fn-error.rs:5:14
@ -42,7 +45,10 @@ LL | for i in 0..x {
| ^^^^ | ^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -17,7 +17,10 @@ LL | for _ in 0..5 {}
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0658]: mutable references are not allowed in constants error[E0658]: mutable references are not allowed in constants
--> $DIR/const-for-feature-gate.rs:4:14 --> $DIR/const-for-feature-gate.rs:4:14
@ -36,7 +39,10 @@ LL | for _ in 0..5 {}
| ^^^^ | ^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -7,7 +7,10 @@ LL | for _ in 0..5 {}
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants
--> $DIR/const-for.rs:5:14 --> $DIR/const-for.rs:5:14
@ -16,7 +19,10 @@ LL | for _ in 0..5 {}
| ^^^^ | ^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -17,7 +17,10 @@ LL | Some(())?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions
--> $DIR/const-try-feature-gate.rs:4:5 --> $DIR/const-try-feature-gate.rs:4:5
@ -28,7 +31,10 @@ LL | Some(())?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -10,7 +10,10 @@ note: impl defined here, but it is not `const`
LL | impl const Try for TryMe { LL | impl const Try for TryMe {
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions
--> $DIR/const-try.rs:33:5 --> $DIR/const-try.rs:33:5
@ -24,7 +27,10 @@ note: impl defined here, but it is not `const`
LL | impl const FromResidual<Error> for TryMe { LL | impl const FromResidual<Error> for TryMe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -14,7 +14,10 @@ LL | [0; T::a()]
| ^^^^^^ | ^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<T as Tr>::a` in constants error[E0015]: cannot call non-const fn `<T as Tr>::a` in constants
--> $DIR/constifconst-call-in-const-position.rs:16:38 --> $DIR/constifconst-call-in-const-position.rs:16:38
@ -23,7 +26,10 @@ LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] {
| ^^^^^^ | ^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors; 1 warning emitted

View File

@ -37,7 +37,10 @@ LL | for i in 0..4 {
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0658]: mutable references are not allowed in constants error[E0658]: mutable references are not allowed in constants
--> $DIR/loop.rs:53:14 --> $DIR/loop.rs:53:14
@ -56,7 +59,10 @@ LL | for i in 0..4 {
| ^^^^ | ^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants
--> $DIR/loop.rs:60:14 --> $DIR/loop.rs:60:14
@ -67,7 +73,10 @@ LL | for i in 0..4 {
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0658]: mutable references are not allowed in constants error[E0658]: mutable references are not allowed in constants
--> $DIR/loop.rs:60:14 --> $DIR/loop.rs:60:14
@ -86,7 +95,10 @@ LL | for i in 0..4 {
| ^^^^ | ^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View File

@ -17,7 +17,10 @@ LL | x?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: `?` cannot convert from residual of `Option<i32>` in constant functions error[E0015]: `?` cannot convert from residual of `Option<i32>` in constant functions
--> $DIR/try.rs:6:5 --> $DIR/try.rs:6:5
@ -28,7 +31,10 @@ LL | x?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -81,7 +81,10 @@ LL | assert!(test_one == (1, 1, 1));
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const operator in constants error[E0015]: cannot call non-const operator in constants
--> $DIR/fn_trait_refs.rs:75:17 --> $DIR/fn_trait_refs.rs:75:17
@ -90,7 +93,10 @@ LL | assert!(test_two == (2, 2));
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const closure in constant functions error[E0015]: cannot call non-const closure in constant functions
--> $DIR/fn_trait_refs.rs:17:5 --> $DIR/fn_trait_refs.rs:17:5
@ -99,11 +105,14 @@ LL | f()
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | T: ~const Fn<()> + ~const Destruct + ~const std::ops::Fn<()>, LL | T: ~const Fn<()> + ~const Destruct + ~const std::ops::Fn<()>,
| +++++++++++++++++++++++++ | +++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0493]: destructor of `T` cannot be evaluated at compile-time error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/fn_trait_refs.rs:13:23 --> $DIR/fn_trait_refs.rs:13:23
@ -121,11 +130,14 @@ LL | f()
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | T: ~const FnMut<()> + ~const Destruct + ~const std::ops::FnMut<()>, LL | T: ~const FnMut<()> + ~const Destruct + ~const std::ops::FnMut<()>,
| ++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0493]: destructor of `T` cannot be evaluated at compile-time error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/fn_trait_refs.rs:20:27 --> $DIR/fn_trait_refs.rs:20:27
@ -143,11 +155,14 @@ LL | f()
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | T: ~const FnOnce<()> + ~const std::ops::FnOnce<()>, LL | T: ~const FnOnce<()> + ~const std::ops::FnOnce<()>,
| +++++++++++++++++++++++++++++ | +++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0493]: destructor of `T` cannot be evaluated at compile-time error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/fn_trait_refs.rs:34:21 --> $DIR/fn_trait_refs.rs:34:21

View File

@ -6,7 +6,10 @@ LL | const { (|| {})() } => {}
| |
= note: closures need an RFC before allowed to be called in constants = note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -62,7 +62,10 @@ LL | struct S<const S: (), const S: S = { S }>;
| ^^ | ^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View File

@ -6,7 +6,10 @@ LL | || -> u8 { 5 }()
| |
= note: closures need an RFC before allowed to be called in constants = note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -6,7 +6,10 @@ LL | const fn foo() { (||{})() }
| |
= note: closures need an RFC before allowed to be called in constant functions = note: closures need an RFC before allowed to be called in constant functions
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: function pointer calls are not allowed in constant functions error: function pointer calls are not allowed in constant functions
--> $DIR/issue-56164.rs:5:5 --> $DIR/issue-56164.rs:5:5

View File

@ -6,7 +6,10 @@ LL | a: [(); (|| { 0 })()]
| |
= note: closures need an RFC before allowed to be called in constants = note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -7,7 +7,10 @@ LL | GetTypeId::<T>::VALUE == GetTypeId::<usize>::VALUE
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/any.rs:LL:COL --> $SRC_DIR/core/src/any.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -1,37 +0,0 @@
// Regression test for issue #90870.
//@ run-rustfix
#![allow(dead_code)]
const fn f(a: &u8, b: &u8) -> bool {
*a == *b
//~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
}
const fn g(a: &&&&i64, b: &&&&i64) -> bool {
****a == ****b
//~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
}
const fn h(mut a: &[u8], mut b: &[u8]) -> bool {
while let ([l, at @ ..], [r, bt @ ..]) = (a, b) {
if *l == *r {
//~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
a = at;
b = bt;
} else {
return false;
}
}
a.is_empty() && b.is_empty()
}
fn main() {}

View File

@ -1,21 +1,20 @@
// Regression test for issue #90870. // Regression test for issue #90870.
//@ run-rustfix
#![allow(dead_code)] #![allow(dead_code)]
const fn f(a: &u8, b: &u8) -> bool { const fn f(a: &u8, b: &u8) -> bool {
//~^ HELP: add `#![feature(const_trait_impl)]`
//~| HELP: add `#![feature(const_trait_impl)]`
//~| HELP: add `#![feature(const_trait_impl)]`
a == b a == b
//~^ ERROR: cannot call non-const operator in constant functions [E0015] //~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here //~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
} }
const fn g(a: &&&&i64, b: &&&&i64) -> bool { const fn g(a: &&&&i64, b: &&&&i64) -> bool {
a == b a == b
//~^ ERROR: cannot call non-const operator in constant functions [E0015] //~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here //~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
} }
const fn h(mut a: &[u8], mut b: &[u8]) -> bool { const fn h(mut a: &[u8], mut b: &[u8]) -> bool {
@ -23,7 +22,6 @@ const fn h(mut a: &[u8], mut b: &[u8]) -> bool {
if l == r { if l == r {
//~^ ERROR: cannot call non-const operator in constant functions [E0015] //~^ ERROR: cannot call non-const operator in constant functions [E0015]
//~| HELP: consider dereferencing here //~| HELP: consider dereferencing here
//~| HELP: add `#![feature(const_trait_impl)]`
a = at; a = at;
b = bt; b = bt;
} else { } else {

View File

@ -1,15 +1,18 @@
error[E0015]: cannot call non-const operator in constant functions error[E0015]: cannot call non-const operator in constant functions
--> $DIR/issue-90870.rs:8:5 --> $DIR/issue-90870.rs:9:5
| |
LL | a == b LL | a == b
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
help: consider dereferencing here help: consider dereferencing here
| |
LL | *a == *b LL | *a == *b
| + + | + +
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const operator in constant functions error[E0015]: cannot call non-const operator in constant functions
--> $DIR/issue-90870.rs:15:5 --> $DIR/issue-90870.rs:15:5
@ -18,24 +21,30 @@ LL | a == b
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
help: consider dereferencing here help: consider dereferencing here
| |
LL | ****a == ****b LL | ****a == ****b
| ++++ ++++ | ++++ ++++
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const operator in constant functions error[E0015]: cannot call non-const operator in constant functions
--> $DIR/issue-90870.rs:23:12 --> $DIR/issue-90870.rs:22:12
| |
LL | if l == r { LL | if l == r {
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
help: consider dereferencing here help: consider dereferencing here
| |
LL | if *l == *r { LL | if *l == *r {
| + + | + +
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -15,7 +15,10 @@ LL | self.bar[0] = baz.len();
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -13,7 +13,10 @@ LL | Err(())?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/result.rs:LL:COL --> $SRC_DIR/core/src/result.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: `?` cannot convert from residual of `Result<bool, ()>` in constant functions error[E0015]: `?` cannot convert from residual of `Result<bool, ()>` in constant functions
--> $DIR/try-operator.rs:10:9 --> $DIR/try-operator.rs:10:9
@ -24,7 +27,10 @@ LL | Err(())?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/result.rs:LL:COL --> $SRC_DIR/core/src/result.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions error[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions
--> $DIR/try-operator.rs:18:9 --> $DIR/try-operator.rs:18:9
@ -35,7 +41,10 @@ LL | None?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions
--> $DIR/try-operator.rs:18:9 --> $DIR/try-operator.rs:18:9
@ -46,7 +55,10 @@ LL | None?;
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/option.rs:LL:COL --> $SRC_DIR/core/src/option.rs:LL:COL
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View File

@ -11,11 +11,14 @@ LL | Opt::None => f(),
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T { LL | const fn unwrap_or_else<F: ~const FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T {
| +++++++++++++++++++++++++++++ | +++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0493]: destructor of `F` cannot be evaluated at compile-time error[E0493]: destructor of `F` cannot be evaluated at compile-time
--> $DIR/unstable-const-fn-in-libcore.rs:19:60 --> $DIR/unstable-const-fn-in-libcore.rs:19:60

View File

@ -10,7 +10,10 @@ help: this trait has no implementations, consider adding one
LL | trait Bar<X> { } LL | trait Bar<X> { }
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Bar<u32>` is not satisfied error[E0277]: the trait bound `i32: Bar<u32>` is not satisfied
--> $DIR/cross-fn-cache-hole.rs:30:15 --> $DIR/cross-fn-cache-hole.rs:30:15

View File

@ -5,7 +5,10 @@ LL | struct Foo<const NAME: &'static str>;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -27,7 +27,10 @@ LL | let _x = foo::<_>([1,2]);
| ^ | ^
| |
= help: const arguments cannot yet be inferred with `_` = help: const arguments cannot yet be inferred with `_`
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
|
LL + #![feature(generic_arg_infer)]
|
error[E0658]: using `_` for array lengths is unstable error[E0658]: using `_` for array lengths is unstable
--> $DIR/feature-gate-generic_arg_infer.rs:11:27 --> $DIR/feature-gate-generic_arg_infer.rs:11:27

View File

@ -6,7 +6,10 @@ LL | enum E where i32: Foo { V }
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Foo` is not satisfied error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:12:16 --> $DIR/feature-gate-trivial_bounds.rs:12:16
@ -16,7 +19,10 @@ LL | struct S where i32: Foo;
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Foo` is not satisfied error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:14:15 --> $DIR/feature-gate-trivial_bounds.rs:14:15
@ -26,7 +32,10 @@ LL | trait T where i32: Foo {}
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Foo` is not satisfied error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:16:15 --> $DIR/feature-gate-trivial_bounds.rs:16:15
@ -36,7 +45,10 @@ LL | union U where i32: Foo { f: i32 }
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Foo` is not satisfied error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:20:23 --> $DIR/feature-gate-trivial_bounds.rs:20:23
@ -46,7 +58,10 @@ LL | impl Foo for () where i32: Foo {
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `i32: Foo` is not satisfied error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:28:14 --> $DIR/feature-gate-trivial_bounds.rs:28:14
@ -56,7 +71,10 @@ LL | fn f() where i32: Foo
| |
= help: the trait `Foo` is implemented for `()` = help: the trait `Foo` is implemented for `()`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `String: Neg` is not satisfied error[E0277]: the trait bound `String: Neg` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:36:38 --> $DIR/feature-gate-trivial_bounds.rs:36:38
@ -65,7 +83,10 @@ LL | fn use_op(s: String) -> String where String: ::std::ops::Neg<Output=String>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Neg` is not implemented for `String` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Neg` is not implemented for `String`
| |
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: `i32` is not an iterator error[E0277]: `i32` is not an iterator
--> $DIR/feature-gate-trivial_bounds.rs:40:20 --> $DIR/feature-gate-trivial_bounds.rs:40:20
@ -75,7 +96,10 @@ LL | fn use_for() where i32: Iterator {
| |
= help: the trait `Iterator` is not implemented for `i32` = help: the trait `Iterator` is not implemented for `i32`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the size for values of type `str` cannot be known at compilation time error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:52:32 --> $DIR/feature-gate-trivial_bounds.rs:52:32
@ -85,7 +109,10 @@ LL | struct TwoStrs(str, str) where str: Sized;
| |
= help: the trait `Sized` is not implemented for `str` = help: the trait `Sized` is not implemented for `str`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:55:26 --> $DIR/feature-gate-trivial_bounds.rs:55:26
@ -100,7 +127,10 @@ note: required because it appears within the type `Dst<(dyn A + 'static)>`
LL | struct Dst<X: ?Sized> { LL | struct Dst<X: ?Sized> {
| ^^^ | ^^^
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the size for values of type `str` cannot be known at compilation time error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:59:30 --> $DIR/feature-gate-trivial_bounds.rs:59:30
@ -110,7 +140,10 @@ LL | fn return_str() -> str where str: Sized {
| |
= help: the trait `Sized` is not implemented for `str` = help: the trait `Sized` is not implemented for `str`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error: aborting due to 11 previous errors error: aborting due to 11 previous errors

View File

@ -28,7 +28,10 @@ LL | const I<const S: &str>: &str = "";
| ^^^^ | ^^^^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -11,11 +11,14 @@ LL | fun(filter_positive());
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) { LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) {
| ++++++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0493]: destructor of `F` cannot be evaluated at compile-time error[E0493]: destructor of `F` cannot be evaluated at compile-time
--> $DIR/normalize-tait-in-const.rs:25:79 --> $DIR/normalize-tait-in-const.rs:25:79

View File

@ -7,8 +7,11 @@ LL | assert_eq!('x'.ipu_flatten(), 1);
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
= note: `#[warn(unstable_name_collisions)]` on by default = note: `#[warn(unstable_name_collisions)]` on by default
help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
|
LL + #![feature(ipu_flatten)]
|
warning: a method with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:19:20 --> $DIR/inference_unstable.rs:19:20
@ -19,7 +22,10 @@ LL | assert_eq!('x'.ipu_by_value_vs_by_ref(), 1);
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_value_vs_by_ref(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_value_vs_by_ref(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref` help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref`
|
LL + #![feature(ipu_flatten)]
|
warning: a method with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:22:20 --> $DIR/inference_unstable.rs:22:20
@ -30,7 +36,10 @@ LL | assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1);
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_ref_vs_by_ref_mut(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_ref_vs_by_ref_mut(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut` help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut`
|
LL + #![feature(ipu_flatten)]
|
warning: a method with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:25:40 --> $DIR/inference_unstable.rs:25:40
@ -41,17 +50,27 @@ LL | assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1)
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_mut_ptr_vs_by_const_ptr(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_mut_ptr_vs_by_const_ptr(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_mut_ptr_vs_by_const_ptr` help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_mut_ptr_vs_by_const_ptr`
|
LL + #![feature(ipu_flatten)]
|
warning: an associated constant with this name may be added to the standard library in the future warning: an associated constant with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:28:16 --> $DIR/inference_unstable.rs:28:16
| |
LL | assert_eq!(char::C, 1); LL | assert_eq!(char::C, 1);
| ^^^^^^^ help: use the fully qualified path to the associated const: `<char as IpuItertools>::C` | ^^^^^^^
| |
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: add `#![feature(assoc_const_ipu_iter)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::C` help: use the fully qualified path to the associated const
|
LL | assert_eq!(<char as IpuItertools>::C, 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
help: add `#![feature(assoc_const_ipu_iter)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::C`
|
LL + #![feature(assoc_const_ipu_iter)]
|
warning: 5 warnings emitted warning: 5 warnings emitted

View File

@ -16,8 +16,11 @@ note: impl defined here, but it is not `const`
LL | impl Deref for A { LL | impl Deref for A {
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
= note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -56,7 +56,10 @@ LL | fn d<const C: S>() {}
| ^ | ^
| |
= note: the only supported types are integers, `bool` and `char` = note: the only supported types are integers, `bool` and `char`
= help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
LL + #![feature(adt_const_params)]
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View File

@ -50,7 +50,10 @@ LL | [(); { for _ in 0usize.. {}; 0}];
note: impl defined here, but it is not `const` note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0658]: mutable references are not allowed in constants error[E0658]: mutable references are not allowed in constants
--> $DIR/issue-52443.rs:9:21 --> $DIR/issue-52443.rs:9:21
@ -69,7 +72,10 @@ LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^ | ^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 6 previous errors; 1 warning emitted error: aborting due to 6 previous errors; 1 warning emitted

View File

@ -89,12 +89,15 @@ LL | type W: Ord where Self: Eq;
| ^^^^^^^^ the trait `Eq` is not implemented for `X` | ^^^^^^^^ the trait `Eq` is not implemented for `X`
| |
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
help: consider annotating `X` with `#[derive(Eq)]` help: consider annotating `X` with `#[derive(Eq)]`
| |
LL + #[derive(Eq)] LL + #[derive(Eq)]
LL | struct X; LL | struct X;
| |
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `X: Eq` is not satisfied error[E0277]: the trait bound `X: Eq` is not satisfied
--> $DIR/impl-item-type-no-body-semantic-fail.rs:18:18 --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:18
@ -103,12 +106,15 @@ LL | type W where Self: Eq;
| ^^^^^^^^ the trait `Eq` is not implemented for `X` | ^^^^^^^^ the trait `Eq` is not implemented for `X`
| |
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
help: consider annotating `X` with `#[derive(Eq)]` help: consider annotating `X` with `#[derive(Eq)]`
| |
LL + #[derive(Eq)] LL + #[derive(Eq)]
LL | struct X; LL | struct X;
| |
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0592]: duplicate definitions with name `W` error[E0592]: duplicate definitions with name `W`
--> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5 --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5

View File

@ -352,8 +352,11 @@ LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
| ^^^^^^ | ^^^^^^
| |
= note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 40 previous errors error: aborting due to 40 previous errors

View File

@ -5,7 +5,10 @@ LL | let array: [usize; Dim3::dim()]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
--> $DIR/issue-39559-2.rs:16:15 --> $DIR/issue-39559-2.rs:16:15
@ -14,7 +17,10 @@ LL | = [0; Dim3::dim()];
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -10,7 +10,10 @@ note: impl defined here, but it is not `const`
LL | impl const std::ops::Add for Int { LL | impl const std::ops::Add for Int {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<i32 as Plus>::plus` in constant functions error[E0015]: cannot call non-const fn `<i32 as Plus>::plus` in constant functions
--> $DIR/call-const-trait-method-pass.rs:36:7 --> $DIR/call-const-trait-method-pass.rs:36:7
@ -19,7 +22,10 @@ LL | a.plus(b)
| ^^^^^^^ | ^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -11,11 +11,14 @@ LL | x(())
| ^^^^^ | ^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 {
| ++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -11,11 +11,14 @@ LL | x(())
| ^^^^^ | ^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 {
| ++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -29,11 +29,14 @@ LL | f() + f()
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 { LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 {
| +++++++++++++++++++++++++ | +++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const closure in constant functions error[E0015]: cannot call non-const closure in constant functions
--> $DIR/const-closures.rs:24:11 --> $DIR/const-closures.rs:24:11
@ -42,11 +45,14 @@ LL | f() + f()
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 { LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 {
| +++++++++++++++++++++++++ | +++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const closure in constant functions error[E0015]: cannot call non-const closure in constant functions
--> $DIR/const-closures.rs:12:5 --> $DIR/const-closures.rs:12:5
@ -55,11 +61,14 @@ LL | f() * 7
| ^^^ | ^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | F: ~const FnOnce() -> u8 + ~const std::ops::Fn<()>, LL | F: ~const FnOnce() -> u8 + ~const std::ops::Fn<()>,
| +++++++++++++++++++++++++ | +++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View File

@ -5,7 +5,10 @@ LL | Const.func();
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | NonConst.func();
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions
--> $DIR/cross-crate.rs:20:11 --> $DIR/cross-crate.rs:20:11
@ -14,7 +17,10 @@ LL | Const.func();
| ^^^^^^ | ^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -10,7 +10,10 @@ note: impl defined here, but it is not `const`
LL | impl<T> const std::ops::Add for S<T> { LL | impl<T> const std::ops::Add for S<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -6,7 +6,10 @@ LL | n => n(),
| |
= note: closures need an RFC before allowed to be called in constants = note: closures need an RFC before allowed to be called in constants
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | T::assoc()
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -6,7 +6,10 @@ LL | "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in
| |
= note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -6,7 +6,10 @@ LL | "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in
| |
= note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | (const || { (()).foo() })();
| ^^^^^ | ^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -5,7 +5,10 @@ LL | Unstable::func();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -11,7 +11,10 @@ LL | Default::default()
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,7 +5,10 @@ LL | Default::default()
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| |
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View File

@ -23,7 +23,10 @@ LL | const _: () = assert!(<()>::a() == 42);
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<u8 as A>::a` in constants error[E0015]: cannot call non-const fn `<u8 as A>::a` in constants
--> $DIR/const_trait_impl.rs:53:23 --> $DIR/const_trait_impl.rs:53:23
@ -32,7 +35,10 @@ LL | const _: () = assert!(<u8>::a() == 3);
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error[E0015]: cannot call non-const fn `<u16 as A>::a` in constants error[E0015]: cannot call non-const fn `<u16 as A>::a` in constants
--> $DIR/const_trait_impl.rs:54:23 --> $DIR/const_trait_impl.rs:54:23
@ -41,7 +47,10 @@ LL | const _: () = assert!(<u16>::a() == 2);
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
|
LL + #![feature(effects)]
|
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View File

@ -35,7 +35,10 @@ LL | default unsafe impl Send for S {}
= help: the trait `Send` is not implemented for `S` = help: the trait `Send` is not implemented for `S`
= help: the trait `Send` is implemented for `S` = help: the trait `Send` is implemented for `S`
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error: impls of auto traits cannot be default error: impls of auto traits cannot be default
--> $DIR/validation.rs:11:15 --> $DIR/validation.rs:11:15

View File

@ -78,7 +78,10 @@ help: this trait has no implementations, consider adding one
LL | trait Sub: Super<Assoc = u16> {} LL | trait Sub: Super<Assoc = u16> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: see issue #48214 = help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
LL + #![feature(trivial_bounds)]
|
error[E0277]: the trait bound `(): SubGeneric<u16>` is not satisfied error[E0277]: the trait bound `(): SubGeneric<u16>` is not satisfied
--> $DIR/super-assoc-mismatch.rs:55:22 --> $DIR/super-assoc-mismatch.rs:55:22

View File

@ -673,7 +673,10 @@ LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0015]: cannot call non-const fn `<Filter<std::ops::Range<i32>, {closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}> as Iterator>::map::<i32, {closure@$DIR/typeck_type_placeholder_item.rs:230:49: 230:52}>` in constants error[E0015]: cannot call non-const fn `<Filter<std::ops::Range<i32>, {closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}> as Iterator>::map::<i32, {closure@$DIR/typeck_type_placeholder_item.rs:230:49: 230:52}>` in constants
--> $DIR/typeck_type_placeholder_item.rs:230:45 --> $DIR/typeck_type_placeholder_item.rs:230:45
@ -682,7 +685,10 @@ LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x);
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants = note: calls in constants are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
|
LL + #![feature(const_trait_impl)]
|
error[E0515]: cannot return reference to function parameter `x` error[E0515]: cannot return reference to function parameter `x`
--> $DIR/typeck_type_placeholder_item.rs:50:5 --> $DIR/typeck_type_placeholder_item.rs:50:5