Commit Graph

254774 Commits

Author SHA1 Message Date
Erick Tryzelaar
58ee9192e0 Migrate fuchsia docs from pm to ffx
The `pm` tool has been deprecated, so this migrates the fuchsia
documentation to the new `ffx` based tooling.
2024-05-13 20:14:31 +00:00
bors
030a12ce2b Auto merge of #125074 - bjorn3:sync_cg_clif-2024-05-13, r=bjorn3
Subtree sync for rustc_codegen_cranelift

A variety of bug fixes, added support for naked functions, a couple more vendor intrinsics implemented.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-05-13 15:30:18 +00:00
bjorn3
75f8bdbca4 Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into sync_cg_clif-2024-05-13 2024-05-13 13:26:33 +00:00
bors
421f7ca3a9 Auto merge of #125061 - RalfJung:interpret-error, r=cjgillot
interpret: move error macros into error.rs
2024-05-13 13:25:00 +00:00
bjorn3
3270432f4b Rustup to rustc 1.80.0-nightly (ef0027897 2024-05-12) 2024-05-13 13:22:02 +00:00
bors
abb95639ef Auto merge of #125024 - Oneirical:master, r=jieyouxu
Rewrite 3 very similar `run-make` alloc tests to rmake

Part of #121876

#121918 attempted to port these 3 tests 2 months ago. However, since then, the structure of `run-make-support` has changed a bit and new helper functions were added. Since there has been no activity on the PR, they are good low-hanging fruit to knock down, using the new functions of the current library.

There is also the removal of a useless import on a very similar test.
2024-05-13 11:20:00 +00:00
bors
6be7b0c7d2 Auto merge of #124999 - scottmcm:unify-aggregate, r=nnethercote
Unify `Rvalue::Aggregate` paths in cg_ssa

In #123840 and #123886 I added two different codepaths for `Rvalue::Aggregate` in `cg_ssa`.

This merges them into one, since raw pointers are also immediates that can be built from the immediates of their "fields".
2024-05-13 09:08:18 +00:00
bors
982c9c1e81 Auto merge of #125055 - nnethercote:Comment-FIXME, r=compiler-errors
Avoid clone in `Comments::next`

`Comments::next`, in `rustc_ast_pretty`, has this comment:
```
// FIXME: This shouldn't probably clone lmao
```
The obvious thing to try is to return `Option<&Comment>` instead of `Option<Comment>`. But that leads to multiple borrows all over the place, because `Comments` must be borrowed from `PrintState` and then processed by `&mut self` methods within `PrintState`.

This PR instead rearranges things so that comments are consumed as they are used, preserving the `Option<Comment>` return type without requiring any cloning.

r? `@compiler-errors`
2024-05-13 06:30:25 +00:00
Ralf Jung
b15d09a6dd interpret: move error macros into error.rs 2024-05-13 08:15:45 +02:00
Nicholas Nethercote
74e1b46ab2 Make Comments::next consume a comment.
This avoids the need for a clone, fixing a FIXME comment.
2024-05-13 10:15:30 +10:00
bors
ba956ef4b0 Auto merge of #124914 - nnethercote:rm-extern-crate-rustc_middle, r=saethlin
Remove `#[macro_use] extern crate rustc middle` from numerous crates

Because explicit importing of macros via `use` items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. This PR mops up some cases I didn't get to in #124511.

r? `@saethlin`
2024-05-13 00:13:34 +00:00
Nicholas Nethercote
5e7a80b2d2 Make handling of Comments more iterator-like.
The current way of stepping through each comment in `Comments` is a bit
weird. There is a `Vec<Comments>` and a `current` index, which is fine.
The `Comments::next` method clones the current comment but doesn't
advance `current`; the advancing instead happens in `print_comment`,
which is where each cloned comment is actually finally used (or not, in
some cases, if the comment fails to satisfy a predicate).

This commit makes things more iterator-like:
- `Comments::next` now advances `current` instead of `print_comment`.
- `Comments::peek` is added so you can inspect a comment and check a
  predicate without consuming it.
- This requires splitting `PrintState::comments` into immutable and
  mutable versions. The commit also moves the ref inside the `Option` of
  the return type, to save callers from having to use `as_ref`/`as_mut`.
