Commit Graph

222009 Commits

Author SHA1 Message Date
Matthias Krüger 827b74c709
Rollup merge of #110176 - nnethercote:renumber-cleanups, r=lqd
Renumbering cleanups

r? ``@lqd``
2023-04-12 17:04:31 +02:00
Matthias Krüger fd40f519c5
Rollup merge of #109959 - JakobDegen:transmute-validate, r=compiler-errors
Fix transmute intrinsic mir validation ICE

I stumbled across this at work, the minimal reproducer is included as a test which ICEs before this change.

I'm not 100% sure this is the right fix, but it matches what we do in `mir_assign_valid_types` so seems reasonable at least.

fixes #110151

r? `@lcnr` since they've been keeping the relevant logic correct, cc `@scottmcm`
2023-04-12 17:04:30 +02:00
Lena Milizé 04f20d4ac8 compiler: print the suggestion only for local macros
And wrap the link in the diagnostic in angle brackets.

Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-12 15:43:50 +02:00
Gary Guo 5c9b371a2f Bless tests 2023-04-12 14:05:05 +01:00
Gary Guo 229b0a0fdc Make rust-intrinsic ABI unwindable
Stick `#[rustc_nounwind]` to all except `const_eval_select` to undo the
change for all other intrinsics.
2023-04-12 14:05:05 +01:00
Vadim Petrochenkov 7c40a6fb34 resolve: Pre-compute non-reexport module children
Instead of repeating the same logic by walking HIR during metadata encoding.

The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list.
They can be encoded separately if this need ever arises.

`module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-12 15:22:03 +03:00
bors 661b33f524 Auto merge of #109935 - michaelwoerister:fix-feed-in-eval-always, r=cjgillot
incr.comp.: Make sure dependencies are recorded when feeding queries during eval-always queries.

This PR makes sure we don't drop dependency edges when feeding queries during an eval-always query.

Background: During eval-always queries, no dependencies are recorded because the system knows to unconditionally re-evaluate them regardless of any actual dependencies. This works fine for these queries themselves but leads to a problem when feeding other queries: When queries are fed, we set up their dependency edges by copying the current set of dependencies of the feeding query. But because this set is empty for eval-always queries, we record no edges at all -- which has the effect that the fed query instances always look "green" to the system, although they should always be "red".

The fix is to explicitly add a dependency on the artificial "always red" dep-node when feeding during eval-always queries.

Fixes https://github.com/rust-lang/rust/issues/108481
Maybe also fixes issue https://github.com/rust-lang/rust/issues/88488.

cc `@jyn514`

r? `@cjgillot` or `@oli-obk`
2023-04-12 11:16:35 +00:00
Jynn Nelson 67b391968d Replace rustdoc-ui/{c,z}-help tests with a run-make test
This make rustdoc resilient to changes in the debugging options while
still testing that it matches rustc.
2023-04-12 05:34:21 -05:00
Jynn Nelson bad2af1d38 Make rustdoc and rustc's help match exactly
Before, rustdoc was missing `-C passes=list` and the "Available options"
header.

Making these match allows testing that they match exactly.
2023-04-12 05:27:26 -05:00
Lena Milizé 4b456cb683 compiler: improve captured metavariables diagnostic
Adds a link to the relevant part of The Rust Reference in the eror
message, and suggests a possible fix (replacing the fragment specifier
with :tt in the macro definition).

Fixes typos in the original message.

Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-12 11:32:25 +02:00
lcnr cc82ccb145 `#[must_use]` for fns returning a list of errors 2023-04-12 10:55:14 +02:00
bors 9be9b5e09a Auto merge of #107614 - compiler-errors:allow-elaborator-to-filter-only-super-traits, r=oli-obk
Split implied and super predicate queries, then allow elaborator to filter only supertraits

Split the `super_predicates_of` query into a new `implied_predicates_of` query. The former now only returns the *real* supertraits of a trait alias, and the latter now returns the implied predicates (which include all of the `where` clauses of the trait alias). The behavior of these queries is identical for regular traits.

Now that the two queries are split, we can add a new filter method to the elaborator, `filter_only_self()`, which can be used in instances that we need only the *supertrait* predicates, such as during the elaboration used in closure signature deduction. This toggles the usage of `super_predicates_of` instead of `implied_predicates_of` during elaboration of a trait predicate.

This supersedes #104745, and fixes the four independent bugs identified in that PR.
Fixes #104719
Fixes #106238
Fixes #110023
Fixes #109514

r? types
2023-04-12 08:39:19 +00:00
lcnr a19adefa0e region error cleanup
- require `TypeErrCtxt` to always result in an error
- move `resolve_regions_and_report_errors` to the `ObligationCtxt`
- merge `process_registered_region_obligations` into `resolve_regions`
2023-04-12 10:24:36 +02:00
WANG Rui f45417bd1c doc: loongarch: Fix typos 2023-04-12 15:16:25 +08:00
bors 0d7ed3ba84 Auto merge of #110214 - compiler-errors:rollup-mkig4t6, r=compiler-errors
Rollup of 10 pull requests

