Do not use global caches if opaque types can be defined
fixes#119272
r? `@lcnr`
This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all.
cc https://github.com/rust-lang/rust/pull/122192#issuecomment-2149252655
When converting something like `#![cfg_attr(cond, attr)]` into
`#![attr]`, we currently duplicate the `#` token and the `!` token. But
weirdly, there is also this comment:
// We don't really have a good span to use for the synthesized `[]`
// in `#[attr]`, so just use the span of the `#` token.
Maybe that comment used to be true? But now it is false: we can
duplicate the existing delimiters (and their spans and spacing), much
like we do for the `#` and `!`.
This commit does that, thus removing the incorrect comment, and
improving the spans on `Group`s in a few proc-macro tests.
Use ControlFlow in more places
Now, instead of manually using variables in visitors to signify that a visit is "done" and that the visitor should stop traversing. We use the trait type "Result" to signify this (in relevant places).
I'll schedule a perf run, I don't think it will be much of a difference, but every bit of performance is welcomed :)
changelog: Improve performance, less memory use in visitors
Fixes#12829
r? `@y21`
Make ast `MutVisitor` have the same method name and style as `Visitor`
It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.
tracking issue: https://github.com/rust-lang/rust/issues/127615
Make ast `MutVisitor` have the same method name and style as `Visitor`
It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.
tracking issue: https://github.com/rust-lang/rust/issues/127615
Rollup of 8 pull requests
Successful merges:
- #125962 (Update tracking issue for `const_binary_heap_new_in`)
- #126770 (Add elem_offset and related methods)
- #127481 (Remove generic lifetime parameter of trait `Pattern`)
- #128043 (Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core")
- #128092 (Remove wrapper functions from c.rs)
- #128100 (Allow to pass a full path for `run-make` tests)
- #128106 (Fix return type of FileAttr methods on AIX target)
- #128108 (ensure std step before preparing sysroot)
r? `@ghost`
`@rustbot` modify labels: rollup
ensure std step before preparing sysroot
When using download-rustc, any stage other than 0 or 1 (e.g., cargo +stage2 build/doc) will fail to find std while compiling on simple rust sources. Ensuring the std step fixes this issue.
r? Kobzol
Fix return type of FileAttr methods on AIX target
At some point it seems `SystemTime::new` changed from returning `SystemTime` to `io::Result<SystemTime>`. This seems to have been addressed on other platforms, but was never changed for AIX.
This was caught by running
```
python3 x.py build --host x86_64-unknown-linux-gnu --target powerpc64-ibm-aix
```
Allow to pass a full path for `run-make` tests
It's common (at least for me) to pass a full path to a `run-make` test (including the `rmake.rs` file) and to see that it isn't found, which is a bit frustrating.
With these changes, we can now optionally pass the `rmake.rs` (or even `Makefile`) at the end of the path.
cc ```@jieyouxu```
r? ```@Kobzol```
Remove wrapper functions from c.rs
I'd like for the windows `c.rs` just to contain the basic platform definitions and not anything higher level unless absolutely necessary. So this removes some wrapper functions that weren't really necessary in any case. The functions are only used in a few places which themselves are relatively thin wrappers. The "interesting" bit is that we had an `AlertableIoFn` that abstracted over `ReadFileEx` and `WriteFileEx`. I've replaced this with a closure.
Also I removed an `#[allow(unsafe_op_in_unsafe_fn)]` while I was moving things around.
Remove generic lifetime parameter of trait `Pattern`
Use a GAT for `Searcher` associated type because this trait is always implemented for every lifetime anyway.
cc #27721
Update tracking issue for `const_binary_heap_new_in`
This PR updates the tracking issue of `const_binary_heap_new_in` feature:
- Old issue: #112353
- New issue: #125961
Fix tidy check if book submodule is not checked out
This fixes tidy in a checkout without submodules. https://github.com/rust-lang/rust/pull/127786 added a new cargo workspace, and the corresponding checks in tidy. There is code in tidy to skip those checks if the submodule is checked out, but that code assumed the root of the workspace was also the root of the submodule. With `rustbook`, the root is `src/tools/rustbook`, but the submodules it needs are in the `src/doc` directory.
The solution here is to explicitly list which submodules are needed instead of assuming the root is also the submodule.
Fix running compile-test under cargo nextest
`ui_test` itself has `cargo nextest` support which we now use - https://github.com/oli-obk/ui_test/pull/161
It prints `ui_test` as its test name whereas we printed `compile_test`, this ended up being treated as a test name filter causing all the tests to be filtered out
changelog: none
Temporarily remove myself from reviewer rotation
I'm going to focus on the project goal and my own contributions, this + medical stuff leaves me not enough time to review.
I'll still review any performance related PR, and you can still request from me a benchmark for a PR, and will finish the PRs that I'm still assign to.
changelog: none
Rollup of 7 pull requests
Successful merges:
- #125886 (Migrate run make issue 15460)
- #126898 (Migrate `run-make/link-framework` to `rmake.rs`)
- #126994 (Support lists and stylings in more places for `rustc --explain`)
- #127990 (Migrate `lto-linkage-used-attr`, `no-duplicate-libs` and `pgo-gen-no-imp-symbols` `run-make` tests to rmake)
- #128060 (Fix inclusion of `wasm-component-ld` in dist artifacts)
- #128082 (Note closure captures when reporting cast to fn ptr failed)
- #128098 (make it possible to disable download-rustc if it's incompatible)
r? `@ghost`
`@rustbot` modify labels: rollup
When using download-rustc, any stage other than 0 or 1 (e.g., cargo +stage2 build/doc) will
fail to find std while compiling on simple rust sources. Ensuring the rustc step fixes
this issue.
Signed-off-by: onur-ozkan <work@onurozkan.dev>