- It also requires adding `PrintState::peek_comment` alongside the
  existing `PrintState::next_comment`. (The lifetimes in the signature
  of `peek_comment` ended up more complex than I expected.)

We now have a neat separation between consuming (`next`) and
non-consuming (`peek`) uses of each comment. As well as being clearer,
this will facilitate the next commit that avoids unnecessary cloning.
2024-05-13 10:11:29 +10:00
Nicholas Nethercote
c34ebba134 Remove extern crate rustc_middle from rustc_ty_utils. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
4bf20b2b55 Remove extern crate rustc_middle from rustc_trait_selection. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
573aa9f677 Remove extern crate rustc_middle from rustc_query_impl. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
d49d4ae192 Remove extern crate rustc_middle from rustc_mir_transform. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
900bcacf3a Remove extern crate rustc_middle from rustc_mir_build. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
00cfb45b54 Remove extern crate rustc_middle from rustc_metadata. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
34e247af1e Remove extern crate rustc_middle from rustc_infer. 2024-05-13 08:20:18 +10:00
Nicholas Nethercote
9b7d254d49 Remove extern crate rustc_middle from rustc_hir_typeck. 2024-05-13 08:16:51 +10:00
bors
ecbe3fd550 Auto merge of #125051 - dtolnay:printletelse, r=compiler-errors
Pretty-print let-else with added parenthesization when needed

Rustc used to produce invalid syntax for the following code, which is problematic because it means we cannot apply rustfmt to the output of `-Zunpretty=expanded`.

```rust
macro_rules! expr {
    ($e:expr) => { $e };
}

fn main() {
    let _ = expr!(loop {}) else { return; };
}
```

```console
$ rustc repro.rs -Zunpretty=expanded | rustfmt
error: `loop...else` loops are not supported
 --> <stdin>:9:29
  |
9 | fn main() { let _ = loop {} else { return; }; }
  |                     ----    ^^^^^^^^^^^^^^^^
  |                     |
  |                     `else` is attached to this loop
  |
  = note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run
```
2024-05-12 22:06:34 +00:00
Nicholas Nethercote
f59348ff09 Remove extern crate rustc_middle from rustc_hir_analysis. 2024-05-13 08:04:47 +10:00
Nicholas Nethercote
4497d345a8 Remove extern crate rustc_middle from rustc_const_eval.
This requires exporting the interpreter macros so they can be used with
`use crate::interpret::*`.
2024-05-13 08:02:14 +10:00
Nicholas Nethercote
f12e935795 Remove a stray backtick in an error explanation. 2024-05-13 07:53:38 +10:00
David Tolnay
94cc82c088
Pretty-print let-else with added parenthesization when needed 2024-05-12 13:42:37 -07:00
David Tolnay
68854b798e
Add AST pretty-printer tests for let-else 2024-05-12 13:37:00 -07:00
bors
ef0027897d Auto merge of #124639 - Jules-Bertholet:match-ergonomics-2024-migration-lint, r=Nadrieril
Match ergonomics 2024: migration lint

Depends on #124567

r? `@Nadrieril`

cc https://github.com/rust-lang/rust/issues/123076