Successful merges:

 - #96971 (Initial support for loongarch64-unknown-linux-gnu)
 - #109894 (Remove Errors section from var_os docs)
 - #110000 (Rename tests/ui/unique to tests/ui/box/unit)
 - #110018 (Pass host linker to compiletest.)
 - #110104 ( Reword the docstring in todo! macro definition, fixing a typo)
 - #110113 (Fix `x test ui --target foo` when download-rustc is enabled)
 - #110126 (Support safe transmute in new solver)
 - #110155 (Fix typos in librustdoc, tools and config files)
 - #110162 (rustdoc: remove redundant expandSection code from main.js)
 - #110173 (kmc-solid: Implement `Socket::read_buf`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-12 04:50:01 +00:00
Michael Goulet 4c9cd9e739
Rollup merge of #110173 - solid-rs:patch/kmc-solid/socket-read-buf, r=cuviper
kmc-solid: Implement `Socket::read_buf`

Follow-up to #108326. Implements `Socket::read_buf` for the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.
2023-04-11 20:28:50 -07:00
Michael Goulet d22b019dbf
Rollup merge of #110162 - notriddle:notriddle/main-js-expand, r=GuillaumeGomez
rustdoc: remove redundant expandSection code from main.js

This functionality is already tested in `hash-item-expansion.goml`, and was implemented twice:

* First, in code that ran at load time and at hash change: 917cdd295d

* Later, the hash change event handler was itself run at load time, and the code handling both cases diverged in implementation, though their behavior still matches pretty well: f66a331335
2023-04-11 20:28:49 -07:00
Michael Goulet e6975455d9
Rollup merge of #110155 - DaniPopes:rest-typos, r=jyn514
Fix typos in librustdoc, tools and config files

