| Age | Commit message (Collapse) | Author | Lines |
|
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
|
|
- use feature_err to report unstable expr_2021
- Update downlevel expr_2021 diagnostics
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
|
|
Co-authored-by: Eric Holk <eric@theincredibleholk.org>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
|
|
|
|
Co-authored-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
|
|
This commit adds a new nonterminal `expr_2021` in macro patterns, and
`expr_fragment_specifier_2024` feature flag. For now, `expr` and
`expr_2021` are treated the same, but in future PRs we will update
`expr` to match to new grammar.
Co-authored-by: Vincezo Palazzo <vincenzopalazzodev@gmail.com>
|
|
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
|
|
sync_cg_clif-2024-05-13
|
|
interpret: move error macros into error.rs
|
|
|
|
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.
|
|
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".
|
|
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`
|
|
|
|
This avoids the need for a clone, fixing a FIXME comment.
|
|
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`
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
```
|
|
|
|
This requires exporting the interpreter macros so they can be used with
`use crate::interpret::*`.
|
|
|
|
|
|
|
|
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
|
|
Fix MemCategorization and ExprUse visitors for new solver (this time it's better)
Best reviewed by each commit. Supersedes #124859.
r? lcnr
|
|
Fixes rust-lang/rustc_codegen_cranelift#1148
|
|
|
|
Fixes rust-lang/rustc_codegen_cranelift#1203
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
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>
|
|
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
|
|
|
|
This will allow adding dependencies to the build system in the future.
|
|
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``
|