Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children#158360
Conversation
Instead of having to taint both infcx and root_cx, we always just taint infcx (which usually gets automatically tainted from emitting diagnostics), and at the end (before dropping the infcx) we move the taint over to the root_cx
…ame as their parent
|
@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.
Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8860163): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never 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 -5.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.9%)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: 510.446s -> 505.876s (-0.90%) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@rustbot reroll |
| if count > 10 { | ||
| diag.note(format!("...and {} other attempted mutable borrows", count - 10)); | ||
| } | ||
| self.buffer_error(diag); |
There was a problem hiding this comment.
existing: but this is confusing. we don't drop any later errors here, do we?
so if we have 15 buffered mut errors, we still emit 15 errors, don't we?
There was a problem hiding this comment.
There is one diagnostic per binding. If the binding has more than 10 mutable borrows, we don't emit a note for all of them. This is information already in the diag. unsure why we don't add the above not immediately when stopping to add more mutable borrow notes
There was a problem hiding this comment.
ah no, this makes sense, we eagerly mutate the diagnostic and stop doing so when count > 10, but only want to add a single note telling us how many attempted mutable borrows there are
| if tcx.is_typeck_child(item.to_def_id()) { | ||
| return tcx.opaque_types_defined_by(tcx.local_parent(item)); | ||
| } |
There was a problem hiding this comment.
alternative is to debug_assert this and make sure we never call it for typeck children 🤔 where do we currently use it for them
There was a problem hiding this comment.
That's a huge diff. I'll do that as a separate PR. We call param_env on the children's DefId all over the place
There was a problem hiding this comment.
unless you want to work on it right away, would you mind opening an issue for this cleanup (or add a FIXME)
There was a problem hiding this comment.
I already have a commit started, which is how I observed it was gonna be too much for this PR
|
r? lcnr |
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children Various things I noticed while figuring out how to best allow changing some borrowck errors into FCWs cc @rust-lang/types for the typeck children stuff, in case I missed some memo and am undoing some work r? @ghost need perf first
…uwer Rollup of 7 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children Various things I noticed while figuring out how to best allow changing some borrowck errors into FCWs cc @rust-lang/types for the typeck children stuff, in case I missed some memo and am undoing some work r? @ghost need perf first
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
Rollup merge of #158360 - oli-obk:borrowck-cleanups, r=lcnr Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children Various things I noticed while figuring out how to best allow changing some borrowck errors into FCWs cc @rust-lang/types for the typeck children stuff, in case I missed some memo and am undoing some work r? @ghost need perf first
…uwer Rollup of 15 pull requests Successful merges: - rust-lang/rust#153697 (Add arg splat experiment initial tuple impl) - rust-lang/rust#158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - rust-lang/rust#158438 (Use rigidness marker in fast_reject) - rust-lang/rust#157127 (cg_LLVM: Stop needing an alloca for volatile loads) - rust-lang/rust#158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - rust-lang/rust#158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - rust-lang/rust#158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - rust-lang/rust#158355 (Fixup the refactoring errors in rust-lang/rust#156246) - rust-lang/rust#158361 (Move `check_ffi_pure` into the attribute parser) - rust-lang/rust#158382 (Add safety section for SliceIndex::get_unchecked(mut)) - rust-lang/rust#158399 (std: truncate thread names on NetBSD) - rust-lang/rust#158418 (Eliminate double length check in `Vec::into_array`) - rust-lang/rust#158430 (Guard clone suggestion against empty obligation errors) - rust-lang/rust#158446 (Update Enzyme submodule) - rust-lang/rust#158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
|
@rust-timer build 6c2bd6b |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6c2bd6b): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never 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 -2.2%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 486.597s -> 484.848s (-0.36%) |
Various things I noticed while figuring out how to best allow changing some borrowck errors into FCWs
cc @rust-lang/types for the typeck children stuff, in case I missed some memo and am undoing some work
r? @ghost need perf first