-
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
Use Binder<Vec<Ty>>
instead of Vec<Binder<Ty>>
in both solvers for sized/auto traits/etc.
#137689
Conversation
changes to the core type system |
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.
r=me with or without nit
if !binder.as_ref().skip_binder().has_escaping_bound_vars() { | ||
return binder.skip_binder(); |
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.
to avoid clone?
do we do this more often, I've encountered this myself and have considered try_no_bound_vars() -> Result<T, Binder<T>>
or maybe just changing no_bound_vars
to that
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.
well now in this pr we're entering whole binders of vecs rather than iterating over a vec of binder of ty which we then enter, so we do this more often i think
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.
"do we do this more often"
as in: the pattern of no_bound_vars()
and doing something with the binder if it returns None
.
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.
ohhh, as far as i can tell, no this seems like the only place where we were previously repeatedly fighting the Copy bound bc no_bound_vars consumes its valur
@bors r=lcnr rollup |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc. It's more conceptually justified IMO, especially when binders get implications. r? lcnr
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#137045 (Defer repeat expr `Copy` checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277) - rust-lang#137634 (Update `compiler-builtins` to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const) - rust-lang#137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats) - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision) - rust-lang#137735 (Update E0133 docs for 2024 edition) - rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match) - rust-lang#137771 (Tweak incorrect ABI suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#137045 (Defer repeat expr `Copy` checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277) - rust-lang#137634 (Update `compiler-builtins` to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const) - rust-lang#137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats) - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision) - rust-lang#137735 (Update E0133 docs for 2024 edition) - rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match) - rust-lang#137771 (Tweak incorrect ABI suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#137045 (Defer repeat expr `Copy` checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277) - rust-lang#137634 (Update `compiler-builtins` to 0.1.149) - rust-lang#137686 (Handle asm const similar to inline const) - rust-lang#137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats) - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision) - rust-lang#137735 (Update E0133 docs for 2024 edition) - rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match) - rust-lang#137771 (Tweak incorrect ABI suggestion) r? `@ghost` `@rustbot` modify labels: rollup
Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc. It's more conceptually justified IMO, especially when binders get implications. r? lcnr
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#137045 (Defer repeat expr `Copy` checks to end of type checking) - rust-lang#137171 (Suggest swapping equality on E0277) - rust-lang#137686 (Handle asm const similar to inline const) - rust-lang#137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.) - rust-lang#137718 (Use original command for showing sccache stats) - rust-lang#137730 (checked_ilog tests: deal with a bit of float imprecision) - rust-lang#137735 (Update E0133 docs for 2024 edition) - rust-lang#137742 (unconditionally lower match arm even if it's unneeded for never pattern in match) - rust-lang#137771 (Tweak incorrect ABI suggestion and make suggestion verbose) Failed merges: - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137689 - compiler-errors:coroutine, r=lcnr Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc. It's more conceptually justified IMO, especially when binders get implications. r? lcnr
It's more conceptually justified IMO, especially when binders get implications.
r? lcnr