This commit skips generating debuginfo type metadata if substitutions
are required by the type. This avoids ICEs that result from layouts
of types with substitutions being computed.
Signed-off-by: David Wood <david@davidtw.co>
This commit adds doc comments to the `param_at`, `region_param` and
`const_param` methods on the `Generics` struct.
Signed-off-by: David Wood <david@davidtw.co>
This commit modifies the `substitute_normalize_and_test_predicates`
query, renaming it to `impossible_predicates` and only checking
predicates which do not require substs. By making this change,
polymorphization doesn't have to explicitly support vtables.
Signed-off-by: David Wood <david@davidtw.co>
This commit modifies the `STILL_FURTHER_SPECIALIZABLE` flag so that the
flag isn't set by the parent substs of closures or generators.
Signed-off-by: David Wood <david@davidtw.co>
This commit renames `should_monomorphize_locally` to
`should_codegen_locally` which better describes what the function
determines once polymorphization is added.
Signed-off-by: David Wood <david@davidtw.co>
This commit avoids a natural, free-range double substitution error by
monomorphizing the projection element before getting the type.
Signed-off-by: David Wood <david@davidtw.co>
std: Fix compilation without backtrace feature
This should hopefully handle #74484 but in any case fixes compilation of
the standard library without the `backtrace` feature. The need for this
feature is somewhat unclear now because the `backtrace` crate should
always compile (no more C code!) but we can handle that later if
necessary.
fix documentation surrounding the `in` and `for` keywords
Addresses #74529
The `in` keyword incorrectly referenced the `Iterator` trait. This reference was changed to `IntoIterator` without changing the underlying link.
Additionally, the `IntoIterator` trait was referenced towards the end of the documentation for `for`. An additional reference was added earlier and broadened the existing documentation from any iterator to anything that can be turned into an iterator.
Only skip impls of foreign unstable traits
Previously unstable impls were skipped, which meant that any impl with an unstable method would get skipped.
Fixes#74531.
Add myself to toolstate change notifications for rustfmt
I'd like to get the toolstate change notifications for rustfmt as well so that I'll know when things break.
Have spoken with @topecongiro about this offline already.
Improve documentation for `core::fmt` internals
The public interface of `core::fmt` is well-documented, but the internals have very minimal documentation.
do not try fetching the ancestors of errored trait impls
fixes#74483
While building the specialization graph, we use `tcx.all_impls` which discards impls with incorrect self types,
we do however call `trait_def.ancestors` with these impls which caused an ICE as they aren't part of the
specialization graph.
Improve Read::read_exact documentation
Fixes#72186.
For now I simply added a link to `Read::read` and held off changing the text in `Read::read_exact`. I can do it if it is deemed necessary.
@rustbot modify labels: C-enhancement, T-libs
This should hopefully handle #74484 but in any case fixes compilation of
the standard library without the `backtrace` feature. The need for this
feature is somewhat unclear now because the `backtrace` crate should
always compile (no more C code!) but we can handle that later if
necessary.
Teach bootstrap install and dist commands about TargetSelection
With this, we can now use a target JSON file to build a
cross-compiler:
```
x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin
```
r? @Mark-Simulacrum
With this, we can now use a target JSON file to build a
cross-compiler:
```
x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin
```
More intra-doc links, add explicit exception list to linkchecker
Fixes the broken links behind #32553
Progress on #32130 and #32129 except for a small number of links. Instead of whitelisting entire files, I've changed the code to whitelist specific links in specific files, and added a comment requesting people explain the reasons they add exceptions. I'm not sure if we should close those issues in favor of the already filed intra-doc link issues.
Add a thumbv4t-none-eabi target
(cc @ketsuban, one of the few other Rust users who programs for GBA.)
---
**EDIT:** This is now a more general `thumbv4t-none-eabi` PR! See [this comment](https://github.com/rust-lang/rust/pull/74419#issuecomment-660391579)
---
Now that the PSP officially has an official target within Rust, well as the lead of the `gba` crate I can't _not_ add a GBA target as well.
I know that the [target tier policy](https://github.com/rust-lang/rfcs/pull/2803) isn't ratified and official, but I'll use it as an outline (cc @joshtriplett):
* Designated Developer: Lokathor
* Naming consistent with any existing targets
* Doesn't create Rust project legal issues.
* No license issues
* Uses the standard Apache/mit license.
* Rust tooling users don't have to accept any new licensing requirements
* Does not support hosting rust tooling.
* Doesn't require linking in proprietary code to obtain a functional binary. However, you will need to do some post-build steps to turn the ELF file into a usable GBA ROM (either for an emulator or for the actual hardware).
* This is a `no_std` environment, without even a standard global allocator, so this adds no new code to `alloc` or `std`.
* The process of building for this target is documented in the `gba` crate ([link](https://rust-console.github.io/gba/development-setup.html)). Well, the docs there are currently a little out of date, they're back on using `cargo-xbuild`, but the crate docs there will get updated once this target is available.
* This places no new burden on any other targets
* Does not break any existing targets.
I'm not fully confident in specifying the same linker script for all possible projects, so I'm currently just not giving a linker script at all, and users can continue to select their own linker script by using `-C` to provide a linker arg.
I added the file, and added it to the `supported_targets!` macro usage, and I think that's all there is to do.
Deny unsafe operations in unsafe functions in libstd/alloc.rs
Partial fix of #73904.
This encloses `unsafe` operations in `unsafe fn` in `libstd/alloc.rs`.
@rustbot modify labels: F-unsafe-block-in-unsafe-fn
ci: Update dist-{i686,x86_64}-linux to Debian 6
This increases the minimum `{i686,x86_64}-unknown-linux-gnu` platform
from RHEL/CentOS 5 (glibc 2.5 and kernel 2.6.18) to a slightly newer
Debian 6 `squeeze` (glibc 2.11 and kernel 2.6.32). While that release is
already EOL, it happens to match the minimum common versions of two
enterprise distros that do still need Rust support -- RHEL 6 (glibc 2.12
and kernel 2.6.32) and SLES 11 SP4 (glibc 2.11 and kernel 3.0).
Closes#62516.
Generating the coverage map
@tmandry @wesleywiser
rustc now generates the coverage map and can support (limited)
coverage report generation, at the function level.
Example commands to generate a coverage report:
```shell
$ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
$ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
$HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
$ LLVM_PROFILE_FILE="main.profraw" ./main
called
$ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
$ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
```
![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png)
r? @wesleywiser
Rust compiler MCP rust-lang/compiler-team#278
Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
Make unreachable_unchecked a const fn
This PR makes `std::hint::unreachable_unchecked` a const fn so we can use it inside a const function.
r? @RalfJung
Fixes#53188.