If the compiler is built with `rpath = false`, then it won't find its
own libraries unless the library search path is set. We already do that
while running the actual compiletests, but #100260 added another rustc
command for getting the target cfg.
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc"
--- stdout
--- stderr
[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory
', src/tools/compiletest/src/common.rs:476:13
Now the library path is set here as well, so it works without rpath.
All static files used by rustdoc are now stored in static.files/ and
include a hash of their contents. They no longer include the contents of
the --resource-suffix flag. This clarifies caching semantics. Anything
in static.files can use Cache-Control: immutable because any updates
will show up as a new URL.
Invocation-specific files like crates-NN.js, search-index-NN.js,
and sidebar-items-NN.js still get the resource suffix.
The --disable-minification flag is removed because it would vary the
output of static files based on invocation flags. Instead, for
rustdoc development purposes it's preferable to symlink static files
to a non-minified copy for quick iteration.
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.