-
Notifications
You must be signed in to change notification settings - Fork 13.4k
TypingMode: merge intercrate, reveal, and defining_opaque_types #131856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,9 @@ use rustc_middle::query::TyCtxtAt; | |
use rustc_middle::ty::layout::{ | ||
self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers, TyAndLayout, | ||
}; | ||
use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt, TypeFoldable, Variance}; | ||
use rustc_middle::ty::{ | ||
self, GenericArgsRef, ParamEnv, Ty, TyCtxt, TypeFoldable, TypingMode, Variance, | ||
}; | ||
use rustc_middle::{mir, span_bug}; | ||
use rustc_session::Limit; | ||
use rustc_span::Span; | ||
|
@@ -325,7 +327,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { | |
return true; | ||
} | ||
// Slow path: spin up an inference context to check if these traits are sufficiently equal. | ||
let infcx = self.tcx.infer_ctxt().build(); | ||
let infcx = self.tcx.infer_ctxt().build(TypingMode::from_param_env(self.param_env)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FIXME for: this could use a typing mode based off of the body of the root we're evaluating, idk if we have that info. ?? I guess that's morally equivalent to deriving it from the param-env tho. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extended the comment for /// FIXME(#132279): Using this function is questionable as the `param_env`
/// does not track `defining_opaque_types` and whether we're in coherence mode.
/// Many uses of this function should also use a not-yet implemented typing mode
/// which reveals already defined opaque types in the future. This function will
/// get completely removed at some point.
yeah, this should use the |
||
let ocx = ObligationCtxt::new(&infcx); | ||
let cause = ObligationCause::dummy_with_span(self.cur_span()); | ||
// equate the two trait refs after normalization | ||
|
Uh oh!
There was an error while loading. Please reload this page.