Commit Graph

221595 Commits

Author SHA1 Message Date
Guillaume Gomez
8aba3f3264 Update browser-ui-test version to 0.15.0 2023-04-11 19:14:35 +02:00
bors
dfe024e104 Auto merge of #109765 - petrochenkov:encodeless, r=cjgillot
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.
2023-04-11 10:32:41 +00:00
bors
8e1162f07e Auto merge of #110168 - saethlin:miri, r=RalfJung
update Miri

Most importantly, this should ensure that the Miri test suite passes in this repo, when the issue is fixed.

r? `@oli-obk`
2023-04-11 08:11:46 +00:00
bors
5072826793 Auto merge of #110170 - JohnTitor:rollup-hdramer, r=JohnTitor
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
2023-04-11 05:50:41 +00:00
Yuki Okushi
48e14bbb5a
Rollup merge of #110149 - rustbot:docs-update, r=ehuss
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)
2023-04-11 12:18:52 +09:00
Yuki Okushi
016ebf868b
Rollup merge of #110147 - JohnTitor:issue-104916, r=compiler-errors
Add regression test for #104916

Closes #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
2023-04-11 12:18:52 +09:00
Yuki Okushi
a996418e3d
Rollup merge of #110146 - bvanjoi:relative-110138, r=notriddle
fix(doc): do not parse inline when output is json for external crate

relative #110138
2023-04-11 12:18:51 +09:00
Yuki Okushi
75a46252ba
Rollup merge of #110070 - scottmcm:wrapping-neg, r=cuviper
The `wrapping_neg` example for unsigned types shouldn't use `i8`

Probably it should have at least one example with an unsigned type.
2023-04-11 12:18:51 +09:00
Yuki Okushi
788de4701e
Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiser
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.
2023-04-11 12:18:50 +09:00
Yuki Okushi
5af6385f9f
Rollup merge of #109860 - zyedidia:riscv-relax, r=petrochenkov
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.
2023-04-11 12:18:50 +09:00
Yuki Okushi
a69cc45d82
Rollup merge of #109752 - compiler-errors:new-solver-stall-auto-trait-for-num-var, r=lcnr
Stall auto trait assembly in new solver for int/float vars

Make sure that we don't match int/float vars against *all* manual auto trait impls due to this check:

2fb0e8d162/compiler/rustc_trait_selection/src/solve/trait_goals.rs (L151-L169)

Since `find_map_relevant_impl` treats all impls as candidates for int/float vars, due to the way that `fast_reject::simplify_type` works.

This fixes compiler-errors/next-solver-hir-issues#11.

r? ``@lcnr``
2023-04-11 12:18:49 +09:00
Yuki Okushi
c617ddf4f3
Rollup merge of #109527 - lnicola:rust-gdb-substitute-path, r=cuviper
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.
2023-04-11 12:18:49 +09:00
bors
b80ee3969f Auto merge of #109850 - MU001999:master, r=estebank
Emits non-overlapping suggestions for arguments with wrong types

Fixes #109831
2023-04-11 03:07:58 +00:00
bors
5ca6e98f13 Auto merge of #109778 - petrochenkov:allkind, r=cjgillot
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.
2023-04-11 00:39:27 +00:00
bors
194a0bb5d6 Auto merge of #109638 - NotStirred:suggest/non-derive, r=davidtwco
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
2023-04-10 21:50:46 +00:00
bors
88fb1b922b Auto merge of #108698 - IntQuant:issue-100717-infer-6, r=davidtwco
Migrating rustc_infer to session diagnostics (part 5)

