cleanup borrowck, improve c-variadic handling - #160504
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cleanup borrowck, improve c-variadic handling
This comment has been minimized.
This comment has been minimized.
| DefiningTy::Const(body_def_id.to_def_id(), args) | ||
| } | ||
| } | ||
| BodyOwnerKind::Const { inline: true } => { |
There was a problem hiding this comment.
The commit message could say that inline is already set exactly by checking the above match arm guard
| /// The bound variables for a given defining type. This differs from their usual bound vars | ||
| /// in that closures and coroutine closures have an additional `'env`, while C-variadic | ||
| /// functions have an additional region for their implicit `VaList` input. |
There was a problem hiding this comment.
why don't we generally give them those bound vars earlier?
There was a problem hiding this comment.
because they are used by users of these closures and FnDefs. The fn-sig of a closure || { upvar += 1; } is fn() for users during type checking and for<'env> fn(&'env mut self) when borrow checking the closure.
We could eagerly infer closure signatures as for<'env> fn(<?closure_kind as ClosureKind::SelfTy<'env>) and then it's always consistent. I don't know how that would work with the &VaList argument which doesn't really exist anywhere. Though I do feel like using fn_sig for c-variadic functions is generally kinda messed up 🤔
|
Reminder, once the PR becomes ready for a review, use |
|
Finished benchmarking commit (e60c57e): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.6%, secondary -0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.1%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.838s -> 488.617s (-0.25%) |
The field of `BodyOwnerKind` is computed via the exact same way as this check.
|
@bors r=oli-obk rollup |
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
Rollup of 14 pull requests Successful merges: - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160504 (cleanup borrowck, improve c-variadic handling) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs)
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
…uwer Rollup of 21 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls) - #160649 (move naked function ui tests)
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
…uwer Rollup of 20 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls)
cleanup borrowck, improve c-variadic handling The first commits of rust-lang#160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for rust-lang#160491 is otherwise a mess. r? types
…uwer Rollup of 28 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #160673 (Improve `canonical_param_env_cache`) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160683 (Add regression test for unknown feaeture name reported with other errors) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #159816 (added note/help about iterator invalidation when mutating a collection inside a for loop) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160633 (delegation: fix determining wrong `FnKind` when delegation is inside const arg) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls) - #160649 (move naked function ui tests) - #160672 (Improve `MaybeLiveLocals`) - #160693 (Add branch config for perf. unrolling in bors) - #160696 (rustc_codegen_llvm: handle sm_101* features being an alias) - #160706 (renovate: clarify that vulnerability PRs are opened automatically)
Rollup merge of #160504 - lcnr:borrowck-cleanup, r=oli-obk cleanup borrowck, improve c-variadic handling The first commits of #160491. Hopefully all of them make sense. It feels intuitive to me that the `c-variadic` region should be just another late-bound region and tracking region correctly for #160491 is otherwise a mess. r? types
…uwer Rollup of 28 pull requests Successful merges: - rust-lang/rust#159784 (Hint that memchr returns an in-bounds index) - rust-lang/rust#160673 (Improve `canonical_param_env_cache`) - rust-lang/rust#150885 (Revive L4Re target) - rust-lang/rust#159643 (Add support for splatted function pointers) - rust-lang/rust#160433 (delegation: add support for wrapping of the return value with `From::from`) - rust-lang/rust#160530 (refactor handling of target features in Session) - rust-lang/rust#160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - rust-lang/rust#160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - rust-lang/rust#160683 (Add regression test for unknown feaeture name reported with other errors) - rust-lang/rust#157641 (Do not promote extern statics) - rust-lang/rust#158904 (Fix FutureDropPoll shim for by-move async closures) - rust-lang/rust#159816 (added note/help about iterator invalidation when mutating a collection inside a for loop) - rust-lang/rust#160103 (Add regression test for GAT bound mismatched type error) - rust-lang/rust#160335 (dlopen offload) - rust-lang/rust#160445 (codegen: classify localized MSVC linker progress as linker_info) - rust-lang/rust#160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - rust-lang/rust#160504 (cleanup borrowck, improve c-variadic handling) - rust-lang/rust#160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - rust-lang/rust#160587 (Add regression test for associated type outlives bound at call site) - rust-lang/rust#160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - rust-lang/rust#160633 (delegation: fix determining wrong `FnKind` when delegation is inside const arg) - rust-lang/rust#160636 (derive(Diagnostic): link to proper docs) - rust-lang/rust#160644 (Clean up some manual debug impls) - rust-lang/rust#160649 (move naked function ui tests) - rust-lang/rust#160672 (Improve `MaybeLiveLocals`) - rust-lang/rust#160693 (Add branch config for perf. unrolling in bors) - rust-lang/rust#160696 (rustc_codegen_llvm: handle sm_101* features being an alias) - rust-lang/rust#160706 (renovate: clarify that vulnerability PRs are opened automatically)
The first commits of #160491. Hopefully all of them make sense.
It feels intuitive to me that the
c-variadicregion should be just another late-bound region and tracking region correctly for #160491 is otherwise a mess.r? types