perf: Only search potentially changed constraints in lexical_region_resolve
Gives a big performance increase to the unicode_normalization benchmark in my testing.
Rollup of 9 pull requests
Successful merges:
- #66660 (Don't warn about snake case for field puns.)
- #68093 (Fix deref impl typedef)
- #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`)
- #68256 (Do not ICE on malformed suggestion spans)
- #68279 (Clean up E0198 explanation)
- #68291 (Update sanitizer tests)
- #68312 (Add regression test for integer literals in generic arguments in where clauses)
- #68314 (Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval)
- #68317 (Clean up E0199 explanation)
Failed merges:
r? @ghost
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval
This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks.
cc @ecstatic-morse
r? @eddyb
Update sanitizer tests
* Move tests from src/test/run-make-fulldeps to src/test/ui.
* Fix memory sanitizer test to detect the intended issue rather than
an unrelated one caused by the use of an uninstrumented std.
Do not ICE on malformed suggestion spans
Under the assumption that suggestions are by their very nature always "best effort", it is ok if we don't display them instead of having an ICE. The underlying issue of the malformed span being _created_ is left unaddressed.
Fix#67567.
r? @petrochenkov
Use named fields for `{ast,hir}::ItemKind::Impl`
Currently, the widely used `ItemKind::Impl` variant is a tuple with seven fields. I want to add an eighth in #68140, which means I have to update most matches on this variant anyways. Giving a name to each field improves readability and makes future changes of this nature much simpler.
This change will cause several tools to break. I will fix them once this is merged.
Region naming refactoring [6/N]
Followup to #67474
EDIT: this PR is probably best read commit-by-commit...
The major changes in this PR include:
- moving many functions around to modules that better suit them. In particular, a lot of methods were moved from `borrow_check::diagnostics::region_errors` to `borrow_check::region_infer`, and `report_region_errors` was moved from `borrow_check` to `borrow_check::diagnostics::region_errors`.
- `borrow_check::diagnostics::{region_errors, region_name}` are now most comprised of methods on `MirBorrowckCtxt` instead of `RegionInferenceContext`, allowing us to get rid of the annoying `pub(in crate::borrow_check)` on most of the fields of the latter, along with a number of method arguments on many methods.
- I renamed `MirBorrowckCtxt.nonlexical_regioncx` to just `regioncx` because their is no lexical lifetimes any more, and the old name was annoyingly verbose, causing many lines to wrap unnecessarily.
- I got rid of `ErrorRegionNamingContext`. Region naming is implemented as inherent methods on `MirBorrowckCtxt`, so we just move the naming stuff into that struct.
The PR is rather large, but the commits are fairly self-contained (though they don't all compile). There was one minor output change to one test with `compare-mode=nll`, which I think is acceptable.
Between this PR and the last one, a net of 200 lines are removed, most of which was function parameters and context structs 🎉
Some samples:
```diff
- self.nonlexical_regioncx.free_region_constraint_info(
- &self.body,
- &self.local_names,
- &self.upvars,
- self.mir_def_id,
- self.infcx,
- borrow_region_vid,
- region,
- );
+ self.free_region_constraint_info(borrow_region_vid, region);
```
```diff
- .or_else(|| {
- self.give_name_if_anonymous_region_appears_in_yield_ty(
- infcx,
- body,
- *mir_def_id,
- fr,
- renctx,
- )
- });
+ .or_else(|| self.give_name_if_anonymous_region_appears_in_arguments(fr))
```
r? @matthewjasper
cc @eddyb
See ip(4P) man page:
IP_MULTICAST_TTL Time to live for multicast datagrams. This option
takes an unsigned character as an argument. Its
value is the TTL that IP uses on outgoing multi-
cast datagrams. The default is 1.
IP_MULTICAST_LOOP Loopback for multicast datagrams. Normally multi-
cast datagrams are delivered to members on the
sending host (or sending zone). Setting the
unsigned character argument to 0 causes the oppo-
site behavior, meaning that when multiple zones
are present, the datagrams are delivered to all
zones except the sending zone.
https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.htmlhttps://man.openbsd.org/ip.4
[self-profiler] Add example to `-Z help` to turn on query key recording
Also add the `default` option so that it's easy to add query key
recording to the default.
r? @michaelwoerister