```
error[E0412]: cannot find type `T` in this scope
--> file.rs:3:12
|
3 | impl Trait<T> for Struct {}
| - ^ not found in this scope
| |
| help: you might be missing a type parameter: `<T>`
```
Fix#64298.
rustc: Allow cdylibs to link against dylibs
Previously, rustc mandated that cdylibs could only link against rlibs as dependencies (not dylibs).
This commit disables that restriction and tests that it works in a simple case.
I don't have a windows rustc dev environment, so I guessed at the MSVC test code, I'm hoping the CI can run that for me.
Additionally, we might want to consider emitting (through cargo or rustc) some metadata to help C users of a cdylib figure out where all the dylibs they need are. I don't think that should be needed to land this change, as it will still be usable by homogeneous build systems without it.
My new test was templated off the `tests/run-make-fulldeps/cdylib` test. It seemed more appropriate to have it as a separate test, since both foo.rs and bar.rs would need to be replicated to make that test cover both cases, but I can do that if it would be preferred.
If I'm doing anything out of order/process, please let me know; this is only my second change to rustc and the prior one was trivial.
r? alexcrichton
Fix invalid link to the C++ Exception Handling ABI documentation
The original link is longer valid(404). I am assuming it's meant to be pointed to the Itanium C++ Exception Handling ABI documentation.
Also share drop-glue when compiling with -Zshare-generics (i.e. at opt-level=0)
This PR adds drop-glue to the set of monomorphizations that can be shared across crates via `-Zshare-generics`.
This version of the PR might have detrimental effects on performance as it makes lots of stuff dependent on a single query results (`upstream_monomorphizations_for(def_id_of_drop_in_place)`). That should be fixable but let's do a perf run first.
Potentially fixes issue https://github.com/rust-lang/rust/issues/64140. (cc @alexcrichton)
The changes here are related to @matthewjasper's https://github.com/rust-lang/rust/pull/67332 but should be mostly orthogonal.
r? @ghost
Rollup of 7 pull requests
Successful merges:
- #68424 (Suggest borrowing `Vec<NonCopy>` in for loop)
- #68438 (Account for non-types in substs for opaque type error messages)
- #68469 (Avoid overflow in `std::iter::Skip::count`)
- #68473 (Enable ASan on Fuchsia)
- #68479 (Implement `unused_parens` for block return values)
- #68483 (Add my (@flip1995) name to .mailmap)
- #68500 (Clear out std, not std tools)
Failed merges:
r? @ghost
Clear out std, not std tools
This was a typo that slipped in, and meant that we were still not properly
clearing out std.
This is basically #67760 but actually correct...
Enable ASan on Fuchsia
This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to
those allowed to invoke -Zsanitizer. Currently, the only overlap between
compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
Avoid overflow in `std::iter::Skip::count`
The call to `count` on the inner iterator can overflow even if `Skip` itself would return less that `usize::max_value()` items.
Fixes#68139
Account for non-types in substs for opaque type error messages
Fixes#68368
Previously, I assumed that the substs contained only types, which caused
the computed index number to be wrong.
Update some of Cargo's dependencies
This is primarily updating the `curl` dependency, but also went ahead
and applied a few updates for other packages that Cargo depends on.
Previously, rustc mandated that cdylibs could only link against rlibs as
dependencies (not dylibs).
This commit disables that restriction and tests that it works in a
simple case.
compiletest: Simplify multi-debugger support
Previous implementation used a single mode type to store various pieces
of otherwise loosely related information:
* Whether debuginfo mode is in use or not.
* Which debuggers should run in general.
* Which debuggers are enabled for particular test case.
The new implementation introduces a separation between those aspects.
There is a single debuginfo mode parametrized by a debugger type.
The debugger detection is performed first and a separate configuration
is created for each detected debugger. The test cases are gathered
independently for each debugger which makes it trivial to implement
support for `ignore` / `only` conditions.
Functional changes:
* A single `debuginfo` entry point (rather than `debuginfo-cdb`, `debuginfo-gdb+lldb`, etc.).
* Debugger name is included in the test name.
* Test outputs are placed in per-debugger directory.
* Fixed spurious hash mismatch. Previously, the config mode would change
from `DebugInfoGdbLldb` (when collecting tests) to `DebugInfoGdb` or
`DebugInfoLldb` (when running them) which would affect hash computation.
* PYTHONPATH is additionally included in gdb hash.
* lldb-python and lldb-python-dir are additionally included in lldb hash.
Avoid declaring a fake dependency edge
When we're producing an rlib, we do not need anything more than an rmeta file
for each of our dependencies (this is indeed utilized by Cargo for pipelining).
Previously, we were still storing the paths of possible rlib/dylib crates, which
meant that they could still plausibly be accessed. With -Zbinary-dep-depinfo,
that meant that Cargo thought that rustc was using both the rlib and an (earlier
emitted) rmeta, and so needed a recompile, as the rlib may have finished writing
*after* compilation started (for more detail, see issue 68149).
This commit changes metadata loading to not store the filepaths of dylib/rlib if
we're going to end up creating an rlib only.
Fixes#68149.