about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-11-17Auto merge of #118003 - matthiaskrgr:rollup-80t3uky, r=matthiaskrgrbors-80/+784
Rollup of 3 pull requests Successful merges: - #115476 (document ABI compatibility) - #117688 (Misc changes to StableMIR required to Kani use case.) - #117998 (On resolve error of `[rest..]`, suggest `[rest @ ..]`) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-17Rollup merge of #117998 - estebank:issue-88404, r=TaKO8KiMatthias Krüger-0/+84
On resolve error of `[rest..]`, suggest `[rest @ ..]` When writing a pattern to collect multiple entries of a slice in a single binding, it is easy to misremember or typo the appropriate syntax to do so, instead writing the experimental `X..` pattern syntax. When we encounter a resolve error because `X` isn't available, we suggest `X @ ..` as an alternative. ``` error[E0425]: cannot find value `rest` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13 | LL | [1, rest..] => println!("{rest:?}"), | ^^^^ not found in this scope | help: if you meant to collect the rest of the slice in `rest`, use the at operator | LL | [1, rest @ ..] => println!("{rest:?}"), | + ``` Fix #88404.
2023-11-17Rollup merge of #117688 - celinval:smir-kani-reach, r=compiler-errorsMatthias Krüger-72/+583
Misc changes to StableMIR required to Kani use case. First, I wanted to say that I can split this review into multiple if it makes reviewing easier. I bundled them up, since I've been testing them together (See https://github.com/rust-lang/project-stable-mir/pull/51 for the set of more thorough checks). So far, this review includes 3 commits: 1. Add more APIs and fix `Instance::body` - Add more APIs to retrieve information about types. - Add a few more instance resolution options. For the drop shim, we return None if the drop body is empty. Not sure it will be enough. - Make `Instance::body()` return an Option<Body>, since not every instance might have an available body. For example, foreign instances, virtual instances, dependencies. 2. Fix a bug on MIRVisitor - We were not iterating over all local variables due to a typo. 3. Add more SMIR internal impl and callback return value - In cases like Kani, we will invoke the rustc_internal run command directly for now. It would be handly to be able to have a callback that can return a value. - We also need extra methods to convert stable constructs into internal ones, so we can break down the transition into finer grain commits. - For the internal implementation of Region, we're always returning `ReErased` for now.
2023-11-17Rollup merge of #115476 - RalfJung:abi-compat-docs, r=Mark-SimulacrumMatthias Krüger-8/+117
document ABI compatibility I don't think we have any central place where we document our ABI compatibility rules, so let's create one. The `fn()` pointer type seems like a good place since ABI questions can only become relevant when invoking a function through a function pointer. This will likely need T-lang FCP.
2023-11-17linking in general has more pitfalls than just call ABIRalf Jung-2/+3
2023-11-17Auto merge of #117985 - lnicola:sync-from-ra, r=lnicolabors-970/+2212
Subtree update of `rust-analyzer` r? `@ghost` Out of band, but required for https://github.com/rust-lang/rust/pull/117981.
2023-11-17Auto merge of #118001 - TaKO8Ki:rollup-fedlwwj, r=TaKO8Kibors-157/+115
Rollup of 5 pull requests Successful merges: - #117649 (Move `lint_store`) - #117850 (bootstrap: simplify setting unstable-options for tools) - #117889 (docs(release): Clarify cargo entries) - #117946 (avoid exhaustive i16 test in Miri) - #117963 (`rustc_query_system` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-17Rollup merge of #117963 - nnethercote:rustc_query_system, r=compiler-errorsTakayuki Maeda-34/+29
`rustc_query_system` cleanups Minor cleanups. r? `@compiler-errors`
2023-11-17Rollup merge of #117946 - RalfJung:miri-libcore-test, r=Mark-SimulacrumTakayuki Maeda-2/+5
avoid exhaustive i16 test in Miri https://github.com/rust-lang/rust/pull/116301 added a test that is way too slow to be running in Miri. So let's only test a few hopefully representative cases.
2023-11-17Rollup merge of #117889 - epage:docs, r=Mark-SimulacrumTakayuki Maeda-11/+10
docs(release): Clarify cargo entries Trying to make these easier to scan and more understandable out of the context of their PR
2023-11-17Rollup merge of #117850 - onur-ozkan:fix-116538, r=Mark-SimulacrumTakayuki Maeda-4/+10
bootstrap: simplify setting unstable-options for tools Previously, we unconditionally(instead of `if path == "src/tools/clippy" || ..`) set this (to prevent recompiling tools between `x check $tool` and '` check $another_tool` executions) specifically for tools in the `x check` step. This PR relocates that logic to `fn prepare_tool_cargo`, making it step-agnostic. Fixes #116538 Fixes #117983
2023-11-17Rollup merge of #117649 - nnethercote:mv-lint_store, r=cjgillotTakayuki Maeda-106/+61
Move `lint_store` Some nice cleanups enabled by the removal of compiler plugins. r? `@cjgillot`
2023-11-17Auto merge of #117987 - bjorn3:sync_cg_clif-2023-11-16, r=bjorn3bors-192/+473
Subtree sync for rustc_codegen_cranelift The main highlights this time are support for AES and SHA256 crypto intrinsics on x86_64 by lowering to inline asm. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-11-17On resolve error of `[rest..]`, suggest `[rest @ ..]`Esteban Küber-0/+84
When writing a pattern to collect multiple entries of a slice in a single binding, it is easy to misremember or typo the appropriate syntax to do so, instead writing the experimental `X..` pattern syntax. When we encounter a resolve error because `X` isn't available, we suggest `X @ ..` as an alternative. ``` error[E0425]: cannot find value `rest` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13 | LL | [1, rest..] => println!("{rest:?}"), | ^^^^ not found in this scope | help: if you meant to collect the rest of the slice in `rest`, use the at operator | LL | [1, rest @ ..] => println!("{rest:?}"), | + ``` Fix #88404.
2023-11-17Auto merge of #117996 - matthiaskrgr:rollup-sp48bl4, r=matthiaskrgrbors-28/+193
Rollup of 5 pull requests Successful merges: - #117892 (Detect more `=>` typos) - #117959 (Better handle type errors involving `Self` literals) - #117980 (fix: Update CONTRIBUTING.md recommend -> recommended) - #117982 (bootstrap: only show PGO warnings when verbose) - #117990 (Tweak error and move tests) Failed merges: - #117944 (some additional region refactorings) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-17Rollup merge of #117990 - estebank:issue-100825-part-deux, r=NilstriebMatthias Krüger-15/+77
Tweak error and move tests r? `@Nilstrieb` Split off #117565.
2023-11-17Rollup merge of #117982 - cuviper:quiet-pgo, r=onur-ozkanMatthias Krüger-1/+3
bootstrap: only show PGO warnings when verbose Building rustc with `--rust-profile-use` is currently dumping a lot of warnings of "no profile data available for function" from `rustc_smir` and `stable_mir`. These simply aren't exercised by the current profile- gathering steps, but that's to be expected for new or experimental functionality. I think for most people, these warnings will be just noise, so it makes sense to only have them in verbose builds.
2023-11-17Rollup merge of #117980 - WhistlingZephyr:patch-1, r=Dylan-DPCMatthias Krüger-1/+1
fix: Update CONTRIBUTING.md recommend -> recommended Redo of https://github.com/rust-lang/rust/pull/116529.
2023-11-17Rollup merge of #117959 - estebank:issue-76086, r=compiler-errorsMatthias Krüger-1/+61
Better handle type errors involving `Self` literals When encountering a type error involving a `Self` literal, point at the self type of the enclosing `impl` and suggest using the actual type name instead. ``` error[E0308]: mismatched types --> $DIR/struct-path-self-type-mismatch.rs:13:9 | LL | impl<T> Foo<T> { | - ------ this is the type of the `Self` literal | | | found type parameter LL | fn new<U>(u: U) -> Foo<U> { | - ------ expected `Foo<U>` because of return type | | | expected type parameter LL | / Self { LL | | LL | | inner: u LL | | LL | | } | |_________^ expected `Foo<U>`, found `Foo<T>` | = note: expected struct `Foo<U>` found struct `Foo<T>` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters help: use the type name directly | LL | Foo::<U> { | ~~~~~~~~ ``` Fix #76086.
2023-11-17Rollup merge of #117892 - estebank:fat-arrow-typo, r=compiler-errorsMatthias Krüger-10/+51
Detect more `=>` typos Handle and recover `match expr { pat >= { arm } }`.
2023-11-17Remove `Compiler::register_lints`.Nicholas Nethercote-5/+0
Lint registration now happens early enough that we can run it from `Config`, before `Compiler` is created.
2023-11-17Move `lint_store` from `GlobalCtxt` to `Session`.Nicholas Nethercote-61/+56
This was made possible by the removal of plugin support, which simplified lint store creation. This simplifies the places in rustc and rustdoc that call `describe_lints`, which are early on. The lint store is now built before those places, so they don't have to create their own lint store for temporary use, they can just use the main one.
2023-11-17Remove dead lint code.Nicholas Nethercote-33/+5
2023-11-17Inline and remove `create_lint_store`.Nicholas Nethercote-13/+6
2023-11-16Fix code indentationEsteban Küber-3/+3
2023-11-16review comment: move error logic to different methodEsteban Küber-58/+55
2023-11-16Merge commit 'def04540a4e2541b995195c752c751295606a388' into ↵bjorn3-192/+473
sync_cg_clif-2023-11-16
2023-11-16Auto merge of #117979 - flip1995:clippyup, r=matthiaskrgrbors-10376/+10343
Clippy subtree sync r? `@Manishearth`
2023-11-16Rustup to rustc 1.76.0-nightly (6b771f6b5 2023-11-15)bjorn3-1/+1
2023-11-16Update reference to bjorn3/rustc_codegen_craneliftbjorn3-1/+1
2023-11-16Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-raLaurențiu Nicola-970/+2212
2023-11-16Fix has_body() and change resolve_drop_in_place() sigCelina G. Val-18/+20
Fixed the `has_body()` function operator. Before that, this function was returning false for all shims. Change resolve_drop_in_place() to also return an instance for empty shims, since they may still be required for vtable construction.
2023-11-16Always run builder to evaluate constantsCelina G. Val-4/+1
We were previously skipping it for non-generic functions, but this was leaving some constants unevaluated.
2023-11-16Address PR commentsCelina G. Val-4/+3
2023-11-16Add more APIs and fix `Instance::body`Celina G. Val-47/+422
Add more APIs to retrieve information about types, and add more instance resolution options. Make `Instance::body()` return an Option<Body>, since not every instance might have an available body. For example, foreign instances, virtual instances, dependencies.
2023-11-16Auto merge of #15913 - lnicola:bump-libc, r=lnicolabors-4/+5
internal: Bump libc CC https://github.com/rust-lang/rust/pull/117981
2023-11-16Bump libcLaurențiu Nicola-4/+5
2023-11-16Auto merge of #116097 - jackh726:higher-ranked-lifetime-error-backup, ↵bors-13/+80
r=compiler-errors Try to use approximate placeholder regions when outputting an AscribeUserType error in borrowck Fixes #114866 Hi from GOSIM :)
2023-11-16Fix bug on MIRVisitorCelina G. Val-2/+2
We were not iterating over all local variables due to a typo.
2023-11-16Add more SMIR internal impl and callback return valueCelina G. Val-21/+159
In cases like Kani, we will invoke the rustc_internal run command directly for now. It would be handly to be able to have a callback that can return a value. We also need extra methods to convert stable constructs into internal ones, so we can break down the transition into finer grain commits.
2023-11-16bootstrap: only show PGO warnings when verboseJosh Stone-1/+3
Building rustc with `--rust-profile-use` is currently dumping a lot of warnings of "no profile data available for function" from `rustc_smir` and `stable_mir`. These simply aren't exercised by the current profile- gathering steps, but that's to be expected for new or experimental functionality. I think for most people, these warnings will be just noise, so it makes sense to only have them in verbose builds.
2023-11-16fix: Update CONTRIBUTING.md recommend -> recommendedZephyr-1/+1
2023-11-16Update Cargo.lockPhilipp Krones-7/+5
2023-11-16Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyupPhilipp Krones-10369/+10338
2023-11-16Auto merge of #11823 - flip1995:rustup, r=flip1995bors-117/+102
Rustup r? `@ghost` changelog: none
2023-11-16Bump Clippy version -> 0.1.76Philipp Krones-5/+5
2023-11-16Bump nightly version -> 2023-11-16Philipp Krones-1/+1
2023-11-16Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-10404/+10388
2023-11-16Auto merge of #15830 - ↵bors-41/+23
davidbarsky:davidbarsky/allow-companion-extension-to-call-rust-analyzer, r=davidbarsky code: expose workspaces to other extensions; remove `addProject` command This (mostly red) PR does three things: - Exposes two methods to companion extensions (`setWorkspaces` and `notifyRustAnalyzer`). - `setWorkspaces` is needed to update `linkedProjects` _without_ writing workspace/global configuration. - `notifyRustAnalyzer` to get the server to pull the new configuration. - Makes `Ctx` implement `RustAnalyzerExtensionApi` to prevent accidental regressions. - Remove `rust-analyzer.addProject`, as that will live in a buck2 companion extension. No need for that to be in rust-analyzer! I can see the utility of combining `notifyRustAnalyzer` and `setWorkspaces` into a single method (`updateWorkspacesAndNotify()`?), but I don't feel strongly about this. My feeling is that this API could be easily changed in the future.
2023-11-16code: expose workspaces to other extensions; remove `addProject` commandDavid Barsky-41/+23