Skip to content

Commit 49799f2

Browse files
committed
update NotConstEvaluatable
1 parent deaebac commit 49799f2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

compiler/rustc_middle/src/thir/abstract_const.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! A subset of a mir body used for const evaluatability checking.
22
use crate::mir;
3+
use crate::mir::interpret::GlobalId;
34
use crate::ty::{self, Ty, TyCtxt};
45
use rustc_errors::ErrorReported;
56

@@ -30,20 +31,21 @@ pub enum Node<'tcx> {
3031
}
3132

3233
#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
33-
pub enum NotConstEvaluatable {
34+
pub enum NotConstEvaluatable<'tcx> {
3435
Error(ErrorReported),
3536
MentionsInfer,
3637
MentionsParam,
38+
Silent(GlobalId<'tcx>),
3739
}
3840

39-
impl From<ErrorReported> for NotConstEvaluatable {
40-
fn from(e: ErrorReported) -> NotConstEvaluatable {
41+
impl<'tcx> From<ErrorReported> for NotConstEvaluatable<'tcx> {
42+
fn from(e: ErrorReported) -> NotConstEvaluatable<'tcx> {
4143
NotConstEvaluatable::Error(e)
4244
}
4345
}
4446

4547
TrivialTypeFoldableAndLiftImpls! {
46-
NotConstEvaluatable,
48+
NotConstEvaluatable<'tcx>,
4749
}
4850

4951
impl<'tcx> TyCtxt<'tcx> {

compiler/rustc_middle/src/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ pub struct DerivedObligationCause<'tcx> {
456456
pub parent_code: Lrc<ObligationCauseCode<'tcx>>,
457457
}
458458

459-
#[derive(Clone, Debug, TypeFoldable, Lift)]
459+
#[derive(Clone, Debug, TypeFoldable)]
460460
pub enum SelectionError<'tcx> {
461461
/// The trait is not implemented.
462462
Unimplemented,
@@ -471,7 +471,7 @@ pub enum SelectionError<'tcx> {
471471
/// The trait pointed by `DefId` is not object safe.
472472
TraitNotObjectSafe(DefId),
473473
/// A given constant couldn't be evaluated.
474-
NotConstEvaluatable(NotConstEvaluatable),
474+
NotConstEvaluatable(NotConstEvaluatable<'tcx>),
475475
/// Exceeded the recursion depth during type projection.
476476
Overflow,
477477
/// Signaling that an error has already been emitted, to avoid

0 commit comments

Comments
 (0)