This reverts commit 3acb505ee5
(PR #101833).
The changes in this commit caused several bugs or at least
incompatibilies. For now we're reverting this commit and will re-land it
alongside fixes for those bugs.
Rollup of 8 pull requests
Successful merges:
- #102634 (compiletest: Refactor test rustcflags)
- #102721 (Prevent foreign Rust exceptions from being caught)
- #103415 (filter candidates in pick probe for diagnostics)
- #103618 (Rename some `OwnerId` fields.)
- #103625 (Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions)
- #103653 (Add missing impl blocks for item reexported from private mod in JSON output)
- #103699 (Emit proper error when casting to `dyn*`)
- #103719 (fix typo in `try_reserve` method from `HashMap` and `HashSet`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Add missing impl blocks for item reexported from private mod in JSON output
Fixes#102583.
Since we don't inline for the JSON output, the impl blocks from private modules are not present when we generate the output. To go around this limitation, in case the impl block doesn't have `#[doc(hidden)]` and is implementing a public item, we don't strip it.
cc `@fmease` `@aDotInTheVoid`
r? `@notriddle`
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions
Functions in answer:
- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`
This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3
r? `@compiler-errors`
Rename some `OwnerId` fields.
`@spastorino` noticed some silly expressions like `item_id.def_id.def_id`.
This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`.
`item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
r? `@compiler-errors`
filter candidates in pick probe for diagnostics
Fixes#103411, though also fine with closing this PR if my opinion (https://github.com/rust-lang/rust/issues/103411#issuecomment-1287900069) is shared that this doesn't need to be fixed.
```
~/rust3$ time rustc +nightly ~/test.rs 2>/dev/null
real 0m4.853s
user 0m4.837s
sys 0m0.016s
~/rust3$ time rustc +rust3 ~/test.rs 2>/dev/null
real 0m0.193s
user 0m0.169s
sys 0m0.024s
```
Also fixes#103427.
Prevent foreign Rust exceptions from being caught
Fix#102715
Use the address of a static variable (which is guaranteed to be unique per copy of std) to tell apart if a Rust exception comes from local or foreign Rust code, and abort for the latter.
compiletest: Refactor test rustcflags
Refactoring `host-rustcflags` and `target-rustcflags` from `Option<String>` to `Vec<String>`
Ref: #102438
r? `@Mark-Simulacrum`
spastorino noticed some silly expressions like `item_id.def_id.def_id`.
This commit renames several `def_id: OwnerId` fields as `owner_id`, so
those expressions become `item_id.owner_id.def_id`.
`item_id.owner_id.local_def_id` would be even clearer, but the use of
`def_id` for values of type `LocalDefId` is *very* widespread, so I left
that alone.
Support timeouts with monotonic clocks even when isolation is enabled
With the deterministic monotonic clock support we now have, we can allow some synchronization primitives with timeouts even under isolation:
- Linux futex waiting (when set to the monotonic clock)
- pthread_cond_timedwait (when set to the monotonic clock)
- Windows WaitOnAddress
Unfortunately none of these exist on macOS -- the standard library always uses the system clock for timeouts on macOS, so that will still require `-Zmiri-disable-isolation`.
Clean up tests and add documentation for GATs related stuff
This is a follow-up PR for #13494.
- addresses https://github.com/rust-lang/rust-analyzer/pull/13494#discussion_r1006774897
- documents the ordering constraint on `Binders` and `Substitution` (which is not really follow-up for the previous PR, but it was introduced to support GATs and I strongly feel it's worth it)