Rollup of 5 pull requests
Successful merges:
- #97921 (additional docs example for replace **all** of str)
- #97970 (Fix Termination impl panic on closed stderr)
- #97991 (Use safer `strip=symbols`-flag for dylibs on macOS)
- #97992 (Stabilize scoped threads.)
- #98012 (`ValuePairs::PolyTraitRefs` should be called "trait"s in type error diagnostics)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Use safer `strip=symbols`-flag for dylibs on macOS
Closes#93988
To safely strip dylibs on macOS, the `-x` flag is needed per the manpage (see the discussion here: https://github.com/rust-lang/rust/issues/93988#issuecomment-1042574854).
Thus, when the current `crate_type` is producing a dylib (I assume this is the case for proc macros) use the `-x` flag instead of bare `strip` for `strip=symbols`.
Tidy up miscellaneous bounds suggestions
Just some small fixes to suggestions
- Generalizes `Ty::is_suggestable` into a `TypeVisitor`, so that it can be called on things other than `Ty`
- Makes `impl Trait` in arg position no longer suggestible (generalizing the fix in #97640)
- Fixes `impl Trait` not being replaced with fresh type param when it's deeply nested in function signature (fixes#97760)
- Fixes some poor handling of `where` clauses with no predicates (also #97760)
- Uses `InferCtxt::resolve_numeric_literals_with_default` so we suggest `i32` instead of `{integer}` (fixes#97677)
Sorry there aren't many tests the fixes. Most of them would just be duplicates of other tests with empty `where` clauses or `impl Trait` in arg position instead of generic params. Let me know if you'd want more test coverage.
Fix inference issues with unconstrained base expr in `type_changing_struct_update`
Use fresh infer vars to guide inference along in `type_changing_struct_update`.
Fixes#96878
Handle `def_ident_span` like `def_span`.
`def_ident_span` had an ad-hoc status in the compiler.
This PR refactors it to be a first-class citizen like `def_span`:
- it gets encoded in the main metadata loop, instead of the visitor;
- its implementation is updated to mirror the one of `def_span`.
We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.
Make -Cpasses= only apply to pre-link optimization
This change causes passes specified in -Cpasses= to be applied
only during pre-link optimization, not during LTO. This avoids
such passes running multiple times, which they may not be
designed for.
Fixes https://github.com/rust-lang/rust/issues/97713
line 1352, change `self` to `*self`, other to `*other`
The current code will not results bug, but it difficult to understand. These code result to call &f32::partial_cmp(), and the performance will be lower than the changed code. I'm not sure why the current code don't use (*self) (*other), if you have some idea, please let me know.
Rollup of 5 pull requests
Successful merges:
- #97761 (validating the vtable can lead to Stacked Borrows errors)
- #97789 (Fix#71363's test by adding `-Z translate-remapped-path-to-local-path=no`)
- #97913 (Wrap `HirId`s of locals into `LocalVarId`s for THIR nodes)
- #97979 (Fix typos in Provider API docs)
- #97987 (remove an unnecessary `String`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup