We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c5ff29 commit 13d94eeCopy full SHA for 13d94ee
src/librustc_mir/const_eval.rs
@@ -662,6 +662,10 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
662
match tcx.describe_def(def_id) {
663
// constants never produce a hard error at the definition site. Anything else is
664
// a backwards compatibility hazard (and will break old versions of winapi for sure)
665
+ //
666
+ // note that validation may still cause a hard error on this very same constant,
667
+ // because any code that existed before validation could not have failed validation
668
+ // thus preventing such a hard error from being a backwards compatibility hazard
669
Some(Def::Const(_)) | Some(Def::AssociatedConst(_)) => {
670
let node_id = tcx.hir.as_local_node_id(def_id).unwrap();
671
err.report_as_lint(
0 commit comments