-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
add TypingMode::Borrowck
#138785
base: master
Are you sure you want to change the base?
add TypingMode::Borrowck
#138785
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
add `TypingMode::Borrowck` Still not quite ready Based on rust-lang#138492 and rust-lang#138719 r? `@compiler-errors` `@oli-obk`
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
78732a8
to
9b611a3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
0b44108
to
d7cf428
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
add `TypingMode::Borrowck` Still not quite ready Based on rust-lang#138492 r? `@compiler-errors` `@oli-obk`
⌛ Trying commit d7cf428 with merge f8ad33e35a8aba1c9928e3c863abba2373e0d978... |
b9c1319
to
a23f7df
Compare
increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
a23f7df
to
cbcc802
Compare
@rustbot ready |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor This PR changes a file inside Some changes occurred in exhaustiveness checking cc @Nadrieril |
cbcc802
to
83109dd
Compare
//~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias | ||
|| () |
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.
unfortunate side-effect from HIR typeck eagerly replacing the return type with an inference var. This will be partially fixed when removing this eager normalization call. The new solver does point to the closure instead.
However, as we're still normalizing away opaques to infer vars during generalization, there may still be span regressions where we point at the place introducing the opaque instead of the place which actually constrains it. This feels unavoidable without major changes to the way we track spans for opaques/in the type system in general.
@@ -7,8 +7,7 @@ fn main() { | |||
fn test<T: Display>(t: T, recurse: bool) -> impl Display { | |||
let f = || { | |||
let i: u32 = test::<i32>(-1, false); | |||
//~^ ERROR concrete type differs from previous defining opaque type use | |||
//~| ERROR expected generic type parameter, found `i32` | |||
//~^ ERROR expected generic type parameter, found `i32` |
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.
error tainting 🎉
83109dd
to
6e4f81e
Compare
@rust-timer build d7cf428 |
Rollup merge of rust-lang#139022 - lcnr:incr-obligation-depth, r=oli-obk increment depth of nested obligations properly fixes the root cause of rust-lang#109268. While we didn't get hangs here before, I ended up encountering its root cause again with rust-lang#138785. r? types
…errors small opaque type/borrowck cleanup pulled out of rust-lang#138785
First two commits are from #139191.
Introduces
TypingMode::Borrowck
which unlikeTypingMode::Analysis
, uses the hidden type computed by HIR typeck as the initial value of opaques instead of an unconstrained infer var. This is a part of rust-lang/types-team#129.Using this new
TypingMode
is unfortunately a breaking change for now, see tests/ui/impl-trait/non-defining-uses/as-projection-term.rs. Using an inference variable as the initial value results in non-defining uses in the defining scope. We therefore only enable it if with-Znext-solver=globally
or-Ztyping-mode-borrowck
To do that the PR contains the following changes:
TypeckResults::concrete_opaque_type
are already mapped to the definition of the opaque typefn check_opaque_type_parameter_valid
is moved fromrustc_borrowck
torustc_trait_selection
query type_of_opaque_hir_typeck
which, using the same visitors as MIR typeck, attempts to merge the hidden types from HIR typeck from all defining scopesDefiningScopeKind
flag to toggle between using borrowck and HIR typeckTypingMode::Borrowck
, but adding it to the new structure is annoying and it's not soundness critical, so I intend to not add it back.TypingMode::Borrowck
which behaves just likeTypingMode::Analysis
except when normalizing opaque typestype_of_opaque_hir_typeck(opaque)
as the initial value after replacing its regions with new inference varsfixes #112201, fixes #132335, fixes #137751
r? @compiler-errors @oli-obk