-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
a general type system cleanup #109119
a general type system cleanup #109119
Conversation
changes to the recursion depth are scary as they can easily break crates which recurse right until that depth. @bors try @rust-timer build |
⌛ Trying commit 66ce86eb3b9141650972282a4c568bc2d6f76863 with merge b9d6bd6dc9d9fa058c92b56258df6e48604cc5b7... |
@rust-timer queue it's not build '^^ |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@@ -59,6 +59,7 @@ fn equate_intrinsic_type<'tcx>( | |||
require_same_types( | |||
tcx, | |||
&cause, | |||
ty::ParamEnv::empty(), // FIXME: do all intrinsics have an empty param env? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intrinsics can have where clauses (const_eval_select
is the only one at first glance?)
// FIXME: This should potentially just add the obligation to the `FnCtxt` | ||
let ocx = ObligationCtxt::new(&self.infcx); | ||
ocx.register_obligation(obligation); | ||
Err(ocx.select_all_or_error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably use these errors eagerly for better diagnostics. It's likely possible to re-create this obligation_for_method
in the diagnostics code and re-process it though, or move the diagnostics code into the ObligationCauseCode::BinOp
handling branch of note_cause_code
or whatever.
|
||
let has_impl = self.infcx.predicate_may_hold(&obligation); | ||
// FIXME: should this call a `predicate_must_hold` variant instead? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably.
@bors try |
⌛ Trying commit 774e3effe1d05b60f5829730be7f7a13abc1be3e with merge 7a89b05fa7ebfbb9dd798a7dbd888c0550beb838... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7a89b05fa7ebfbb9dd798a7dbd888c0550beb838): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
let's see if anything breaks due to the recursion depth changes @craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
774e3ef
to
5b7662d
Compare
🎉 Experiment
|
the only breakage seems to be https://crates.io/crates/indented-blocks/0.6.0 which has an explicit @rustbot ready |
r=me rebased |
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
5b7662d
to
b8541eb
Compare
@bors r+ |
@bors r=compiler-errors |
💡 This pull request was already approved, no need to approve it again.
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (9bdb488): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
…r-errors a general type system cleanup removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context. changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR. also removes some other small - and imo unnecessary - helpers. r? types
removes the helper functions
traits::fully_solve_X
as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.changes the way we deal with overflow to always add depth in
evaluate_predicates_recursively
. It may make sense to actually fully transition to not haverecursion_depth
on obligations but that's probably a bit too much for this PR.also removes some other small - and imo unnecessary - helpers.
r? types