about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-09-28Rollup merge of #116211 - matthiaskrgr:clippy3, r=compiler-errorsMatthias Krüger-24/+19
more clippy complextity fixes redundant_guards, useless_format, clone_on_copy
2023-09-28Rollup merge of #115888 - RalfJung:assert_receiver_is_total_eq, r=dtolnayMatthias Krüger-3/+3
fix a comment about assert_receiver_is_total_eq "a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement `Eq`"? Also the attribute is called `derive`.
2023-09-28Rollup merge of #115535 - tshepang:patch-2, r=dtolnayMatthias Krüger-71/+69
format doc-comment code examples in std::process
2023-09-28Rollup merge of #112959 - tbu-:pr_fmt_error_wording, r=dtolnayMatthias Krüger-2/+2
Change the wording in `std::fmt::Write::write_str` Refer to the error instead of expanding its name.
2023-09-27Fix "unresolved link to std::fmt::Error" David Tolnay-1/+1
error: unresolved link to `std::fmt::Error` --> library/core/src/fmt/mod.rs:115:52 | 115 | /// This function will return an instance of [`std::fmt::Error`] on error. | | = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
2023-09-28Auto merge of #111278 - EFanZh:implement-from-array-refs-for-vec, r=dtolnaybors-0/+40
Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone` Currently, if `T` implements `Clone`, we can create a `Vec<T>` from an `&[T]` or an `&mut [T]`, can we also support creating a `Vec<T>` from an `&[T; N]` or an `&mut [T; N]`? Also, do I need to add `#[inline]` to the implementation? ACP: rust-lang/libs-team#220. [Accepted] Closes #100880.
2023-09-28Auto merge of #116208 - matthiaskrgr:the_loop_that_wasnt, r=GuillaumeGomezbors-1/+1
rustdoc: while -> if we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-28Auto merge of #116204 - Alexendoo:rustc-lint-macro-paths, r=cjgillotbors-84/+78
Use absolute paths in rustc_lint::passes macros A cosmetic change, so the callsite doesn't have to import things. Makes nicer for us to try in clippy
2023-09-27Auto merge of #116148 - DaniPopes:rustdoc-type-layout-ws, r=jshabors-2/+2
Fix whitespace in rustdoc type_layout.html `Size: <size>` was missing a space after the colon: ![image](https://github.com/rust-lang/rust/assets/57450786/c5a672f3-a28a-4b56-91e7-a4e6ffc8106e)
2023-09-28don't clone copy typesMatthias Krüger-3/+3
2023-09-27fix clippy::{redundant_guards, useless_format}Matthias Krüger-21/+16
2023-09-27Auto merge of #109597 - cjgillot:gvn, r=oli-obkbors-23/+7204
Implement a global value numbering MIR optimization The aim of this pass is to avoid repeated computations by reusing past assignments. It is based on an analysis of SSA locals, in order to perform a restricted form of common subexpression elimination. By opportunity, this pass allows for some simplifications by combining assignments. For instance, this pass could be able to see through projections of aggregates to directly reuse the aggregate field (not in this PR). We handle references by assigning a different "provenance" index to each `Ref`/`AddressOf` rvalue. This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we consider all the derefs of an immutable reference to a freeze type to give the same value: ```rust _a = *_b // _b is &Freeze _c = *_b // replaced by _c = _a ```
2023-09-27rustdoc: while -> ifMatthias Krüger-1/+1
we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-27Auto merge of #114901 - compiler-errors:style-guide-wc, r=calebcartwrightbors-6/+32
Amend style guide section for formatting where clauses in type aliases This PR has two parts: 1. Amend wording about breaking before or after the `=`, which is a style guide bugfix to align it with current rustfmt behavior. 2. Explain how to format trailing (#89122) where clauses, which are preferred in both GATs (#90076) and type aliases (#114662). r? `@joshtriplett`
2023-09-27Auto merge of #116202 - emmanuel-ferdman:wip, r=ehussbors-1/+1
Update location of `personality/gcc.rs` **PR Summary**: PR updates the location of `personality/gcc.rs` file in the docs.
2023-09-27Update location of personalityEmmanuel Ferdman-1/+1
2023-09-27Use absolute paths in rustc_lint::passes macrosAlex Macleod-84/+78
A cosmetic change, so the callsite doesn't have to import things
2023-09-27Auto merge of #115887 - RalfJung:pat, r=oli-obkbors-17/+27
thir::pattern: update some comments and error type names Follow-up to [these comments](https://github.com/rust-lang/rust/pull/105750#pullrequestreview-1629697578). Please carefully fact-check, I'm new to this area of the compiler!
2023-09-27Auto merge of #116093 - RalfJung:link_llvm_intrinsics, r=oli-obkbors-3/+3
make link_llvm_intrinsics and platform_intrinsics features internal These are both a lot like `feature(intrinsics)`, just slightly different syntax, so IMO it should be treated the same (also in terms of: if you get ICEs with this feature, that's on you -- we are not doing "nice" type-checking for intrinsics).
2023-09-27Auto merge of #116193 - matthiaskrgr:rollup-wpt7m5t, r=matthiaskrgrbors-235/+272
Rollup of 4 pull requests Successful merges: - #115934 (Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things) - #116149 (Anonymize binders for `refining_impl_trait` check) - #116178 (Add test for `const async fn`) - #116187 (Add context to `let: Ty = loop { break };`) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-27Rollup merge of #116187 - estebank:small-tweak, r=compiler-errorsMatthias Krüger-5/+23
Add context to `let: Ty = loop { break };` We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-27Rollup merge of #116178 - ↵Matthias Krüger-0/+18
Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser Add test for `const async fn` This adds a test for #102796
2023-09-27Rollup merge of #116149 - compiler-errors:anonymize, r=lcnrMatthias Krüger-4/+38
Anonymize binders for `refining_impl_trait` check We're naively using the equality impl for `ty::Clause` in the refinement check, which is okay *except* for binders, which carry some information about where they come from in the AST. Those locations are not gonna be equal between traits and impls, so anonymize those clauses so that this doesn't matter. Fixes #116135
2023-09-27Rollup merge of #115934 - oli-obk:smir_identity, r=spastorinoMatthias Krüger-226/+193
Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things Some groundwork for being able to work on https://github.com/rust-lang/project-stable-mir/issues/27 at all r? `@spastorino`
2023-09-27Auto merge of #116166 - Zalathar:unreachable, r=cjgillotbors-1/+5
Skip MIR pass `UnreachablePropagation` when coverage is enabled When coverage instrumentation and MIR opts are both enabled, coverage relies on two assumptions: - MIR opts that would delete `StatementKind::Coverage` statements instead move them into bb0 and change them to `CoverageKind::Unreachable`. - MIR opts won't delete all `CoverageKind::Counter` statements from an instrumented function. Most MIR opts naturally satisfy the second assumption, because they won't remove coverage statements from bb0, but `UnreachablePropagation` can do so if it finds that bb0 is unreachable. If this happens, LLVM thinks the function isn't instrumented, and it vanishes from coverage reports. A proper solution won't be possible until after per-function coverage info lands in #116046, but for now we can avoid the problem by turning off this particular pass when coverage instrumentation is enabled. --- cc `@cjgillot` since I found this while investigating coverage problems encountered by #113970 `@rustbot` label +A-code-coverage +A-mir-opt
2023-09-27Auto merge of #116189 - weihanglo:update-cargo, r=weihanglobors-2/+2
Update cargo 11 commits in 414d9e3a6d8096f3e276234ce220c868767a8792..e6aabe8b3fcf639be3a5bf68e77853bd7b3fa27d 2023-09-22 07:03:57 +0000 to 2023-09-26 16:31:53 +0000 - Use full target spec for `cargo rustc --print --target` (rust-lang/cargo#12743) - feat(embedded): Hack in code fence support (rust-lang/cargo#12681) - chore(ci): Update Renovate schema (rust-lang/cargo#12741) - more specific registry index not found msg (rust-lang/cargo#12732) - docs: warn about upload timeout (rust-lang/cargo#12733) - Fix some typos (rust-lang/cargo#12730) - upgrade gitoxide to v0.54 (rust-lang/cargo#12731) - Update target-arch-aware crates to support mips r6 targets (rust-lang/cargo#12720) - Buffer console status messages. (rust-lang/cargo#12727) - Fix spurious errors with networking tests. (rust-lang/cargo#12726) - refactor(SourceId): merge `name` and `alt_registry_key` into one enum (rust-lang/cargo#12675) r? ghost
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-189/+128
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2023-09-27Update cargoWeihang Lo-2/+2
New license exceptions from gix: * (byteyarn", "Apache-2.0") * ("encoding_rs", "(Apache-2.0 OR MIT) AND BSD-3-Clause")
2023-09-27Auto merge of #116156 - oli-obk:opaque_place_unwrap, r=compiler-errorsbors-1/+37
Only prevent field projections into opaque types, not types containing opaque types fixes https://github.com/rust-lang/rust/issues/115778 I did not think that original condition through properly... I'll also need to check the similar check around the other `ProjectionKind::OpaqueCast` creation site (this one is in hir, the other one is in mir), but I'll do that change in another PR that doesn't go into a beta backport.
2023-09-26Add context to `let: Ty = loop { break };`Esteban Küber-5/+23
We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-75/+66
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26add testMilo-0/+18
fix tidy remove dir
2023-09-26Auto merge of #116102 - cjgillot:indirect-scalar, r=oli-obkbors-12/+11
Correct codegen of `ConstValue::Indirect` scalar and scalar pair This concerns 3 tricky cases with `ConstValue::Indirect`: - if we want a non-pointer scalar; - if we have non-zero offset; - if offset points to uninit memory => generate `poison` instead of an ICE. This case could happen in unreachable code, trying to extract a field from the wrong variant. Those cases are not currently emitted by the compiler, but are exercised by https://github.com/rust-lang/rust/pull/116012.
2023-09-26Anonymize binders for refining_impl_trait checkMichael Goulet-4/+38
2023-09-26Auto merge of #116154 - cjgillot:retain-cfg, r=oli-obkbors-19/+24
Use Vec::retain in remove_dead_blocks. r? `@ghost`
2023-09-26Explicit simplify_place.Camille GILLOT-8/+19
2023-09-26Auto merge of #116175 - matthiaskrgr:rollup-cwteiwy, r=matthiaskrgrbors-27/+131
Rollup of 5 pull requests Successful merges: - #116099 (Add regression test for issue #79865) - #116131 (Rename `cold_path` to `outline`) - #116151 (Fix typo in rustdoc unstable features doc) - #116153 (Update books) - #116162 (Gate and validate `#[rustc_safe_intrinsic]`) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-26Rollup merge of #116162 - fmease:gate-n-validate-rustc_safe_intrinsic, ↵Matthias Krüger-11/+79
r=Nilstrieb Gate and validate `#[rustc_safe_intrinsic]` Copied over from #116159: > This was added as ungated in https://github.com/rust-lang/rust/pull/100719/files#diff-09c366d3ad3ec9a42125253b610ca83cad6b156aa2a723f6c7e83eddef7b1e8fR502, probably because the author looked at the surrounding attributes, which are ungated because they are gated specially behind the staged_api feature. > > I don't think we need to crater this, the attribute is entirely useless without the intrinsics feature, which is already unstable.. r? ``@Nilstrieb``
2023-09-26Rollup merge of #116153 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-embedded/book 1 commits in 99ad2847b865e96d8ae7b333d3ee96963557e621..eac173690b8cc99094e1d88bd49dd61127fbd285 2023-09-12 07:34:44 UTC to 2023-09-12 07:34:44 UTC - USB connector-type correction (rust-embedded/book#360) ## rust-lang/nomicon 1 commits in e3f3af69dce71cd37a785bccb7e58449197d940c..ddfa4214487686e91b21aa29afb972c08a8f0d5b 2023-09-22 17:04:10 UTC to 2023-09-22 17:04:10 UTC - Fill "Beneath `std`" (rust-lang/nomicon#413) ## rust-lang/reference 1 commits in ee7c676fd6e287459cb407337652412c990686c0..5262e1c3b43a2c489df8f6717683a44c7a2260fd 2023-09-18 18:28:31 UTC to 2023-09-18 18:28:31 UTC - we reserve the right to reduce our amount of UB (rust-lang/reference#1397) ## rust-lang/rustc-dev-guide 8 commits in 08bb147d51e815b96e8db7ba4cf870f201c11ff8..a13b7c28ed705891c681ce5417b3d1cdb12cecd1 2023-09-25 05:14:41 UTC to 2023-09-11 21:29:18 UTC - Clarify all the `{AP,RP}IT{,IT}` impl trait types (rust-lang/rustc-dev-guide#1798) - Modify build instructions for optimized build (rust-lang/rustc-dev-guide#1795) - Remove outdated references to coverage debug code (rust-lang/rustc-dev-guide#1797) - Add deep dive document about early/late bound parameters interacting with turbofish (rust-lang/rustc-dev-guide#1794) - explain the MIR const vs TY const situation (rust-lang/rustc-dev-guide#1793) - fix type name (rust-lang/rustc-dev-guide#1792) - Clarify that `run-coverage` only runs in some of the CI jobs (rust-lang/rustc-dev-guide#1791) - Document the `coverage-map` and `run-coverage` test suites (rust-lang/rustc-dev-guide#1790)
2023-09-26Rollup merge of #116151 - DaniPopes:rustdoc-unstable-typo, r=fmeaseMatthias Krüger-1/+1
Fix typo in rustdoc unstable features doc
2023-09-26Rollup merge of #116131 - Zoxc:cold-path-rename, r=oli-obkMatthias Krüger-15/+13
Rename `cold_path` to `outline` I find this name to be a bit more descriptive. r? ``@oli-obk``
2023-09-26Rollup merge of #116099 - eduardosm:issue-79865-regression, r=oli-obkMatthias Krüger-0/+38
Add regression test for issue #79865 Closes https://github.com/rust-lang/rust/issues/79865
2023-09-26Auto merge of #115893 - RalfJung:match-require-partial-eq, r=oli-obkbors-11/+139
lint towards rejecting consts in patterns that do not implement PartialEq I think we definitely don't want to allow such consts, so even while the general plan around structural matching is up in the air, we can start the process of getting non-PartialEq matches out of the ecosystem.
2023-09-26Auto merge of #116109 - Zoxc:no-dep-graph-thread, r=oli-obkbors-118/+68
Don't use a thread to load the dep graph This removes the use of a thread to load the dep graph. It's not currently useful as we immediately block on it. r? `@oli-obk`
2023-09-26Skip MIR pass `UnreachablePropagation` when coverage is enabledZalathar-1/+5
When coverage instrumentation and MIR opts are both enabled, coverage relies on two assumptions: - MIR opts that would delete `StatementKind::Coverage` statements instead move them into bb0 and change them to `CoverageKind::Unreachable`. - MIR opts won't delete all `CoverageKind::Counter` statements from an instrumented function. Most MIR opts naturally satisfy the second assumption, because they won't remove coverage statements from bb0, but `UnreachablePropagation` can do so if it finds that bb0 is unreachable. If this happens, LLVM thinks the function isn't instrumented, and it vanishes from coverage reports. A proper solution won't be possible until after per-function coverage info lands in #116046, but for now we can avoid the problem by turning off this particular pass when coverage instrumentation is enabled.
2023-09-26subst -> instantiatelcnr-75/+66
2023-09-26Auto merge of #116139 - flip1995:clippyup, r=Manishearthbors-2324/+3995
Clippy subtree update r? `@Manishearth`
2023-09-26Auto merge of #116125 - RalfJung:const-param-ty-eq, r=compiler-errorsbors-6/+44
ConstParamTy: require Eq as supertrait As discussed with `@BoxyUwu` [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/.60ConstParamTy.60.20and.20.60Eq.60). We want to say that valtree equality on const generic params agrees with `==`, but that only makes sense if `==` actually exists, hence we should have an appropriate bound. Valtree equality is an equivalence relation, so such a type can always be `Eq` and not just `PartialEq`.
2023-09-26Auto merge of #116124 - WaffleLapkin:fix-proc-macro-literal-to-string, ↵bors-1/+158
r=compiler-errors Properly print cstr literals in `proc_macro::Literal::to_string` Previously we printed the contents of the string, rather than the actual string literal (e.g. `the c string` instead of `c"the c string"`). Fixes #112820 cc #105723
2023-09-26Don't store lazyness in DefKindMichael Goulet-189/+128