`@rustbot` label +A-translation
cc https://github.com/rust-lang/rust/issues/100717
2023-04-10 19:38:48 +00:00
rustbot
687abb0c35 Update books 2023-04-10 13:00:46 -04:00
Michael Goulet
8d2dbba63e Stall auto-trait assembly for int/float vars in new solver 2023-04-10 15:54:14 +00:00
IQuant
d07b1cd4a8 Call into_diagnostic_arg on Binder's contained value directly. 2023-04-10 18:08:35 +03:00
bohan
c127020b0f fix(doc): do not parse inline when output is json for external crate 2023-04-10 23:02:08 +08:00
Yuki Okushi
271ac7b528
Add regression test for #104916
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-11 00:01:53 +09:00
bors
a73288371e Auto merge of #107007 - TDecking:float_parsing_improvments, r=Mark-Simulacrum
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.
2023-04-10 14:09:09 +00:00
Vadim Petrochenkov
f5a9f6fb7e rustc_metadata: Filter encoded data more aggressively using DefKind 2023-04-10 16:24:36 +03:00
Vadim Petrochenkov
9dd27b31ba rustc_metadata: Cleanup fn encode_info_for_item 2023-04-10 15:47:15 +03:00
Ben Kimock
d50fee9fb2 rustup 2023-04-10 07:57:55 -04:00
Ben Kimock
73702d5e39 Turn off the alignment check pass, remove the panic test for it
The panic test is now counted as an error test; we encounter a Terminate
terminator, and emit an interpreter error, as opposed to just
terminating due to a panic. So this test should have broken with
https://github.com/rust-lang/rust/pull/102906 but wasn't because the Miri
test suite is currently broken in rust-lang/rust:
 https://github.com/rust-lang/rust/issues/110102
2023-04-10 07:56:31 -04:00
Ben Kimock
6efdf4d130 Merge from rustc 2023-04-10 07:55:57 -04:00
Ben Kimock
0bb6d66251 Preparing for merge from rustc 2023-04-10 07:55:53 -04:00
bors
2a198c7f62 Auto merge of #110078 - fee1-dead-contrib:bump-serde, r=Mark-Simulacrum
Bump serde to use syn 2.0

cc #109302
2023-04-10 11:53:26 +00:00
bors
d4be8efc62 Auto merge of #110137 - Dylan-DPC:rollup-fdruvwp, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #109724 (prioritize param env candidates if they don't guide type inference)
 - #110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
 - #110044 (Avoid some manual slice length calculation)
 - #110115 (compiletest: Use remap-path-prefix only in CI)
 - #110121 (Fix `x check --stage 1` when download-rustc is enabled)
 - #110124 (Some clippy fixes in the compiler)

Failed merges:

 - #109752 (Stall auto trait assembly in new solver for int/float vars)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-10 09:07:02 +00:00
Dylan DPC
97921abc06
Rollup merge of #110124 - Nilstrieb:📎-told-me-so, r=compiler-errors
Some clippy fixes in the compiler

Best reviewed commit-by-commit 📎.
2023-04-10 14:13:16 +05:30
Dylan DPC
6f2fd3e6a2
Rollup merge of #110121 - jyn514:check-stage1, r=ozkanonur
Fix `x check --stage 1` when download-rustc is enabled

Helps with https://github.com/rust-lang/rust/issues/81930
2023-04-10 14:13:15 +05:30
Dylan DPC
e327487bd8
Rollup merge of #110115 - jyn514:remap-path-prefix-ci, r=compiler-errors
compiletest: Use remap-path-prefix only in CI

This makes jump-to-definition work in most IDEs, as well as being easier to understand for contributors.

Fixes https://github.com/rust-lang/rust/issues/109725. cc `@TimNN`
2023-04-10 14:13:15 +05:30
Dylan DPC
b6633ffaf7
Rollup merge of #110044 - scottmcm:more-size-of-val, r=ChrisDenton
Avoid some manual slice length calculation

No need for us to write the multiplication when `size_of_val` does exactly what we need.

