about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-01Auto merge of #11837 - y21:issue11835, r=dswijbors-6/+99
[`missing_asserts_for_indexing`]: accept length equality checks Fixes #11835 The lint now allows indexing with indices 0 and 1 when an `assert!(x.len() == 2);` is found. (Also fixed a typo in the doc example) changelog: [`missing_asserts_for_indexing`]: accept len equality checks as a valid assertion
2023-12-01Auto merge of #11597 - y21:repeat_vec_with_capacity, r=dswijbors-0/+234
new lint: `repeat_vec_with_capacity` Closes #11537 [Lint description](https://github.com/y21/rust-clippy/blob/repeat_vec_with_capacity/clippy_lints/src/repeat_vec_with_capacity.rs#L14) should explain this PR :) changelog: new lint: `repeat_vec_with_capacity`
2023-12-01Handle recursion limit for subtype and well-formed predicatesMatthew Jasper-5/+130
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-1174/+3660
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-1174/+3660
2023-12-01Auto merge of #11903 - flip1995:rustup, r=flip1995bors-242/+257
Rustup r? `@ghost` changelog: none
2023-12-01Bump nightly version -> 2023-12-01Philipp Krones-1/+1
2023-12-01Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1214/+3715
2023-12-01use `iter::repeat_with` in suggestion and add examplesy21-9/+14
2023-12-01Auto merge of #15879 - dfireBird:fix-14656, r=Veykrilbors-23/+185
Implement completion for the callable fields. Fixes #14656 PR is opened with basic changes. It could be improved by having a new `SymbolKind` for the callable fields and implementing a separate render function similar to the `render_method` for the new `SymbolKind`. It could also be done without any changes to the `SymbolKind` of course, have the new function called based on the type of field. I prefer the former method. Please give any thoughts or changes you think is appropriate for this method. I could start working on that in this same PR.
2023-12-01new lint: `repeat_vec_with_capacity`y21-0/+229
2023-12-01Auto merge of #115993 - bvanjoi:fix-115966, r=petrochenkovbors-32/+118
vis note for no pub reexports glob import Fixes #115966 Only trigger the `unused_import` lint when it's not being used. r? `@petrochenkov`
2023-12-01Fix eager macro input spans being discardedLukas Wirth-94/+101
2023-12-01fix: correct the arg for 'suggest to use associated function syntax' diagnosticYoung-Flash-3/+78
2023-12-01Fix link name for `extern "C"` in msvcDianQK-1/+2
2023-12-01improve NLL/polonius scope equality assertionRémy Rakic-1/+2
2023-12-01add tests from crater for liveness causing scope differencesRémy Rakic-0/+46
2023-12-01move and maintain live loans in `LivenessValues`Rémy Rakic-97/+94
Liveness data is pushed from multiple parts of NLL. Instead of changing the call sites to maintain live loans, move the latter to `LivenessValues` where this liveness data is pushed to, and maintain live loans there. This fixes the differences in polonius scopes on some CFGs where a variable was dead in tracing but as a MIR terminator its regions were marked live from "constraint generation"
2023-12-01rename a couple of trivial variablesRémy Rakic-3/+3
for consistency with how they're named everywhere else
2023-12-01remove useless debug logRémy Rakic-2/+0
2023-12-01Simplify include handlingLukas Wirth-43/+46
2023-12-01Auto merge of #16000 - HKalbasi:drop-inlay-hint, r=HKalbasibors-25/+284
Initial support for implicit drop inlay hint cc #15785
2023-12-01Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstriebbors-26/+22
Stabilize C string literals RFC: https://rust-lang.github.io/rfcs/3348-c-str-literal.html Tracking issue: https://github.com/rust-lang/rust/issues/105723 Documentation PR (reference manual): https://github.com/rust-lang/reference/pull/1423 # Stabilization report Stabilizes C string and raw C string literals (`c"..."` and `cr#"..."#`), which are expressions of type [`&CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html). Both new literals require Rust edition 2021 or later. ```rust const HELLO: &core::ffi::CStr = c"Hello, world!"; ``` C strings may contain any byte other than `NUL` (`b'\x00'`), and their in-memory representation is guaranteed to end with `NUL`. ## Implementation Originally implemented by PR https://github.com/rust-lang/rust/pull/108801, which was reverted due to unintentional changes to lexer behavior in Rust editions < 2021. The current implementation landed in PR https://github.com/rust-lang/rust/pull/113476, which restricts C string literals to Rust edition >= 2021. ## Resolutions to open questions from the RFC * Adding C character literals (`c'.'`) of type `c_char` is not part of this feature. * Support for `c"..."` literals does not prevent `c'.'` literals from being added in the future. * C string literals should not be blocked on making `&CStr` a thin pointer. * It's possible to declare constant expressions of type `&'static CStr` in stable Rust (as of v1.59), so C string literals are not adding additional coupling on the internal representation of `CStr`. * The unstable `concat_bytes!` macro should not accept `c"..."` literals. * C strings have two equally valid `&[u8]` representations (with or without terminal `NUL`), so allowing them to be used in `concat_bytes!` would be ambiguous. * Adding a type to represent C strings containing valid UTF-8 is not part of this feature. * Support for a hypothetical `&Utf8CStr` may be explored in the future, should such a type be added to Rust.
2023-12-01Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstriebbors-90/+41
Stabilize C string literals RFC: https://rust-lang.github.io/rfcs/3348-c-str-literal.html Tracking issue: https://github.com/rust-lang/rust/issues/105723 Documentation PR (reference manual): https://github.com/rust-lang/reference/pull/1423 # Stabilization report Stabilizes C string and raw C string literals (`c"..."` and `cr#"..."#`), which are expressions of type [`&CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html). Both new literals require Rust edition 2021 or later. ```rust const HELLO: &core::ffi::CStr = c"Hello, world!"; ``` C strings may contain any byte other than `NUL` (`b'\x00'`), and their in-memory representation is guaranteed to end with `NUL`. ## Implementation Originally implemented by PR https://github.com/rust-lang/rust/pull/108801, which was reverted due to unintentional changes to lexer behavior in Rust editions < 2021. The current implementation landed in PR https://github.com/rust-lang/rust/pull/113476, which restricts C string literals to Rust edition >= 2021. ## Resolutions to open questions from the RFC * Adding C character literals (`c'.'`) of type `c_char` is not part of this feature. * Support for `c"..."` literals does not prevent `c'.'` literals from being added in the future. * C string literals should not be blocked on making `&CStr` a thin pointer. * It's possible to declare constant expressions of type `&'static CStr` in stable Rust (as of v1.59), so C string literals are not adding additional coupling on the internal representation of `CStr`. * The unstable `concat_bytes!` macro should not accept `c"..."` literals. * C strings have two equally valid `&[u8]` representations (with or without terminal `NUL`), so allowing them to be used in `concat_bytes!` would be ambiguous. * Adding a type to represent C strings containing valid UTF-8 is not part of this feature. * Support for a hypothetical `&Utf8CStr` may be explored in the future, should such a type be added to Rust.
2023-12-01fix close parens position to move after field accessdfireBird-14/+5
2023-12-01Pass calling span through to builtin macro expansionsLukas Wirth-498/+624
2023-12-01Initial support for implicit drop inlay hinthkalbasi-25/+284
2023-12-01Auto merge of #118216 - lqd:constraint-generation-non-non, r=matthewjasperbors-432/+454
Refactor NLL constraint generation and most of polonius fact generation As discussed in #118175, NLL "constraint generation" is only about liveness, but currently also contains legacy polonius fact generation. The latter is quite messy, and this PR cleans this up to prepare for its future removal: - splits polonius fact generation out of NLL constraint generation - merges NLL constraint generation to its more natural place, liveness - extracts all of the polonius fact generation from NLLs apart from MIR typeck (as fact generation is somewhat in a single place there already, but should be cleaned up) into its own explicit module, with a single entry point instead of many. There should be no behavior changes, and tests seem to behave the same as master: without polonius, with legacy polonius, with the in-tree polonius. I've split everything into smaller logical commits for easier review, as it required quite a bit of code to be split and moved around, but it should all be trivial changes. r? `@matthewjasper`
2023-12-01Auto merge of #15912 - Sarrus1:master, r=HKalbasibors-27/+29
chore: remove unused `PhantomData` This PR removes an unused `PhantomData` in `FileItemTreeId`. *Note:* I am not sure how this should be implemented, maybe as a type instead of a wrapper struct? I'd be happy to do so if needed 👍
2023-12-01Auto merge of #15961 - ohno418:top-level-let-stmt, r=Veykrilbors-42/+84
Improve error handling for top-level `let` statements This commit addresses the issue of excessive and unrelated errors generated by top-level `let` statements. Now, only a single error is produced, indicating that `let` statements are invalid at the top level. --- Fixes https://github.com/rust-lang/rust-analyzer/issues/14963. While I'm not really sure if handling a particular case in a special manner is appropriate, it would be good to suppress the excessive number of annoying and unrelated errors.
2023-12-01Update snapshots of rustdoc tests to take into account the comment highlightingGuillaume Gomez-5/+5
2023-12-01Add GUI tests for comments highlighting in items declarationGuillaume Gomez-1/+118
2023-12-01Add highlighting for comments in items declarationGuillaume Gomez-8/+14
2023-12-01needless_borrows_for_generic_args: Handle when field operand impl DropMartin Nordholts-2/+40
Before this fix, the lint had a false positive, namely when a reference was taken to a field when the field operand implements a custom Drop. The compiler will refuse to partially move a type that implements Drop, because that would put the operand in a weird state. See added regression test.
2023-12-01update addr docsRalf Jung-8/+8
2023-12-01Auto merge of #118493 - TaKO8Ki:rollup-jfkdbyo, r=TaKO8Kibors-124/+116
Rollup of 3 pull requests Successful merges: - #118483 (rustdoc: `div.where` instead of fmt-newline class) - #118486 (generic_const_exprs: suggest to add the feature, not use it) - #118489 (Wesley is on vacation) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-01Auto merge of #11898 - clubby789:upper_case_acronyms_variants, r=Manishearthbors-14/+41
Allow `allow`ing `upper_case_acronyms` on enum variants Fixes #7708 changelog: [`upper_case_acronyms`]: allow `allow`ing on enum variants
2023-12-01Rollup merge of #118489 - wesleywiser:vacation, r=wesleywiserTakayuki Maeda-1/+1
Wesley is on vacation OOF until Dec-11 🏖️
2023-12-01Rollup merge of #118486 - RalfJung:add-feature, r=compiler-errorsTakayuki Maeda-74/+74
generic_const_exprs: suggest to add the feature, not use it Usually our missing feature messages look something like ``` = help: add `#![feature(inline_const)]` to the crate attributes to enable ``` However `generic_const_exprs` used a different verb. That's inconsistent and it also means playground won't add that nice hyperlink to add the feature automatically. So let's use the same verb as everywhere else.
2023-12-01Rollup merge of #118483 - notriddle:notriddle/fmt-newline, r=GuillaumeGomezTakayuki Maeda-49/+41
rustdoc: `div.where` instead of fmt-newline class This is about equally readable, a lot more terse, and stops special-casing functions and methods. ```console $ du -hs doc-old/ doc-new/ 671M doc-old/ 670M doc-new/ ```
2023-12-01vis note for no pub reexports glob importbohan-32/+118
2023-12-01Auto merge of #118482 - RalfJung:interpret-local-type, r=WaffleLapkinbors-0/+3
explain a good reason for why LocalValue does not store the type of the local As found out by `@lcnr` in https://github.com/rust-lang/rust/pull/112307, storing the type here can lead to subtle bugs when it gets out of sync with the MIR body. That's not the reason why the interpreter does it this way I think, but good thing we dodged that bullet. :)
2023-12-01Auto merge of #118461 - celinval:smir-switch-targets, r=ouz-abors-44/+69
Change `SwitchTarget` representation in StableMIR The new structure encodes its invariant, which reduces the likelihood of having an inconsistent representation. It is also more intuitive and user friendly. I encapsulated the structure for now in case we decide to change it back. ### Notes: 1. I had to change the `Successors` type, since there's a conflict on the iterator type. We could potentially implement an iterator here, but I would prefer keeping it simple for now, and add a `successors_iter()` method if needed. 2. I removed `CoroutineDrop` for now since it we never create it. We can add it when we add support to other MIR stages.
2023-12-01Improve error handling for top-level `let` statementsYutaro Ohno-42/+84
This commit addresses the issue of excessive and unrelated errors generated by top-level `let` statements. Now, only a single error is produced, indicating that `let` statements are invalid at the top level.
2023-12-01Auto merge of #118472 - nnethercote:rustc_session, r=bjorn3bors-118/+87
`rustc_session` cleanups r? `@bjorn3`
2023-11-30Wesley is on vacationWesley Wiser-1/+1
2023-11-30Auto merge of #116892 - ojeda:rethunk, r=wesleywiserbors-10/+216
Add `-Zfunction-return={keep,thunk-extern}` option This is intended to be used for Linux kernel RETHUNK builds. With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module. Issue: https://github.com/rust-lang/rust/issues/116853.
2023-11-30move exposed-provenance APIs into separate feature gate and explain the ↵Ralf Jung-55/+70
relationship of Exposed Provenance and Strict Provenance
2023-11-30Change prefetch to avoid deadlockAndreas Jonson-16/+7
2023-11-30Fix cg_gcc CI runGuillaume Gomez-7/+8