Pass host linker to compiletest.
Tests marked `// force-host` were using the default linker, even if a custom linker was configured in config.toml.
This change adds a new flag, --host-linker, to compiletest, and renames --linker to --target-linker.
Rename tests/ui/unique to tests/ui/box/unit
fixes https://github.com/rust-lang/rust/issues/109878
Since tests/ui/box already exists, I have temporarily named it boxed-box, but if another name sounds better, please let me know.
Initial support for loongarch64-unknown-linux-gnu
Hi, We hope to add a new port in rust for LoongArch.
LoongArch intro
LoongArch is a RISC style ISA which is independently designed by Loongson
Technology in China. It is divided into two versions, the 32-bit version (LA32)
and the 64-bit version (LA64). LA64 applications have application-level
backward binary compatibility with LA32 applications. LoongArch is composed of
a basic part (Loongson Base) and an expanded part. The expansion part includes
Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD
EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX).
Currently the LA464 processor core supports LoongArch ISA and the Loongson
3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit
high-performance processor core. It can be used as a single core for high-end
embedded and desktop applications, or as a basic processor core to form an
on-chip multi-core system for server and high-performance machine applications.
Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html
Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally.
I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
Update browser-ui-test version
This update add the support for expressions, so we can now do this:
```
assert: 1 > 2 && ["a"] != ["b", "c"]
```
It also improved commands naming and updated puppeteer version.
r? `@notriddle`
Migrate most of `rustc_builtin_macros` to diagnostic impls
cc #100717
This is a couple of days work, but I decided to stop for now before the PR becomes too big. There's around 50 unresolved failures when `rustc::untranslatable_diagnostic` is denied, which I'll finish addressing once this PR goes thtough
A couple of outputs have changed, but in all instances I think the changes are an improvement/are more consistent with other diagnostics (although I'm happy to revert any which seem worse)
Links to README.md files must actually be links to index.md files,
because of the inner workings of `mdbook`.
Also use the latest mdbook version in CI.
rustc_metadata: Filter encoded data more aggressively using `DefKind`
I focused on data that contains spans, because spans are expensive to encode/decode/hash, but also touched `should_encode_visibility` too.
One incorrect use of impl visibility in diagnostics is also replaced with trait visibility.
Rollup of 8 pull requests
Successful merges:
- #109527 (Set up standard library path substitution in rust-gdb and gdbgui)
- #109752 (Stall auto trait assembly in new solver for int/float vars)
- #109860 (Add support for RISC-V relax target feature)
- #109923 (Update `error [E0449]: unnecessary visibility qualifier` to be more clear)
- #110070 (The `wrapping_neg` example for unsigned types shouldn't use `i8`)
- #110146 (fix(doc): do not parse inline when output is json for external crate)
- #110147 (Add regression test for #104916)
- #110149 (Update books)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Update books
## rust-lang/book
1 commits in 0510ca84c2ce6bf93c4ccf9248756e9e4fd00b12..c06006157b14b3d47b5c716fc392b77f3b2e21ce
2023-04-03 15:31:55 UTC to 2023-04-03 15:31:55 UTC
- Fix grammar (rust-lang/book#3600)
## rust-lang/reference
3 commits in 3c47807a3131b3c7cacb508f52632078d253cd0a..1f8dc727e94ae4ef92adf70df979521a1ea1143e
2023-04-09 14:04:53 UTC to 2023-03-29 13:21:47 UTC
- Explain typos in `asm!` can be unsound (rust-lang/reference#1344)
- Fix coding style in example: add space between module name and bracket (rust-lang/reference#1347)
- redundant word removed (rust-lang/reference#1346)
## rust-lang/rust-by-example
1 commits in ba84bf35d0f17d404003349309201654d25f61af..31961fe22521a779070a44a8f30a2b00a20b6212
2023-04-10 13:06:34 UTC to 2023-04-10 13:06:34 UTC
- Add clarity to name of file being used in library example. (rust-lang/rust-by-example#1697)
## rust-lang/rustc-dev-guide
8 commits in fca8af6c154c6cde2512f1331cf2704f214a818e..6337ed17fb8dcd918d78b7d97d213e923530337c
2023-04-10 14:23:05 UTC to 2023-04-06 00:29:18 UTC
- fix markup (rust-lang/rustc-dev-guide#1670)
- Reorganize "Getting Started" and add a "What should I work on?" section (rust-lang/rustc-dev-guide#1665)
- Clarify cfg(bootstrap) docs (rust-lang/rustc-dev-guide#1669)
- Link to forge instead of duplicating toolstate info (rust-lang/rustc-dev-guide#1664)
- Improve the landing page for contributing to the libstd docs (rust-lang/rustc-dev-guide#1666)
- Various improvements to `check_line_lengths.sh` (rust-lang/rustc-dev-guide#1667)
- Document how to ignore specific files in a diff (rust-lang/rustc-dev-guide#1668)
- mention `git clone --depth 1` (rust-lang/rustc-dev-guide#1663)
Add regression test for #104916Closes#104916
I haven't tested if it still passes with debug assertions enabled so it'd be better to wait for CI to be green.
r? compiler-errors
Update `error [E0449]: unnecessary visibility qualifier` to be more clear
This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore.
Resolves#109822.
Add support for RISC-V relax target feature
This adds `relax` as an allowed RISC-V target feature. The relax feature in LLVM enables [linker relaxation](https://www.sifive.com/blog/all-aboard-part-3-linker-relaxation-in-riscv-toolchain), an optimization specific to RISC-V that allows global variable accesses to be resolved by the linker by using the global pointer (`gp`) register (rather than constructing the addresses from scratch for each access). Enabling `relax` will cause LLVM to emit relocations in the object file that support this. The feature can be enabled in rustc with `-C target-feature=+relax`.
Currently this feature is disabled by default, but maybe it should be enabled by default since it is an easy performance improvement (but requires the `gp` register to be set up properly). GCC/Clang enable this feature by default (for both hosted/bare-metal targets), and include the `-mno-relax` flag to disable it (see [here](466d554dca/clang/lib/Driver/ToolChains/Arch/RISCV.cpp (L145)) for the code that enables it in Clang). I think it would make sense to enable by default, at least for all hosted targets since the `gp` register should be automatically set up by the runtime. For bare-metal targets, `gp` must be set up manually, so it is probably best to leave off by default to avoid breaking existing applications that do not set up `gp`. Leaving it disabled by default for all targets is also reasonable though.
Let me know your thoughts. Thanks!
Fixes#109426.
Set up standard library path substitution in rust-gdb and gdbgui
Fixes#62945
---
Only lightly tested (in release mode, where the paths are a bit of a mess) because my `gdb` appears to crash with `internal-error: inside_main_func: Assertion 'block != nullptr' failed.` and I don't have `gdbgui`. Please review carefully my shell syntax.
There's also `rust-lldb`, but I don't know the equivalent for it.
rustc_middle: Document which exactly `DefId`s don't have `DefKind`s
I don't currently have time to investigate when and how to create these missing HIR nodes, but if someone else could do that it would be great.
Clear with drain
Fixes#10572: both the original intent of the issue (extending `clear_with_drain`) and the false negative for `collection_is_never_read` I found in the process are fixed by this PR.
changelog: [`clear_with_drain`]: extend to 5 other types of containers. [`collection_is_never_read`]: fix false negative for `String`s.
Add suggestion to remove `derive()` if invoked macro is non-derive
Adds to the existing `expected derive macro, found {}` error message:
```
help: remove the surrounding "derive()":
--> $DIR/macro-path-prelude-fail-4.rs:1:3
|
LL | #[derive(inline)]
| ^^^^^^^ ^
```
This suggestion will either fix the issue, in the case that the macro was valid, or provide a better error message if not
Not ready for merge yet, as the highlighted span is only valid for trivial formatting. Is there a nice way to get the parent span of the macro path within `smart_resolve_macro_path`?
Closes#109589
Improve the floating point parser in dec2flt.
Greetings everyone,
I've benn studying the rust floating point parser recently and made the following tweaks:
* Remove all remaining traces of `unsafe`. The parser is now 100% safe Rust.
* The trick in which eight digits are processed in parallel is now in a loop.
* Parsing of inf/NaN values has been reworked.
On my system, the changes result in performance improvements for some input values.
remove unusued `#![feature(drain_filter)]`
The unstable feature does not appear to be used and its presence blocks work in https://github.com/rust-lang/rust/pull/104455
changelog: none