(https://github.com/rust-lang/rust-clippy/pull/10601)
2023-04-10 14:13:14 +05:30
Dylan DPC
b8725520af
Rollup merge of #110021 - scottmcm:fix-110005, r=compiler-errors
Fix a couple ICEs in the new `CastKind::Transmute` code

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes #110005
Fixes #109992
Fixes #110032
cc `@matthiaskrgr`
2023-04-10 14:13:14 +05:30
Dylan DPC
c30d7e97a8
Rollup merge of #109724 - lcnr:prioritize-env, r=compiler-errors
prioritize param env candidates if they don't guide type inference

intended to supersede #109579. We disable the prioritization during coherence to maintain completeness.

Long term we can hopefully replace this hack with adding OR to external constraints at which point the only relevant part when merging responses is whether they guide type inference in the same way.

Reuses `try_merge_responses` for assembly and the cleanest way to impl that was to actually split that so that `try_merge_responses` returns `None` if we fail to merge them and then add `flounder` which is used afterwards which is allowed to lower the certainty of our responses.

If, in the future, we add the ability to merge candidates `YES: ?0 = Vec<u32>` and `YES: ?0 = Vec<i32>` to `AMBIG: ?0 = Vec<?1>`, this should happen in `flounder`.

r? `@compiler-errors` `@BoxyUwU`
2023-04-10 14:13:13 +05:30
lcnr
3fab7f7c13 review + some small stuff 2023-04-10 09:21:21 +02:00
lcnr
2186847f28 move structural_traits into assembly 2023-04-10 09:18:47 +02:00
lcnr
2b0f5721c1 prioritize param-env candidates 2023-04-10 09:16:33 +02:00
bors
7f7e8fbc99 Auto merge of #110008 - klensy:deps-up-apr-06, r=Mark-Simulacrum
bump few deps

Update few deps to fix security vulns, future incompatibilities, duplicates.

`jemalloc-sys` v0.5.0+5.3.0 -> v0.5.3+5.3.0-patched: fixes future-incompatibilities by dropping fs_extra (https://github.com/rust-lang-ci/rust/actions/runs/4626595610/jobs/8183514150#step:26:19499, https://github.com/tikv/jemallocator/blob/tikv-jemalloc-sys-0.5.3/CHANGELOG.md)

`openssl-src` v111.22.0+1.1.1q -> v111.25.0+1.1.1t: fixes few vulns:
https://www.openssl.org/news/vulnerabilities-1.1.1.html
https://www.cve.org/CVERecord?id=CVE-2022-4304
https://www.cve.org/CVERecord?id=CVE-2022-4450
https://www.cve.org/CVERecord?id=CVE-2023-0215
https://www.cve.org/CVERecord?id=CVE-2023-0286
There exist newer openssl version 1.1.1u with low severity vulns, but no crate update yet

`openssl` crate with deps 0.10.38 ->0.10.49 fixes vulns (https://github.com/sfackler/rust-openssl/blob/openssl-v0.10.49/openssl/CHANGELOG.md)
https://rustsec.org/advisories/RUSTSEC-2023-0022
https://rustsec.org/advisories/RUSTSEC-2023-0023
https://rustsec.org/advisories/RUSTSEC-2023-0024

update `env_logger` for `rustbook` and `cargo_metadata` for `tidy` to newer versions (still used by `rustfmt`, `miri`)
2023-04-10 06:53:15 +00:00
bors
749b487be4 Auto merge of #109880 - ehuss:fix-macos-installer-rust-docs, r=Mark-Simulacrum
Fix macOS and Windows installers when rust-docs is not available.

This fixes the macOS `.pkg` and Windows `.msi` installers to work when rust-docs is not available. If the rust-docs component is not built, then the installer would fail. This adds the rust-docs component to the filtering mechanism so that the rust-docs line of the distribution definition aren't included.

I tested installing and uninstalling both with and without the rust-docs component available.

This happens on the aarch64-apple-darwin distribution provided by rust-lang since we currently disable the rust-docs component due to long build times. An alternate solution would be to just enable the rust-docs component on aarch64-apple-darwin since there are faster build systems.

Fixes #109877
2023-04-10 04:36:38 +00:00
bors
3c2e2dd5c5 Auto merge of #110127 - matthiaskrgr:rollup-6ui12x5, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #108843 (Instantiate instead of erasing binder when probing param methods)
 - #109985 (Add little `is_test_crate` function)
 - #110028 (Migrate `rustc_hir_analysis` to session diagnostic [Part 3])
 - #110095 (Migrate remainder of rustc_ty_utils to `SessionDiagnostic`)
 - #110108 (Add renaming of ignore-git to changelog)
 - #110114 (compiletest: Give a better error message if `node` isn't installed)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-10 01:57:51 +00:00
Tobias Decking
0f96c71792 Improve the floating point parser in dec2flt.
* Remove all remaining traces of unsafe.
* Put `parse_8digits` inside a loop.
* Rework parsing of inf/NaN values.
2023-04-10 00:47:08 +02:00
Matthias Krüger
dd5942d77c
Rollup merge of #110114 - jyn514:wasm-errors, r=compiler-errors
compiletest: Give a better error message if `node` isn't installed
2023-04-09 23:40:06 +02:00
Matthias Krüger
7822064550
Rollup merge of #110108 - duckymirror:rename-ignore-git-changelog, r=ozkanonur
Add renaming of ignore-git to changelog

`bootstrap`'s `ignore-git` option has been renamed to `omit-git-hash` in #110059. This PR adds this change to the `CHANGELOG.md`. See also https://github.com/rust-lang/rust/issues/110020#issuecomment-1499599252.
2023-04-09 23:40:05 +02:00
Matthias Krüger
f4827459f8
Rollup merge of #110095 - matthewjasper:ty-utils-diagnostics, r=compiler-errors
Migrate remainder of rustc_ty_utils to `SessionDiagnostic`

This moves the remaining errors in `rust_ty_utils` to `SessionsDiagnostic`.

r? ``@davidtwco``
2023-04-09 23:40:05 +02:00
Matthias Krüger
164d70dc7a
Rollup merge of #110028 - obeis:hir-analysis-migrate-diagnostics-3, r=compiler-errors
Migrate `rustc_hir_analysis` to session diagnostic [Part 3]

Part 3: Finishing `collect.rs` file

r? ``@compiler-errors``
2023-04-09 23:40:04 +02:00
Matthias Krüger
3dfda2c72f
Rollup merge of #109985 - blyxyas:is_test_crate, r=compiler-errors
Add little `is_test_crate` function

Ok, this is quite a story.
I'm mainly a Clippy contributor, so I was fixing [this Clippy issue](https://github.com/rust-lang/rust-clippy/pull/10584) about a lint having to ignore test modules but that wasn't ignoring test files (integration test, `test/` dirs and such).

As test **files** don't tend to have an inner `#[cfg(test)]` module inside them, I tried everything, looking for filenames, looking for item's parents in the HIR Map, doing black magic...

I even asked [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.E2.9C.94.20Checking.20if.20file.20is.20integration.20test), and jyn answered something about `--cfg test`. Aha! That's something that I might be looking for, so I started looking at `rustc_driver_impl` flag parsing and configuration and all that.

Then, I stumbled on [this function right here](2e486be8d2/compiler/rustc_driver_impl/src/lib.rs (L174-L181)), and noticed the argument `config: Config`. That's a hint.

So [Config](https://doc.rust-lang.org/beta/nightly-rustc/rustc_interface/interface/struct.Config.html) has the field `opts: Options`, and [`Options`](https://doc.rust-lang.org/beta/nightly-rustc/rustc_session/options/struct.Options.html) has the field `test`.

This journey has been ~7 or 8 hours in 3 days, it's a very hard thing to find, so this PR adds a mini-function to check if the current crate is a testing one. So that no one has to travel through the same as me, and can just search for `is_test_crate` in the documentation.
2023-04-09 23:40:04 +02:00
Matthias Krüger
4e165c1c99
Rollup merge of #108843 - compiler-errors:non_lifetime_binders-method-probe, r=jackh726
Instantiate instead of erasing binder when probing param methods

Fixes #108836

There is a really old comment saying that a `WhereClauseCandidate` probe candidate "should not contain any inference variables", but I'm not really confident that that comment applies anymore. In contrast, other candidates that we assemble during method probe contain inference variables in their substitutions (e.g. `InherentImplCandidate`)...

Since this change is made only to support a nightly feature, I'm happy to gate the new behavior behind this feature flag or discuss it further.

r? types
2023-04-09 23:40:03 +02:00
Nilstrieb
9fc1555f74 Remove turbofish 2023-04-09 23:32:04 +02:00