about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-11-04Rollup merge of #132606 - eduardosm:char-slice-str-pattern-doc, r=tgross35Jubilee-2/+2
Improve example of `impl Pattern for &[char]` The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
2024-11-04Rollup merge of #132601 - rustbot:docs-update, r=ehussJubilee-0/+0
Update books ## rust-lang/edition-guide 3 commits in 1f07c242f8162a711a5ac5a4ea8fa7ec884ee7a9..2d482e203eb6d6e353814cf1415c5f94e590b9e0 2024-11-04 14:42:36 UTC to 2019-06-14 21:27:05 UTC - 2024: rustfmt style edition (rust-lang/edition-guide#331) - rustdoc: Fix doctest `include` paths (rust-lang/edition-guide#329) - docs(cargo): Cover MSRV-aware resolver (rust-lang/edition-guide#328) ## rust-lang/reference 3 commits in 23ce619966541bf2c80d45fdfeecf3393e360a13..da0f6dad767670da0e8cd5af8a7090db3272f626 2024-11-01 12:52:51 UTC to 2024-10-30 13:30:17 UTC - fix typo referring to 'Unsize' trait (rust-lang/reference#1669) - Add identifier syntax to items.md and subchapters (rust-lang/reference#1599) - Rename "object safe" to "dyn compatible" (rust-lang/reference#1666) ## rust-lang/rust-by-example 5 commits in 8bede1b919a81ab7d0c961f6bbf68d3efa297bd2..9db78608b17d5f4a6c033b8a3038466b87d63206 2024-10-31 21:03:20 UTC to 2024-10-26 16:06:05 UTC - fix(doc): correct small errors in pipes.md (rust-lang/rust-by-example#1894) - Fix ambiguous comment on 2.3 Arrays and Slices page (rust-lang/rust-by-example#1885) - Fix typo in generics/new_types (rust-lang/rust-by-example#1892) - docs(zh): fix known issues (rust-lang/rust-by-example#1891) - `read_lines`: Use `.map_while(Result::ok)` instead of `.flatten()`. (rust-lang/rust-by-example#1890) ## rust-lang/rustc-dev-guide 22 commits in 59d94ea75a0b157e148af14c73c2dd60efb7b60a..6a5accdaf10255882b1e6c59dfe5f1c79ac95484 2024-11-04 14:40:57 UTC to 2024-10-24 20:33:08 UTC - Add a link for the `reference` compiletest header (rust-lang/rustc-dev-guide#2096) - Slightly fix up the glossary (rust-lang/rustc-dev-guide#2127) - Remove an mdbook workaround (rust-lang/rustc-dev-guide#2124) - Fix broken links (rust-lang/rustc-dev-guide#2123) - Fix minicore.rs link (rust-lang/rustc-dev-guide#2122) - Update for recent dataflow simplifications. (rust-lang/rustc-dev-guide#2121) - Describe `minicore` test auxiliary and directive (rust-lang/rustc-dev-guide#2097) - Fix and update docs for `needs-force-clang-based-tests` (rust-lang/rustc-dev-guide#2085) - Add redirects for integration-testing and headers (rust-lang/rustc-dev-guide#2092) - Fix borked links (rust-lang/rustc-dev-guide#2119) - Describe how to revert a PR (rust-lang/rustc-dev-guide#2118) - Linkify the footnotes in the async closure chapter (rust-lang/rustc-dev-guide#2117) - Try to fix footnotes (rust-lang/rustc-dev-guide#2115) - Fix rustc-related links that are 404 right now (rust-lang/rustc-dev-guide#2112) - Async closures chapter (rust-lang/rustc-dev-guide#2110) - update rfl ci job policy (rust-lang/rustc-dev-guide#2108) - Fix internal and incomplete links (rust-lang/rustc-dev-guide#2107) - Describe why and how to use a separate build directory for rust-analyzer (rust-lang/rustc-dev-guide#2106) - Update current status of diagnostics translation infra (rust-lang/rustc-dev-guide#2105) - update const stability docs (rust-lang/rustc-dev-guide#2098) - Advice on auto-formatting C++ code (rust-lang/rustc-dev-guide#2104) - Update compiler-src.md (rust-lang/rustc-dev-guide#2102)
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-04Improve example of `impl Pattern for &[char]`Eduardo Sánchez Muñoz-2/+2
The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
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-04Update booksrustbot-0/+0
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