about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-04Rollup merge of #132598 - jdonszelmann:move-lints-to-early, r=xFrednetJubilee-112/+122
Clippy: Move some attribute lints to be early pass (post expansion) r? ```@xFrednet``` As a side effect it removes a duplicated warning on line 53 of the `allow_attributes` test. I discussed this with ```@xFrednet``` , and it's mainly to support the attribute rework https://github.com/rust-lang/rust/issues/131229
2024-11-04Rollup merge of #132596 - GuillaumeGomez:show-coverage, r=notriddleJubilee-6/+48
[rustdoc] Fix `--show-coverage` when JSON output format is used I realized while looking on the docs.rs page of the `sysinfo` crate that the coverage numbers displayed were wrong: ![image](https://github.com/user-attachments/assets/264b2e25-6271-4ed1-8b35-e8bd4fd475c6) I realized that it was because `--show-coverage --output-format=json` was relying on the same logic as the JSON output for the doc generation whereas it should not. I fixed it by changing the API for querying `is_json` a bit. The underlying issue is that JSON output format is stripping reexports of items from private modules. r? ``@notriddle``
2024-11-04Rollup merge of #132587 - ↵Jubilee-7/+21
nnethercote:revert-avoid-nested-replacement-ranges, r=petrochenkov Revert "Avoid nested replacement ranges" from #129346. It caused a test regression in the `cfg_eval.rs` crate. (The bugfix in #129346 was in a different commit; this commit was just a code simplification.) r? `@petrochenkov`
2024-11-04Rollup merge of #132492 - RalfJung:const-intrinsics, r=compiler-errorsJubilee-1268/+1333
remove support for extern-block const intrinsics This converts all const-callable intrinsics into the "new" form of a regular `fn` with `#[rustc_intrinsic]` attribute. That simplifies some of the logic since those functions can be marked `const fn` like regular functions, so intrinsics no longer need a special case to be considered const-callable at all. I also added a new attribute `#[rustc_const_stable_intrinsic]` to mark an intrinsic as being ready to be exposed on stable. Previously we used the `#[rustc_const_stable_indirect]` attribute for that, but that attribute had a dual role -- when used on a regular function, it is an entirely safe marker to make this function part of recursive const stability, but on an intrinsic it is a trusted marker requiring special care. It's not great for the same attribute to be sometimes fully checked and safe, and sometimes trusted and requiring special care, so I split this into two attributes. This also fixes https://github.com/rust-lang/rust/issues/122652 by accepting intrinsics as const-stable if they have a fallback body that is recursively const-stable. The library changes are best reviewed with whitespace hidden. r? `@compiler-errors`
2024-11-04Rollup merge of #132303 - nyurik:non-exhaustive-err, r=compiler-errorsJubilee-1/+10
More tests for non-exhaustive C-like enums in FFI Add a few more tests for the `improper_ctypes` lint as found with the [varnish-rs](https://github.com/gquintard/varnish-rs) project. This follows up on #116831, fixed in #116863 by ``@workingjubilee`` - I have been seeing these fail with the bindgen-generated non-exhaustive enums inside other structs. Seems the issue does not exist in the primary branch, so this PR just makes sure more cases are covered for the future.
2024-11-04Rollup merge of #132025 - duncpro:E0027, r=compiler-errorsJubilee-0/+95
fix suggestion for diagnostic error E0027 Closes #132008
2024-11-04Rollup merge of #131153 - VulnBandit:copy_impl_vuln, r=compiler-errorsJubilee-0/+51
Improve duplicate derive Copy/Clone diagnostics Improve duplicate derive Copy/Clone diagnostics. Closes #131083
2024-11-04when an intrinsic has a const-stable fallback body, we can easily expose it ↵Ralf Jung-8/+37
on stable
2024-11-04most const intrinsics don't need an explicit rustc_const_unstable any moreRalf Jung-58/+46
2024-11-04add new rustc_const_stable_intrinsic attribute for const-stable intrinsicsRalf Jung-68/+80
2024-11-04remove support for extern-block const intrinsicsRalf Jung-224/+118
2024-11-04convert all const-callable intrinsics into the new form (without extern block)Ralf Jung-968/+1110
2024-11-04Move two attribute lints to be early pass (post expansion)Jonathan Dönszelmann-112/+122
2024-11-04Auto merge of #132594 - lnicola:sync-from-ra, r=lnicolabors-849/+1907
Subtree update of `rust-analyzer` r? `@ghost`
2024-11-04Auto merge of #132603 - matthiaskrgr:rollup-ikzofgc, r=matthiaskrgrbors-451/+725
Rollup of 6 pull requests Successful merges: - #132355 (Fix compiler panic with a large number of threads) - #132486 (No need to instantiate binder in `confirm_async_closure_candidate`) - #132544 (Use backticks instead of single quotes for library feature names in diagnostics) - #132559 (find the generic container rather than simply looking up for the assoc with const arg) - #132579 (add rustc std workspace crate sources) - #132583 (Suggest creating unary tuples when types don't match a trait) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-04Rollup merge of #132583 - mejrs:tuples, r=compiler-errorsMatthias Krüger-0/+155
Suggest creating unary tuples when types don't match a trait When you want to have a variadic function, a common workaround to implement this is to create a trait and then implement that trait for various tuples. For example in `pyo3` there exists ```rust /// Calls the object with only positional arguments. pub fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<&PyAny> { ... } ``` with various impls like ```rust impl<A: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A,) impl<A: IntoPy<PyObject, B: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A, B) ... etc ``` This means that if you want to call the method with a single item you have to create a unary tuple, like `(x,)`, rather than just `x`. This PR implements a suggestion to do that, if applicable.
2024-11-04Rollup merge of #132579 - RalfJung:rustc-std-workspace-crates, r=AmanieuMatthias Krüger-0/+62
add rustc std workspace crate sources This adds the sources for the crates listed at https://crates.io/search?q=rustc-std-workspace in this repo. The first commit adds the original sources as downloaded from crates.io (with `Cargo.toml.orig` moved back over `Cargo.toml`), and adds a README explaining what this is about. The 2nd commit updates the sources to make the core and alloc crates re-exports of the "actual" core and alloc crates, as was already the case with `std`, and also adds a `repository` link to the manifest so one can figure out where to find these crates. I bumped the version for the core and alloc crates in the hope that the new versions can be published on crates.io shortly after this PR lands. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/rustc-std-workspace-core.20crate.20is.20empty) for a bit more context. r? `@Amanieu`
2024-11-04Rollup merge of #132559 - bvanjoi:fix-132534, r=compiler-errorsMatthias Krüger-8/+60
find the generic container rather than simply looking up for the assoc with const arg Fixes #132534 This issue is caused by mismatched generic parameters. Previously, it tried to find `T` in `trait X`, but after this change, it will find `T` in `fn a`. r? `@compiler-errors` as this assertion was introduced by you.
2024-11-04Rollup merge of #132544 - dianne:unstable-library-feature-backticks, ↵Matthias Krüger-431/+433
r=compiler-errors Use backticks instead of single quotes for library feature names in diagnostics This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since `DiagSymbolList` also displays symbols using backticks.
2024-11-04Rollup merge of #132486 - compiler-errors:no-binder, r=lcnrMatthias Krüger-9/+3
No need to instantiate binder in `confirm_async_closure_candidate` Removes a FIXME that is redundant. No longer needed since #122267.
2024-11-04Rollup merge of #132355 - practicalrs:fix_117638, r=SparrowLiiMatthias Krüger-3/+12
Fix compiler panic with a large number of threads Hi, This PR is an attempt to fix the problem described here https://github.com/rust-lang/rust/issues/117638 using the solution suggested in this comment https://github.com/rust-lang/rust/issues/117638#issuecomment-1800925067 Best regards, Michal
2024-11-04Rename `DocContext::is_json` into `DocContext::is_json_output`Guillaume Gomez-8/+8
2024-11-04Add UI regressions tests for rustdoc `--show-coverage` optionGuillaume Gomez-0/+34
2024-11-04Fix invalid coverage computation when `--output-format=json` is enabledGuillaume Gomez-6/+14
2024-11-04Auto merge of #132275 - compiler-errors:deref-effects, r=fee1-deadbors-141/+140
Register `~const` preds for `Deref` adjustments in HIR typeck This doesn't *do* anything yet, since `Deref` and `DerefMut` aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing `~const` in HIR typeck. r? fee1-dead
2024-11-04Suggest creating unary tuplesmejrs-0/+155
2024-11-04Auto merge of #132250 - nnethercote:rustc_borrowck-cleanups, r=compiler-errorsbors-385/+251
`rustc_borrowck` cleanups A bunch of cleanups I made while reading over this crate. r? `@lqd`
2024-11-04Merge pull request #18472 from lnicola/reinterpret-function-casingLaurențiu Nicola-1/+1
minor: Fix feature name casing
2024-11-04Fix feature name casingLaurențiu Nicola-1/+1
2024-11-04Auto merge of #132586 - workingjubilee:rollup-qrmn49a, r=workingjubileebors-1151/+286
Rollup of 4 pull requests Successful merges: - #131222 (Generate correct symbols.o for sparc-unknown-none-elf) - #132423 (remove const-support for align_offset and is_aligned) - #132565 (Reduce dependence on the target name) - #132576 (remove attribute ids from hir stats (they're simply not needed)) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-04update rustc-std-workspace cratesRalf Jung-12/+40
- make rustc-std-workspace-core/alloc re-exports of their underlying crates, like std = cleanup manifests
2024-11-04`BorrowckDiags` tweaks.Nicholas Nethercote-13/+5
- Store a mut ref to a `BorrowckDiags` in `MirBorrowckCtxt` instead of owning it, to save having to pass ownership in and out of `promoted_mbcx`. - Use `buffer_error` in a couple of suitable places.
2024-11-04Simplify `LocalUseMapBuild`.Nicholas Nethercote-48/+14
It has four different `insert` methods, with some duplication. This commit finds the commonality and removes them all.
2024-11-04Merge `BorrowCheckContext` into `TypeChecker`.Nicholas Nethercote-173/+88
Because there is no real reason for it to be a separate struct. - It has no methods. - It's easy to confuse with the nearby `BorrowckInferContext` (which does have methods). - The `mut` ref to it in `TypeChecker` makes it seem like any of the fields within might be mutable, but only two (`all_facts` and `constraints`) actually are. - Two of the fields are `pub(crate)` but can be private. This change makes a lot of code more concise and readable.
2024-11-04Remove unnecessary qualifiers.Nicholas Nethercote-3/+3
2024-11-04Remove unnecessary `continue`.Nicholas Nethercote-2/+1
2024-11-04Remove `ToUniverseInfo` impl for `CanonicalQueryInput<CustomTypeOp>`.Nicholas Nethercote-9/+0
It's unused.
2024-11-04Merge `UniverseInfo` and `UniverseInfoInner`.Nicholas Nethercote-25/+13
It's strange to have a struct that contains a single anonymous field that is an enum. This commit merges them. This does require increasing the visibility of `TypeOfInfo` to `pub(crate)`, but that seems worthwhile.
2024-11-04Tidy up comments and some formatting.Nicholas Nethercote-78/+92
Mostly by wrapping overly long comment lines, plus a few other things.
2024-11-04Move some `use` declarations.Nicholas Nethercote-13/+12
So they're all in the one place. Also prepend with `crate::`, à la the `unqualified_local_imports` lint.
2024-11-04Revert "Avoid nested replacement ranges" from #129346.Nicholas Nethercote-7/+21
It caused a test regression in the `cfg_eval.rs` crate. (The bugfix in #129346 was in a different commit; this commit was just a code simplification.)
2024-11-04Fix minicore, add tests based off of itMichael Goulet-129/+97
2024-11-04Make sure to enforce ~const DerefMut on mutability fixupMichael Goulet-0/+1
2024-11-04Register const preds for Deref adjustments in HIR typeckMichael Goulet-12/+42
2024-11-04Reduce visibilities.Nicholas Nethercote-21/+23
2024-11-04find the generic container rather than simply looking up for the assoc with ↵bohan-8/+60
const arg
2024-11-03Rollup merge of #132576 - jdonszelmann:no-attrid-in-stats, r=nnethercoteJubilee-80/+76
remove attribute ids from hir stats (they're simply not needed) Turns out these are simply not needed. Yay! r? `@nnethercote`
2024-11-03Rollup merge of #132565 - bjorn3:less_target_name_dependence, r=workingjubileeJubilee-50/+18
Reduce dependence on the target name The target name can be anything with custom target specs. Matching on fields inside the target spec is much more robust than matching on the target name. Also remove the unused is_builtin target spec field.
2024-11-03Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnayJubilee-1020/+183
remove const-support for align_offset and is_aligned As part of the recent discussion to stabilize `ptr.is_null()` in const context, the general vibe was that it's okay for a const function to panic when the same operation would work at runtime (that's just a case of "dynamically detecting that something is not supported as a const operation"), but it is *not* okay for a const function to just return a different result. Following that, `is_aligned` and `is_aligned_to` have their const status revoked in this PR, since they do return actively wrong results at const time. In the future we can consider having a new intrinsic or so that can check whether a pointer is "guaranteed to be aligned", but the current implementation based on `align_offset` does not have the behavior we want. In fact `align_offset` itself behaves quite strangely in const, and that support needs a bunch of special hacks. That doesn't seem worth it. Instead, the users that can fall back to a different implementation should just use const_eval_select directly, and everything else should not be made const-callable. So this PR does exactly that, and entirely removes const support for align_offset. Closes some tracking issues by removing the associated features: Closes https://github.com/rust-lang/rust/issues/90962 Closes https://github.com/rust-lang/rust/issues/104203 Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-11-03Rollup merge of #131222 - thejpster:fix-sparc-v7-symbol-o, r=workingjubileeJubilee-1/+9
Generate correct symbols.o for sparc-unknown-none-elf This fixes #130172 by selecting the correct ELF Machine type for sparc-unknown-none-elf (which has a baseline of SPARC V7).