I used [`typos`](https://github.com/crate-ci/typos) to fix all typos, minus the ones present in #110153 and in #110154.

Refs #110150
2023-04-11 20:28:49 -07:00
Michael Goulet 87c9b3f35e
Rollup merge of #110126 - compiler-errors:new-solver-safe-transmute, r=oli-obk
Support safe transmute in new solver

Basically copies the same implementation as the old solver, but instead of looking for param types, we look for type or const placeholders.
2023-04-11 20:28:48 -07:00
Michael Goulet 2f5440c38a
Rollup merge of #110113 - jyn514:download-rustc-cross, r=albertlarsan68
Fix `x test ui --target foo` when download-rustc is enabled

Previously, we would never build the target std, only the host std:

```
; x t tests/ui/attributes --target wasm32-unknown-unknown
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.02s
Building stage0 library artifacts (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.08s
Building tool compiletest (stage0)
    Finished release [optimized] target(s) in 0.09s
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> wasm32-unknown-unknown)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { depth: 0, inner: Io { path: Some("/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib"), err: Os { code: 2, kind: NotFound, message: "No such file or directory" } } }', src/tools/compiletest/src/main.rs:842:31
```

Helps with https://github.com/rust-lang/rust/issues/81930.
2023-04-11 20:28:48 -07:00
Michael Goulet 4f2f7fda10
Rollup merge of #110104 - kormosi:todo_typo, r=cuviper
Reword the docstring in todo! macro definition, fixing a typo
2023-04-11 20:28:47 -07:00
Michael Goulet e6e46bae6f
Rollup merge of #110018 - jfgoog:host-and-target-linker, r=wesleywiser
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.
2023-04-11 20:28:47 -07:00
Michael Goulet 90b55973dd
Rollup merge of #110000 - reez12g:issue-109878, r=jackh726
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.
2023-04-11 20:28:46 -07:00
Michael Goulet 8a7a66572e
Rollup merge of #109894 - fleetingbytes:109893-var_os-never-returns-an-error, r=cuviper
Remove Errors section from var_os docs

Remove `Errors` section from `var_os` documentation, fixes #109893
2023-04-11 20:28:46 -07:00
Michael Goulet 4a24aab220
Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser
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
2023-04-11 20:28:45 -07:00
bors 13d1802b88 Auto merge of #109895 - nikic:llvm-16-tests, r=cuviper
Add codegen tests for issues fixed by LLVM 16

Fixes #75978.
Fixes #99960.
Fixes #101048.
Fixes #101082.
Fixes #101814.
Fixes #103132.
Fixes #103327.
2023-04-12 02:30:21 +00:00
Ezra Shaw a159dcda62
fix: disable `x suggest` when using `build-metrics` 2023-04-12 14:01:59 +12:00
bors e7271f4b92 Auto merge of #110194 - GuillaumeGomez:update-browser-ui-test, r=notriddle
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`
2023-04-11 23:47:18 +00:00
Nicholas Nethercote 76d0c6f518 Inline and remove `msg_span_from_early_bound_and_free_regions`.
For similar reasons to the previous commit.
2023-04-12 08:02:38 +10:00
Nicholas Nethercote 877777f5bc Inline and remove `DescriptionCtx::from_early_bound_and_free_regions`.
It has a single call site, and the code is clearer with all region kinds
handled in one function, instead of splitting the handling across two
functions.

The commit also changes `DescriptionCtx::new` to use a more declarative
style, instead of creating a default `DescriptionCtx` and modifying it,
which I find easier to read.
2023-04-12 08:02:38 +10:00
Nicholas Nethercote c9b0635679 Inline and remove `DescriptionCtx::add_to`.
It has a single callsite.
2023-04-12 08:02:32 +10:00
Nicholas Nethercote 74463214a6 Rename `NllVisitor` as `RegionRenumberer`.
It's a more descriptive name.
2023-04-12 07:44:37 +10:00
bors 9df3a39fb3 Auto merge of #110198 - weihanglo:update-cargo, r=weihanglo
Update cargo

17 commits in 0e474cfd7b16b018cf46e95da3f6a5b2f1f6a9e7..7bf43f028ba5eb1f4d70d271c2546c38512c9875
2023-03-31 23:15:58 +0000 to 2023-04-10 16:01:41 +0000

- docs(pkgid): Consistently use @ (rust-lang/cargo#11956)
- Fix credential token format validation. (rust-lang/cargo#11951)
- Validate token on publish. (rust-lang/cargo#11952)
- Clarify docs on `-C` that it appears before the command. (rust-lang/cargo#11947)
- Add `try_canonicalize` and use it over `std::fs::canonicalize` (rust-lang/cargo#11866)
- Fix typo (rust-lang/cargo#11944)
- docs(changelog): Change wording about auto-fix message (rust-lang/cargo#11943)
- Update home repo URL (rust-lang/cargo#11941)
- doc(changelog): `[env]` is a table, not a stable (rust-lang/cargo#11942)
- Stop using UncanonicalizedIter for QueryKind::Exact (rust-lang/cargo#11937)
- Don't query permutations of the path prefix. (rust-lang/cargo#11936)
- Fix typo in variable name (rust-lang/cargo#11931)
- Fix Cargo warning about unused sparse configuration key (rust-lang/cargo#11930)
- Switch benchsuite to the index archive. (rust-lang/cargo#11933)
- Update git2 (rust-lang/cargo#11928)
- Publish docs: Clarify requirements about the state of the index after publish. (rust-lang/cargo#11926)
- Call out the differences between the index JSON and the API or metadata. (rust-lang/cargo#11927)
2023-04-11 21:32:48 +00:00
Yuki Okushi 06ec5faccb
Add regression test for #59003
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-12 06:24:49 +09:00
Weihang Lo f7c04edadc
Update cargo 2023-04-11 19:33:57 +01:00
Michael Goulet 7ec72efe10 Allow the elaborator to only filter to real supertraits 2023-04-11 17:45:42 +00:00
Michael Goulet 4560b61cd1 Broken tests 2023-04-11 17:45:42 +00:00
Michael Goulet 25c342f30a Split implied and super predicate queries 2023-04-11 17:45:42 +00:00
Michael Goulet 3dab259cb9 Split super_predicates_that_define_assoc_type query from super_predicates_of 2023-04-11 17:40:54 +00:00
Michael Goulet 5eb0528483 Erase lifetimes above ty::INNERMOST when probing ambiguous types 2023-04-11 17:17:32 +00:00
Guillaume Gomez 010fa00b80 Update rustdoc GUI tests to new browser-ui-test version 2023-04-11 19:14:35 +02:00
Guillaume Gomez 8aba3f3264 Update browser-ui-test version to 0.15.0 2023-04-11 19:14:35 +02:00
Michael Goulet 1178c49a1b Check for body owner fallibly 2023-04-11 16:52:40 +00:00
bors 87a2408b06 Auto merge of #110003 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2023-04-11 16:51:23 +00:00
Nikita Popov 83f525cc28 Make test compatible with 32-bit 2023-04-11 17:19:07 +02:00
bors 45749b21b7 Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errors
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)
2023-04-11 14:40:54 +00:00
Patrik Kormosi 4e84d695f3 Reword the docstring in todo! macro definition 2023-04-11 16:29:48 +02:00
Andy Wang cecb901e68
Add Offset binary op to custom mir 2023-04-11 16:23:35 +02:00
Philipp Krones c355e6b9a8
Update Cargo.lock 2023-04-11 15:34:15 +02:00
Philipp Krones 0ca8ae5edd
Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyup 2023-04-11 15:31:08 +02:00