Add a command to install a git hook to automatically run `x.py test tidy --bless`
Some folks (such as myself) would probably find a lot of convenience in a pre-commit hook that automatically runs tidy before committing, to avoid burning CI time learning that your commit wasn't tidy.
I'm absolutely positive I have missed some stuff. I basically just got this to where you can run `./x.py run install-git-hook` and then clicked the commit button. Please let me know what else you'd like me to add before this can be merged!
[rustc-dev-guide companion PR](https://github.com/rust-lang/rustc-dev-guide/pull/848)
Sometimes, a backend may need to emit warnings, errors, or otherwise
need to know the span of the current item in a basic block. So, add a
set_span method to give the backend that information.
Separate projection bounds and predicates
Follow up to #72788.
- Rename `projection_predicates` to `item_bounds`
- Separate bounds on associated types (the things after the `:` in `type X: ...`) and opaque types (the things after `impl`) from predicates.
- Projection candidates now have the correct nested obligations
- Trait object candidates now check that the associated types on the trait object satisfy their bounds as nested obligations
- Type alias impl trait types are now checked (#73035)
- `feature(generic_associated_types)` no longer changes how we handle bounds (#73816)
Opening for a perf and crater runs.
r? `@nikomatsakis`
Only check the own predicates of associated types when confirming
projection candidates.
Also consider implied bounds when comparing trait and impl methods.
Normalizing `<dyn Iterator<Item = ()> as Iterator>::Item` no longer
requires selecting `dyn Iterator<Item = ()>: Iterator`. This was
previously worked around by using a special type-folder to normalize
things.
Bounds of the form `type Future: Future<Result=Self::Result>` exist in
some ecosystem crates. To validate these bounds for trait objects we
need to normalize `Self::Result` in a way that doesn't cause a cycle.
Implement advance_by, advance_back_by for iter::Chain
Part of #77404.
This PR does two things:
- implement `Chain::advance[_back]_by` in terms of `advance[_back]_by` on `self.a` and `advance[_back]_by` on `self.b`
- change `Chain::nth[_back]` to use `advance[_back]_by` on `self.a` and `nth[_back]` on `self.b`
This ensures that `Chain::nth` can take advantage of an efficient `nth` implementation on the second iterator, in case it doesn't implement `advance_by`.
cc `@scottmcm` in case you want to review this
Rollup of 13 pull requests
Successful merges:
- #76388 (Add a note about the panic behavior of math operations on time objects)
- #76855 (Revamp rustdoc docs about documentation using `cfg`)
- #76995 (Reduce boilerplate with the matches! macro)
- #77228 (Add missing examples for MaybeUninit)
- #77528 (Avoid unchecked casts in net parser)
- #77534 (Disallow overriding forbid in same scope)
- #77555 (Allow anyone to set regression labels)
- #77558 (Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml})
- #77559 (Fix rustdoc warnings about invalid Rust syntax)
- #77560 (Fix LitKind's byte buffer to use refcounted slice)
- #77573 (Hint doc use convert::identity relative link)
- #77587 (Fix span for unicode escape suggestion.)
- #77591 (Record `expansion_that_defined` into crate metadata)
Failed merges:
r? `@ghost`
Record `expansion_that_defined` into crate metadata
Fixes#77523
Now that hygiene serialization is implemented, we also need to record
`expansion_that_defined` so that we properly handle a foreign
`SyntaxContext`.