about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-30Auto merge of #2997 - RalfJung:test-utils, r=RalfJungbors-112/+77
refactor tests/utils a bit, and move some FS functions there
2023-07-30refactor tests/utils a bit, and move some FS functions thereRalf Jung-112/+77
2023-07-30Auto merge of #2996 - rust-lang:rustup-2023-07-30, r=oli-obkbors-8052/+9103
Automatic sync from rustc
2023-07-30fmtThe Miri Conjob Bot-1/+1
2023-07-30Merge from rustcThe Miri Conjob Bot-8051/+9102
2023-08-03Reduce arbitrary self type suggestionsr0cky-32/+15
2023-08-03Avoid too many expected symbols and reduce `None`sr0cky-64/+58
2023-08-03Apply suggestionsr0cky-2/+4
2023-08-03Fix rustfmt depMu001999-1/+1
2023-08-03Keep the suggestion for wrong arbitrary self typesMu001999-80/+133
2023-08-01Suggests turbofish in patternsMu001999-50/+101
2023-07-30Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-07-29Auto merge of #113704 - compiler-errors:rpitit-assumed-wf-inherit, r=spastorinobors-117/+151
Make RPITITs inherit the `assumed_wf_types` of their parent method ... and then move the RPITIT well-formedness check to just use the regular logic of wfchecking an associated type. --- We need to inherit the `assumed_wf_types` of the RPITIT's parent function in order for the given code to be considered well-formed: ```rust trait Foo { fn bar<'a, T>(_: &'a T) -> impl Iterator<Output = &'a T>; } ``` Since for `&'a T` to be WF, we need `T: 'a`. In order for this to work for late-bound lifetimes, we need to do some additional mapping of any late-bound lifetimes captured by these assumed wf types. This is because within the body of the function (and thus in the `assumed_wf_types`), they're represented as `ReFree` variants of the original late-bound lifetimes declared in the function's generics, but in the RPITIT's GAT, they're represented as "reified" `ReEarlyBound` vars (duplicated during opaque type lowering). Luckily, the mapping between these two is already [stored in the opaque](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.OpaqueTy.html#structfield.lifetime_mapping). Fixes #113796
2023-07-29some nits, bless testMichael Goulet-21/+29
2023-07-29Implement assumed_wf_types for RPITITs' implementationsMichael Goulet-33/+102
2023-07-29Take RPITITs inherit the assumed_wf_types of their parent fnMichael Goulet-100/+57
2023-07-29Auto merge of #114211 - RalfJung:miri, r=RalfJungbors-233/+336
update Miri r? `@ghost`
2023-07-29Auto merge of #114156 - calebzulawski:simd-bswap, r=compiler-errorsbors-25/+173
Add simd_bswap, simd_bitreverse, simd_ctlz, and simd_cttz intrinsics cc `@workingjubilee`
2023-07-29Auto merge of #2993 - Vanille-N:tb-protector, r=RalfJungbors-151/+264
TB: Redefine trigger condition for protectors The Coq formalization revealed that as currently implemented, read accesses did not always commute. Indeed starting from a lazily initialized `Active` protected tag, applying a foreign read then a child read produces `Frozen`, but child read then foreign read triggers UB (because the child read initializes _before_ the `Active -> Frozen`). This reformulation of when protectors trigger fixes that issue: - instead of `Active + foreign read -> Frozen` and `Active -> Frozen` when protected is UB - we do `Active + foreign read -> if protected { Disabled } else { Frozen }` There is already precedent for transitions being dependent on the presence of a protector (`Reserved + foreign read -> if protected { Frozen } else { Reserved }`), and this has the nice side-effect of simplifying the protector trigger condition to just an equality check against `Disabled` since now there is protector UB iff a protected tag becomes `Disabled`. In order not to introduce an extra `if`, it was decided that `Disabled -> Disabled` would be UB when protected, which was not the case previously. This is merely a theoretical for now because a protected `Disabled` is unreachable in the first place. The extra test is not directly related to this modification, but also checks things related to protectors and lazy initialization.
2023-07-29Auto merge of #114028 - Centri3:ternary-operator, r=compiler-errorsbors-2/+241
Gracefully handle ternary operator Fixes #112578 ~~May not be the best way to do this as it doesn't check for a single `:`, so it could perhaps appear even when the actual issue is just a missing semicolon. May not be the biggest deal, though?~~ Nevermind, got it working properly now ^^
2023-07-29doc comment suggestionsNeven Villani-25/+57
2023-07-29Auto merge of #114148 - cuviper:drop-llvm-14, r=nikicbors-472/+293
Update the minimum external LLVM to 15 With this change, we'll have stable support for LLVM 15 through 17 (pending release). For reference, the previous increase to LLVM 14 was #107573.
2023-07-29Auto merge of #114150 - clubby789:improve-option-ref-suggestion, r=WaffleLapkinbors-74/+153
Refactor + improve diagnostics for `&mut T`/`T` mismatch inside Option/Result Follow up to #114052. This also makes the diagnostics structured + translatable. r? `@WaffleLapkin`
2023-07-29Auto merge of #114141 - Kobzol:llvm-bolt-flags, r=lqdbors-0/+2
Change LLVM BOLT flags I talked to the BOLT maintainers about the binary size effect of BOLT. Currently, BOLTing LLVM increases its binary size from ~120 MiB to ~170 MiB, which is not ideal. Now we can track both runtime performance and (rustc, LLVM, ...) artifact sizes in perf.RLO, so I'd like to try experimenting with changing the flags to reduce `libLLVM.so` size without regressing the performance gains of BOLT too much. r? `@ghost`
2023-07-29Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstriebbors-45/+42
Rename and allow `cast_ref_to_mut` lint This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`). BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged. r? `@Nilstrieb`
2023-07-29Auto merge of #113099 - bvanjoi:fix-112713-2, r=petrochenkovbors-58/+1535
fix(resolve): update the ambiguity glob binding as warning recursively Fixes #47525 Fixes #56593, but `issue-56593-2.rs` is not fixed to ensure backward compatibility. Fixes #98467 Fixes #105235 Fixes #112713 This PR had added a field called `warn_ambiguous` in `NameBinding` which is only for back compatibly reason and used for lint. More details: https://github.com/rust-lang/rust/pull/112743 r? `@petrochenkov`
2023-07-29Auto merge of #114197 - matthiaskrgr:rollup-iluf7u4, r=matthiaskrgrbors-78/+69
Rollup of 7 pull requests Successful merges: - #113773 (Don't attempt to compute layout of type referencing error) - #114107 (Prevent people from assigning me as a PR reviewer) - #114124 (tests/ui/proc-macro/*: Migrate FIXMEs to check-pass) - #114171 (Fix switch-stdout test for none unix/windows platforms) - #114172 (Fix issue_15149 test for the SGX target) - #114173 (btree/map.rs: remove "Basic usage" text) - #114174 (doc: replace wrong punctuation mark) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-29Rollup merge of #114174 - tshepang:patch-6, r=workingjubileeMatthias Krüger-1/+1
doc: replace wrong punctuation mark
2023-07-29Rollup merge of #114173 - tshepang:patch-1, r=workingjubileeMatthias Krüger-54/+0
btree/map.rs: remove "Basic usage" text Not useful, for there is just a single example
2023-07-29Rollup merge of #114172 - fortanix:raoul/fix_process-spawning_test, ↵Matthias Krüger-0/+2
r=workingjubilee Fix issue_15149 test for the SGX target PR https://github.com/rust-lang/rust/pull/112390 moved tests to std. Unfortunately, this caused the `issue_15149` test to be enabled for the SGX target. This is incorrect as the SGX target does not support the `env::current_exe()` call.
2023-07-29Rollup merge of #114171 - fortanix:raoul/fix_switch-stdout_test, ↵Matthias Krüger-1/+1
r=workingjubilee Fix switch-stdout test for none unix/windows platforms PR #112390 moved tests to std. Unfortunately, there is a typo which causes issues on platforms other than unix and windows.
2023-07-29Rollup merge of #114124 - Enselic:proc-fixme, r=cjgillotMatthias Krüger-8/+8
tests/ui/proc-macro/*: Migrate FIXMEs to check-pass proc-macros are processed early in the compiler pipeline. There is no need to involve codegen. So change to check-pass. I have also looked through each changed test and to me it is sufficiently clear that codegen is not needed for the purpose of the test. I skipped changing `tests/ui/proc-macro/no-missing-docs.rs` in this commit because it was not clear to me that it can be changed to check-pass. Part of #62277
2023-07-29Rollup merge of #114107 - jyn514:vacation, r=ehussMatthias Krüger-0/+1
Prevent people from assigning me as a PR reviewer depends on https://github.com/rust-lang/triagebot/pull/1712
2023-07-29Rollup merge of #113773 - compiler-errors:err-layout-bail, r=cjgillotMatthias Krüger-14/+56
Don't attempt to compute layout of type referencing error Leads to more ICEs and strange diagnostics than are worth it. Fixes #113760
2023-07-29Auto merge of #111916 - fee1-dead-contrib:noop-method-call-warn, ↵bors-104/+161
r=compiler-errors make `noop_method_call` warn by default r? `@compiler-errors`
2023-07-28Auto merge of #114181 - matthiaskrgr:rollup-14m8s7f, r=matthiaskrgrbors-23/+413
Rollup of 7 pull requests Successful merges: - #114099 (privacy: no nominal visibility for assoc fns ) - #114128 (When flushing delayed span bugs, write to the ICE dump file even if it doesn't exist) - #114138 (Adjust spans correctly for fn -> method suggestion) - #114146 (Skip reporting item name when checking RPITIT GAT's associated type bounds hold) - #114147 (Insert RPITITs that were shadowed by missing ADTs that resolve to [type error]) - #114155 (Replace a lazy `RefCell<Option<T>>` with `OnceCell<T>`) - #114164 (Add regression test for `--cap-lints allow` and trait bounds warning) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-28Auto merge of #113522 - fmease:generic-consts, r=cjgillotbors-360/+1645
Implement generic const items This implements generic parameters and where-clauses on free and associated const items under the experimental feature gate `generic_const_items`. See rust-lang/lang-team#214. Tracking issue: #113521. Fixes #104400. This PR doesn't include rustfmt support as per [nightly style procedure](https://github.com/rust-lang/style-team/blob/master/nightly-style-procedure.md) and it doesn't add rustdoc JSON support (see [related Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Rustdoc.20JSON.3A.20Experimental.20rustc.20features)). CC `@scottmcm` `@compiler-errors` `@WalterSmuts` r? `@oli-obk` <details><summary>Resolved Questions</summary> * Q: Should `const ADD<const N: usize, const M: usize>: usize = N + M; ADD::<0, 1>` trigger the error *generic parameters may not be used in const operations* (which can be unlocked with `#![feature(generic_const_exprs)]`). Currently it doesn't. Or does this fall under [this paragraph](https://github.com/rust-lang/rust/blob/71f71a5397c42fec01f5c1045c638d961fa9f7ca/compiler/rustc_resolve/src/late.rs#L191)? * A: No, https://github.com/rust-lang/rust/pull/113522#issuecomment-1628634092 * Q: Should `const UNUSED: () = () where String: Copy;` (with `#![feature(trivial_bounds)]` and with `UNUSED` unused) succeed compilation? Currently it doesn't: *evaluation of constant value failed // entering unreachable code* * A: Yes, but postponed until stabilization (latest), https://github.com/rust-lang/rust/pull/113522#issuecomment-1628634092 </details>
2023-07-28Add rustdoc tests for generic const itemsLeón Orell Valerian Liehr-0/+86
2023-07-28Update existing UI testsLeón Orell Valerian Liehr-38/+69
2023-07-28Add UI tests for generic const itemsLeón Orell Valerian Liehr-1/+826
2023-07-28Render generic const items in rustdocLeón Orell Valerian Liehr-69/+116
2023-07-28Make Clippy understand generic const itemsLeón Orell Valerian Liehr-7/+15
2023-07-28Type-check generic const itemsLeón Orell Valerian Liehr-103/+122
2023-07-28Resolve generic const itemsLeón Orell Valerian Liehr-69/+109
2023-07-28Lower generic const items to HIRLeón Orell Valerian Liehr-41/+84
2023-07-28Parse generic const itemsLeón Orell Valerian Liehr-34/+220
2023-07-28Rollup merge of #114164 - Enselic:lint-cap-trait-bounds, r=compiler-errorsMatthias Krüger-0/+8
Add regression test for `--cap-lints allow` and trait bounds warning Closes #43134 I have verified that the test fails if stderr begins to contain output by making sure the test fails when I add eprintln!("some output on stderr"); to the compiler (I added it to `fn build_session()`).
2023-07-28Rollup merge of #114155 - Zalathar:once-cell, r=lcnrMatthias Krüger-4/+3
Replace a lazy `RefCell<Option<T>>` with `OnceCell<T>` This code was using `RefCell<Option<T>>` to manually implement lazy initialization. Now that we have `OnceCell` in the standard library, we can just use that instead. In particular, this avoids a confusing doubly-nested option, because the value being lazily computed is itself an `Option<Symbol>`.
2023-07-28Rollup merge of #114147 - compiler-errors:missing-rpitits, r=spastorinoMatthias Krüger-4/+49
Insert RPITITs that were shadowed by missing ADTs that resolve to [type error] Comment inline explains how this can happen. Fixes #113903
2023-07-28Rollup merge of #114146 - compiler-errors:dont-report-rpitit-name, r=spastorinoMatthias Krüger-8/+121
Skip reporting item name when checking RPITIT GAT's associated type bounds hold Doesn't really make sense to label an item that has a name that users can't really mention. Fixes #114145. Also fixes #113794. r? `@spastorino`