`@rustbot` label A-edition-2024 A-patterns
2024-05-12 19:58:50 +00:00
bors
852a78ea8d Auto merge of #124902 - compiler-errors:mem-cat-but-better, r=lcnr
Fix MemCategorization and ExprUse visitors for new solver (this time it's better)

Best reviewed by each commit. Supersedes #124859.

r? lcnr
2024-05-12 17:48:33 +00:00
bjorn3
df88c11867 Use the target cpu from the target spec on x86_64 when -Ctarget-cpu isn't used
Fixes rust-lang/rustc_codegen_cranelift#1148
2024-05-12 18:57:24 +02:00
Michael Goulet
c697ec41f4 Propagate errors rather than using return_if_err 2024-05-12 12:50:18 -04:00
bjorn3
cba05a7a14 Support naked functions
Fixes rust-lang/rustc_codegen_cranelift#1203
2024-05-12 18:20:14 +02:00
bjorn3
0627c63ad9 Remove polymorphize calls for statics in a couple more places 2024-05-12 18:20:14 +02:00
Michael Goulet
fb298e80c3 Apply nits 2024-05-12 12:11:25 -04:00
Michael Goulet
5ab6dca6d3 Try structurally resolve 2024-05-12 12:11:25 -04:00
Michael Goulet
55cf09d761 Make LateCtxt be a type info delegate for EUV for clippy 2024-05-12 12:11:25 -04:00
Michael Goulet
e4209f19fd Introduce TypeInformationCtxt to abstract over LateCtxt/FnCtxt 2024-05-12 12:11:25 -04:00
Michael Goulet
72eccf2c6e Remove unncessary mut ref 2024-05-12 11:52:13 -04:00
Michael Goulet
d7595eb6df Inline MemCategorization into ExprUseVisitor 2024-05-12 11:52:13 -04:00
Michael Goulet
5808c5801d Assert that MemCategorizationVisitor actually errors when it bails ungracefully 2024-05-12 11:52:13 -04:00
bors
d25cf6fc14 Auto merge of #125040 - ickk:patch-1, r=notriddle
Fix hidden title in rustdoc book

raw html is treated as actual html by markdown, so this title needs to use some form of escaping in order to display correctly
2024-05-12 15:40:49 +00:00
Jules Bertholet
9d92a7f355
Match ergonomics 2024: migration lint
Unfortunately, we can't always offer a machine-applicable suggestion when there are subpatterns from macro expansion.

Co-Authored-By: Guillaume Boisseau <Nadrieril@users.noreply.github.com>
2024-05-12 11:13:33 -04:00
bors
dde8cfa597 Auto merge of #125045 - GuillaumeGomez:rollup-em6qdzw, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #125021 (Update reference safety requirements)
 - #125022 (Migrate rustdoc scrape examples ordering)
 - #125030 (Fix some minor issues from the ui-test auto-porting)
 - #125036 (solve: all "non-structural" logging to trace)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-12 13:33:39 +00:00
bjorn3
6db27529dd Significantly reduce check cfg warnings 2024-05-12 12:59:10 +00:00
bjorn3
cfc919f532 Use cargo in y.sh
This will allow adding dependencies to the build system in the future.
2024-05-12 12:59:10 +00:00
Guillaume Gomez
d3625fc8df
Rollup merge of #125036 - lcnr:new-solver-trace, r=compiler-errors
solve: all "non-structural" logging to trace

This enables us to start with `RUSTC_LOG=rustc_trait_selection::solve=debug` to figure out *where* something went wrong, to then separately use `trace` to get to the details.

r? ``@compiler-errors``
2024-05-12 13:41:58 +02:00
Guillaume Gomez
14271c2137
Rollup merge of #125030 - saethlin:ui-test-false-positives, r=compiler-errors
Fix some minor issues from the ui-test auto-porting

I'm not sure if these count as false positives, because well, starting a comment with `// incremental` was probably a valid compiletest directive.

But anyway, these tests directives became clearly goofy and now with the better syntax we can straighten things out.

r? jieyouxu
2024-05-12 13:41:58 +02:00
Guillaume Gomez
1393a87e4f
Rollup merge of #125022 - GuillaumeGomez:migrate-rustdoc-scrape-examples-ordering, r=jieyouxu
Migrate rustdoc scrape examples ordering

Part of https://github.com/rust-lang/rust/issues/121876.

This one adds a lot of utility methods/functions. To prevent having too much changes at once, I didn't make the existing rmake tests use these yet but I'll send a follow-up so they all use it.

r? `@jieyouxu`
2024-05-12 13:41:57 +02:00
Guillaume Gomez
5087947695
Rollup merge of #125021 - joshlf:patch-11, r=RalfJung
Update reference safety requirements

Per https://github.com/rust-lang/rust/pull/116677#issuecomment-1945495786, the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when #117945 is implemented, we can revert to the old language.

While we're here, we also require that references be non-null.

cc ``@RalfJung``
2024-05-12 13:41:57 +02:00
bors
b71fa82d78 Auto merge of #124798 - devnexen:illumos_memalign_fix, r=RalfJung
std::alloc: use posix_memalign instead of memalign on solarish

`memalign` on Solarish requires the alignment to be at least the size of a pointer, which we did not honor. `posix_memalign` also requires that, but that code path already takes care of this requirement.

close GH-124787
2024-05-12 11:22:40 +00:00
Guillaume Gomez
114e25761f Migrate rustdoc-scrape-examples-ordering to rmake 2024-05-12 11:30:52 +02:00