-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a2dd7d
commit 954419a
Showing
36 changed files
with
339 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ use rustc_span::Span; | |
use rustc_target::abi::call::FnAbi; | ||
use rustc_target::abi::{Align, HasDataLayout, Size, TargetDataLayout}; | ||
use rustc_trait_selection::traits::ObligationCtxt; | ||
use tracing::{debug, trace}; | ||
use tracing::{debug, instrument, trace}; | ||
|
||
use super::{ | ||
err_inval, throw_inval, throw_ub, throw_ub_custom, Frame, FrameInfo, GlobalId, InterpErrorInfo, | ||
|
@@ -315,6 +315,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { | |
|
||
/// Check if the two things are equal in the current param_env, using an infctx to get proper | ||
/// equality checks. | ||
#[instrument(level = "trace", skip(self), ret)] | ||
pub(super) fn eq_in_param_env<T>(&self, a: T, b: T) -> bool | ||
where | ||
T: PartialEq + TypeFoldable<TyCtxt<'tcx>> + ToTrace<'tcx>, | ||
|
@@ -330,13 +331,20 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { | |
// equate the two trait refs after normalization | ||
let a = ocx.normalize(&cause, self.param_env, a); | ||
let b = ocx.normalize(&cause, self.param_env, b); | ||
if ocx.eq(&cause, self.param_env, a, b).is_ok() { | ||
if ocx.select_all_or_error().is_empty() { | ||
// All good. | ||
return true; | ||
} | ||
|
||
if let Err(terr) = ocx.eq(&cause, self.param_env, a, b) { | ||
trace!(?terr); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
compiler-errors
Author
Member
|
||
return false; | ||
} | ||
|
||
let errors = ocx.select_all_or_error(); | ||
if !errors.is_empty() { | ||
trace!(?errors); | ||
return false; | ||
} | ||
return false; | ||
|
||
// All good. | ||
true | ||
} | ||
|
||
/// Walks up the callstack from the intrinsic's callsite, searching for the first callsite in a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This seems like it would be rather noisy, inequality can occur in perfectly fine executions.