about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-17Update compiler/rustc_parse/src/parser/nonterminal.rsEric Holk-2/+1
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2024-05-13Apply code review suggestionsEric Holk-38/+57
- use feature_err to report unstable expr_2021 - Update downlevel expr_2021 diagnostics Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2024-05-13Macros: match const { ... } with expr nonterminal in edition 2024Vincenzo Palazzo-1/+80
Co-authored-by: Eric Holk <eric@theincredibleholk.org> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-13expr_2021 should be allowed on edition 2021 and laterEric Holk-2/+2
2024-05-13Add test that expr_2021 only works on 2024 editionEric Holk-0/+38
Co-authored-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-13Add expr_2021 nonterminal and feature flagEric Holk-3/+48
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>
2024-05-13Auto merge of #125074 - bjorn3:sync_cg_clif-2024-05-13, r=bjorn3bors-166/+481
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-13Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into ↵bjorn3-166/+481
sync_cg_clif-2024-05-13
2024-05-13Auto merge of #125061 - RalfJung:interpret-error, r=cjgillotbors-132/+126
interpret: move error macros into error.rs
2024-05-13Rustup to rustc 1.80.0-nightly (ef0027897 2024-05-12)bjorn3-1/+1
2024-05-13Auto merge of #125024 - Oneirical:master, r=jieyouxubors-25/+45
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-13Auto merge of #124999 - scottmcm:unify-aggregate, r=nnethercotebors-22/+26
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-13Auto merge of #125055 - nnethercote:Comment-FIXME, r=compiler-errorsbors-29/+43
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-13interpret: move error macros into error.rsRalf Jung-132/+126
2024-05-13Make `Comments::next` consume a comment.Nicholas Nethercote-9/+7
This avoids the need for a clone, fixing a FIXME comment.
2024-05-13Auto merge of #124914 - nnethercote:rm-extern-crate-rustc_middle, r=saethlinbors-81/+281
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-13Make handling of `Comments` more iterator-like.Nicholas Nethercote-24/+40
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-13Remove `extern crate rustc_middle` from `rustc_ty_utils`.Nicholas Nethercote-2/+12
2024-05-13Remove `extern crate rustc_middle` from `rustc_trait_selection`.Nicholas Nethercote-2/+29
2024-05-13Remove `extern crate rustc_middle` from `rustc_query_impl`.Nicholas Nethercote-6/+4
2024-05-13Remove `extern crate rustc_middle` from `rustc_mir_transform`.Nicholas Nethercote-2/+31
2024-05-13Remove `extern crate rustc_middle` from `rustc_mir_build`.Nicholas Nethercote-8/+24
2024-05-13Remove `extern crate rustc_middle` from `rustc_metadata`.Nicholas Nethercote-3/+6
2024-05-13Remove `extern crate rustc_middle` from `rustc_infer`.Nicholas Nethercote-2/+21
2024-05-13Remove `extern crate rustc_middle` from `rustc_hir_typeck`.Nicholas Nethercote-3/+25
2024-05-12Auto merge of #125051 - dtolnay:printletelse, r=compiler-errorsbors-1/+46
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-13Remove `extern crate rustc_middle` from `rustc_hir_analysis`.Nicholas Nethercote-4/+27
2024-05-13Remove `extern crate rustc_middle` from `rustc_const_eval`.Nicholas Nethercote-48/+101
This requires exporting the interpreter macros so they can be used with `use crate::interpret::*`.
2024-05-13Remove a stray backtick in an error explanation.Nicholas Nethercote-1/+1
2024-05-12Pretty-print let-else with added parenthesization when neededDavid Tolnay-2/+6
2024-05-12Add AST pretty-printer tests for let-elseDavid Tolnay-0/+41
2024-05-12Auto merge of #124639 - ↵bors-116/+409
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-12Auto merge of #124902 - compiler-errors:mem-cat-but-better, r=lcnrbors-1105/+1183
Fix MemCategorization and ExprUse visitors for new solver (this time it's better) Best reviewed by each commit. Supersedes #124859. r? lcnr
2024-05-12Use the target cpu from the target spec on x86_64 when -Ctarget-cpu isn't usedbjorn3-3/+3
Fixes rust-lang/rustc_codegen_cranelift#1148
2024-05-12Propagate errors rather than using return_if_errMichael Goulet-208/+252
2024-05-12Support naked functionsbjorn3-48/+231
Fixes rust-lang/rustc_codegen_cranelift#1203
2024-05-12Remove polymorphize calls for statics in a couple more placesbjorn3-2/+2
2024-05-12Apply nitsMichael Goulet-49/+105
2024-05-12Try structurally resolveMichael Goulet-29/+77
2024-05-12Make LateCtxt be a type info delegate for EUV for clippyMichael Goulet-61/+59
2024-05-12Introduce TypeInformationCtxt to abstract over LateCtxt/FnCtxtMichael Goulet-134/+160
2024-05-12Remove unncessary mut refMichael Goulet-2/+38
2024-05-12Inline MemCategorization into ExprUseVisitorMichael Goulet-924/+778
2024-05-12Assert that MemCategorizationVisitor actually errors when it bails ungracefullyMichael Goulet-1/+17
2024-05-12Auto merge of #125040 - ickk:patch-1, r=notriddlebors-1/+1
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-12Match ergonomics 2024: migration lintJules Bertholet-116/+409
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-12Auto merge of #125045 - GuillaumeGomez:rollup-em6qdzw, r=GuillaumeGomezbors-99/+173
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-12Significantly reduce check cfg warningsbjorn3-0/+35
2024-05-12Use cargo in y.shbjorn3-18/+11
This will allow adding dependencies to the build system in the future.
2024-05-12Rollup merge of #125036 - lcnr:new-solver-trace, r=compiler-errorsGuillaume Gomez-53/+56
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``