Fix generics_of for impl's RPITIT synthesized associated type
The only useful commit is the last one.
This makes `generics_of` for the impl side RPITIT copy from the trait's associated type and avoid the fn on the impl side which was previously wrongly used.
This solution is better but we still need to fix resolution of the generated generics.
r? ``@compiler-errors``
Add tests for configure.py
I highly recommend reviewing this with whitespace disabled.
Notably, verifying that we generate valid toml relies on python 3.11 so
we can use `tomllib`, so this also switches`x86_64-gnu-llvm-14` (one of the PR builders) to use 3.11.
While fixing that, I noticed that we stopped testing python2.7 support on PR CI in https://github.com/rust-lang/rust/pull/106085. `@fee1-dead` `@pietroalbini` please be more careful in the future, there is no CI for CI itself that verifies we are testing everything we should be.
- Separate out functions so that each unit test doesn't create a file on disk
- Add a few unit tests
Set `CMAKE_SYSTEM_NAME` for Linux targets
When bootstrap compiles native dependencies like LLVM, it should set `CMAKE_SYSTEM_NAME` for the target system; otherwise cmake may not identify that it is cross-compiling.
In particular, when building a Linux rustc on a macOS host, cmake was including `-isysroot /path/to/macOS.sdk` options that caused things to break. By setting `CMAKE_SYSTEM_NAME=Linux` when building for Linux targets, the macOS SDK is no longer passed as sysroot to the compiler.
r? bootstrap
fix ClashingExternDeclarations lint ICE
Fixes#109334
First "real" contribution, please let me know if I did something wrong.
As I understand it, it's OK if a `#[repr(transparent)]` type has no non-zero sized types (aka is a ZST itself) and the function should just return the type normally instead of panicking
r? `@Nilstrieb`
rustdoc: Remove footnote references from doc summary
Since it's one line, we don't have the footnote definition so it doesn't make sense to have the reference.
Part of https://github.com/rust-lang/rust/issues/109024.
r? `@notriddle`
Improve `Iterator::collect_into` documentation
This improves the examples in the documentation of `Iterator::collect_into`, replacing the usages of `println!` with `assert_eq!` as suggested on [IRLO](https://internals.rust-lang.org/t/18534/9).
rustdoc: implement bag semantics for function parameter search
This tweak to the function signature search engine makes things so that, if a type is repeated in the search query, it'll only match if the function actually includes it that many times.
Ignore files in .gitignore in mir opt check
This caused `./x test tidy` to fail for me when Finder (macOS) added `.DS_Store` files. They are ignored by git, so tidy should ignore them, too.
fix: fix ICE in `custom-test-frameworks` feature
Fixes#107454
Simple fix to emit error instead of ICEing. At some point, all the code in `tests.rs` should be refactored, there is a bit of duplication (this PR's code is repeated five times over lol).
r? `@Nilstrieb` (active on the linked issue?)
rustdoc: Fix missing private inlining
Fixes https://github.com/rust-lang/rust/issues/109258.
If the item isn't inlined, it shouldn't have been added into `view_item_stack`. The problem here was that it was not removed, preventing sub items to be inlined if they have a re-export in "upper levels".
cc `@epage`
r? `@notriddle`
This tweak to the function signature search engine makes things so that,
if a type is repeated in the search query, it'll only match if the
function actually includes it that many times.
Move us to the new large runners pool
For now this keeps all the configuration identical (AFAICT) but we'll likely want to play with the specifics to move some of the slower builders to larger machines and the faster builders to smaller machines, likely reducing overall usage and improving CI times. I think we should leave that to later though, not worry about it just yet.
r? `@pietroalbini`
For now this keeps all the configuration identical (AFAICT) but we'll
likely want to play with the specifics to move some of the slower
builders to larger machines and the faster builders to smaller machines,
likely reducing overall usage and improving CI times.
Rollup of 10 pull requests
Successful merges:
- #104100 (Allow using `Range` as an `Iterator` in const contexts. )
- #105793 (Add note for mismatched types because of circular dependencies)
- #108798 (move default backtrace setting to sys)
- #108829 (Use Edition 2021 :pat in matches macro)
- #108973 (Beautify pin! docs)
- #109003 (Add `useless_anonymous_reexport` lint)
- #109022 (read_buf_exact: on error, all read bytes are appended to the buffer)
- #109212 (fix: don't suggest similar method when unstable)
- #109243 (The name of NativeLib will be presented)
- #109324 (Implement FixedSizeEncoding for UnusedGenericParams.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
The name of NativeLib will be presented
Fixes#109144
I was working on a quick fix, but found change the name from `Option<Symbol>` to `Symbol` make life a little bit easier.
fix: don't suggest similar method when unstable
Fixes#109177
Don't display typo suggestions for unstable things, unless the feature flag is enabled.
AFAIK, there are two places this occurs:
- `rustc_resolve`: before type checking, effectively just `FnCtxt::Free`.
- `rustc_hir_typck`: during type checking, for `FnCtxt::Assoc(..)`s.
The linked issue is about the latter, obviously the issue is applicable to both.
r? `@estebank`
read_buf_exact: on error, all read bytes are appended to the buffer
Guarantee that when `read_buf_exact` returns, all bytes read will be
appended to the buffer. Including the case when the operations fails.
The motivating use case are operations on a non-blocking reader. When
`read_buf_exact` fails with `ErrorKind::WouldBlock` error, the operation
can be resumed at a later time.
Add `useless_anonymous_reexport` lint
This is a follow-up of https://github.com/rust-lang/rust/pull/108936. We once again show all anonymous re-exports in rustdoc, however we also wanted to add a lint to let users know that it very likely doesn't have the effect they think it has.
Beautify pin! docs
This makes pin docs a little bit less jargon-y and easier to read, by
* splitting up the sentences
* making them less interrupted by punctuation
* turning the footnotes into paragraphs, as they contain useful information that shouldn't be hidden in footnotes. Footnotes also interrupt the read flow.
Add note for mismatched types because of circular dependencies
If you have crate A with a dependency on crate B, and crate B with a dev-dependency on A, then you might see "mismatched types" errors on types that seem to be equal. This PR adds a note that explains that the types are different, because crate B is compiled twice, one time with `cfg(test)` and one time without.
I haven't found a good way to create circular dependencies in UI tests, so I abused the incremental tests instead. As a bonus, incremental tests support "cpass" now.
related to https://github.com/rust-lang/rust/issues/22750