Add wrap/unwrap return type in Option
I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes.
I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
speedup directory traversal on windows
Optimizes walking over dirs on windows by replacing `FindFirstFileW` with `FindFirstFileExW` with `FindExInfoBasic` option, that allows skipping filling unused struct field which should be faster.
Also adds the same change for fallback call of `FindFirstFileExW` in metadata call.
Locally shows small speedup, but bench results from other users are welcome.
Update rustc-hash to version 2
This brings in the new optimized algorithm that was shown to have small performance benefits for rustc. I haven't run the rust-analyzer benchmarks.
See https://github.com/rust-lang/rustc-hash/pull/37.
Finish stabilization of `result_ffi_guarantees`
The internal linting has been changed, so all that is left is making sure we stabilize what we want to stabilize.
Rollup of 4 pull requests
Successful merges:
- #126588 (Added more scenarios where comma to be removed in the function arg)
- #131728 (bootstrap: extract builder cargo to its own module)
- #131968 (Rip out old effects var handling code from traits)
- #131981 (Remove the `BoundConstness::NotConst` variant)
r? `@ghost`
`@rustbot` modify labels: rollup
Rip out old effects var handling code from traits
Traits no longer have an effect parameter, so this removes logic associated with it. It also removes logic surrounding confirming `~const Destruct` bounds, which I added a looooong time ago, and which I don't feel like we need anymore -- if it needs to be added back, it should be rewritten :D
cc `@fee1-dead`
bootstrap: extract builder cargo to its own module
I was looking at our cargo rustflags/rustdocflags usages, and I found `builder.rs` to be a large
file which made it hard to digest. This PR tries to break out the cargo command wrapper parts to
its own submodule to make it easier to identify builder cargo-specific logic.
This PR:
- Extracts the cargo command wrapper to its own module and also move `Builder::{bare_,}cargo` impl
to the submodule.
- Reorganizes some imports in `lib.rs` (no functional changes).
- Slightly adjusts some docs in `builder.rs`.
This PR is basically just moving code around, and should not contain any functional changes.
Before this PR, `builder.rs` was 2743 lines. After this PR, `builder.rs` is down to a more
manageable 1386 lines and `cargo.rs` is 1085 lines.
Added more scenarios where comma to be removed in the function arg
This is an attempt to address the problem methion in https://github.com/rust-lang/rust/issues/106304#issuecomment-1837273666.
Copy the annotation to explain the fix
If the next Error::Extra ("next") doesn't next to current ("current")
```
fn foo(_: (), _: u32) {}
- foo("current", (), 1u32, "next")
+ foo((), 1u32)
```
If the previous error is not a `Error::Extra`, then do not trim the next comma
```
- foo((), "current", 42u32, "next")
+ foo((), 42u32)
```
Frankly, this is a fix from a test case and may not cover all scenarios
Continue to get rid of `ty::Const::{try_}eval*`
This PR mostly does:
* Removes all of the `try_eval_*` and `eval_*` helpers from `ty::Const`, and replace their usages with `try_to_*`.
* Remove `ty::Const::eval`.
* Rename `ty::Const::normalize` to `ty::Const::normalize_internal`. This function is still used in the normalization code itself.
* Fix some weirdness around the `TransmuteFrom` goal.
I'm happy to split it out further; for example, I could probably land the first part which removes the helpers, or the changes to codegen which are more obvious than the changes to tools.
r? BoxyUwU
Part of https://github.com/rust-lang/rust/issues/130704
I found builder.rs to be a massive file which made it hard to digest. To
make `RUSTFLAGS` usage hardening easier later, I extracted the cargo
part in `builder.rs` into its own module.
ci update freebsd version proposal, freebsd 12 being eol
raising to the lowest still active supported freebsd version.
From 13.1 (already eol too), freebsd introduces a cpu affinity layer
with linux. It also introduces a api compatible copy_file_range which
can be used like its linux's counterpart.
The former is essential to build https://github.com/rust-lang/rust/pull/120589, therefore breaks the backward
compatibility with the previous FreeBSD releases.
Blocked on https://github.com/rust-lang/rust/issues/130465
feat(rustdoc-json-types): mark simple enums as copy
Fixesrust-lang/rustdoc-types#26 and some typos in the documentation
r? `@aDotInTheVoid`
I have been assigning these PRs to you `@aDotInTheVoid,` is that okay? I think I'm out of PRs for now, but for future reference c:
fix(rustdoc-json-types): document rustc-hash feature
The `rustc-hash` feature is publicly exposed by the `rustdoc-types`. It is already documented in that crate's README and Cargo.toml, but we might as well add some information to the crate docs themselves c:
Follow up to:
- #131936
- [rust-lang/rustdoc-types#42][1]
[1]: https://github.com/rust-lang/rustdoc-types/pull/42
r? `@aDotInTheVoid`
Remove `lower_mono_bounds`
I'm not convinced about the usefulness of `lower_mono_bounds`, especially since we have *so* many lower-bound-like fns in HIR lowering, so I've just inlined it into its callers.
`optimize` attribute applied to things other than methods/functions/c…
…losures gives an error (#128488)
Duplicate of #128943, which I had accidentally closed when rebasing.
cc. `@jieyouxu` `@compiler-errors` `@nikomatsakis` `@traviscross` `@pnkfelix.`