about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
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-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`
2023-07-28Rollup merge of #114138 - compiler-errors:bad-rcvr-span-on-method-sugg, ↵Matthias Krüger-2/+27
r=estebank Adjust spans correctly for fn -> method suggestion Fixes #114131
2023-07-28Rollup merge of #114128 - estebank:delayed-span-bug-dump, r=davidtwcoMatthias Krüger-3/+3
When flushing delayed span bugs, write to the ICE dump file even if it doesn't exist Fix #113881.
2023-07-28Rollup merge of #114099 - ↵Matthias Krüger-2/+202
davidtwco:issue-113860-staged-api-effective-vis-gt-nominal-vis-when-trait-method-vis, r=petrochenkov privacy: no nominal visibility for assoc fns Fixes #113860. When `staged_api` is enabled, effective visibilities are computed earlier and this can trigger an ICE in some cases. In particular, if a impl of a trait method has a visibility then an error will be reported for that, but when privacy invariants are being checked, the effective visibility will still be greater than the nominal visbility and that will trigger a `span_bug!`. However, this invariant - that effective visibilites are limited to nominal visibility - doesn't make sense for associated functions.
2023-07-28Auto merge of #113931 - cuviper:ci-ubuntu-22.04, r=Mark-Simulacrumbors-264/+493
ci: update ubuntu:20.04 builders to 22.04 This is mostly just maintenance to avoid bitrotting, but 22.04 also updates to cmake 3.22, so they don't need the manual builds from #113714 anymore.
2023-07-28Auto merge of #111780 - weiznich:diagnostic_namespace, r=petrochenkovbors-4/+202
Diagnostic namespace This PR implements the basic infrastructure for accepting the `#[diagnostic]` attribute tool namespace as specified in https://github.com/rust-lang/rfcs/pull/3368. Note: This RFC is not merged yet, but it seems like it will be accepted soon. I open this PR early on to get feedback on the actual implementation as soon as possible. This hopefully enables getting at least the diagnostic namespace to stable rust "soon", so that crates do not need to bump their MSRV if we stabilize actual attributes in this namespace. This PR only adds infrastructure accept attributes from this namespace, it does not add any specific attribute. Therefore the compiler will emit a lint warning for each attribute that's actually used. This namespace is added behind a feature flag, so it will be only available on a nightly compiler for now. cc `@estebank` as they've supported me in planing, specifying and implementing this feature.
2023-07-28privacy: no nominal visibility for assoc fnsDavid Wood-2/+202
When `staged_api` is enabled, effective visibilities are computed earlier and this can trigger an ICE in some cases. In particular, if a impl of a trait method has a visibility then an error will be reported for that, but when privacy invariants are being checked, the effective visibility will still be greater than the nominal visbility and that will trigger a `span_bug!`. However, this invariant - that effective visibilites are limited to nominal visibility - doesn't make sense for associated functions. Signed-off-by: David Wood <david@davidtw.co>
2023-07-28Auto merge of #114119 - nnethercote:opt-TokenKind-clone, r=petrochenkovbors-1/+16
Optimize `TokenKind::clone`. `TokenKind` would impl `Copy` if it weren't for `TokenKind::Interpolated`. This commit makes `clone` reflect that. r? `@ghost`
2023-07-28Fix switch-stdout test for none unix/windows platformsRaoul Strackx-1/+1
2023-07-28Introduce the `#[diagnostic]` attribute namespaceGeorg Semmler-4/+202
Co-authored-by: est31 <est31@users.noreply.github.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-07-28Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnrbors-20/+146
discard default auto trait impls if explicit ones exist (rebase of #85048) Rebase of #85048
2023-07-28Change the description of `SUSPICIOUS_AUTO_TRAIT_IMPLS`Oleksandr Babak-3/+3
2023-07-28Add regression test for `--cap-lints allow` and trait bounds warningMartin Nordholts-0/+8
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-28Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obkbors-1057/+419
Remove `constness` from `ParamEnv` This should be replaced by keyword generics/effects. cc #110395 r? `@oli-obk`
2023-07-28Auto merge of #114154 - calebcartwright:style-match-mac, r=joshtriplettbors-1/+6
style-guide: don't flatten match arms with macro call This pulls forward the gist of the text that was added to the style guide in https://github.com/rust-lang/style-team/pull/159 to account for needing to tweak/soften rustfmt's behavior based on the style guide prescriptions. There were a few options I considered, noted below, and although I don't particularly love any of them, I felt this was the lesser of the evils. r? `@joshtriplett`
2023-07-28Auto merge of #112390 - MoskalykA:move-two-tests-from-library-to-tests, ↵bors-37/+17
r=workingjubilee Move two tests from `tests/ui/std` to `library/std/tests` Hi, there, This pull request comes from this issue (#99417), sorry I made some mistakes creating the pull request, it's my first one.
2023-07-28Auto merge of #97571 - ehuss:symbol-mangling, r=michaelwoeristerbors-2/+1283
Add documentation on v0 symbol mangling. This adds official documentation for the v0 symbol mangling format, migrating the documentation from [RFC 2603](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html). The format was originally stabilized as the `-C symbol-mangling-version` option, but the specifics were not stabilized (per https://github.com/rust-lang/rust/pull/90128#issuecomment-948569123). Per the discussion at https://github.com/rust-lang/rust/pull/93661#discussion_r799783363 this adds those specifics as an official description of the format. cc #89917
2023-07-28Replace a lazy `RefCell<Option<T>>` with `OnceCell<T>`Zalathar-4/+3
2023-07-27docs(style-guide): don't flatten match arms with macro callCaleb Cartwright-1/+6
2023-07-28Auto merge of #114115 - nnethercote:less-token-tree-cloning, r=petrochenkovbors-90/+83
Less `TokenTree` cloning `TokenTreeCursor` has this comment on it: ``` // FIXME: Many uses of this can be replaced with by-reference iterator to avoid clones. ``` This PR completes that FIXME. It doesn't have much perf effect, but at least we now know that. r? `@petrochenkov`
2023-07-27Auto merge of #108980 - Enselic:println-and-broken-pipe, r=workingjubileebors-0/+47
Regression test `println!()` panic message on `ErrorKind::BrokenPipe` No existing test (that I could find) failed if the `panic!()` of the `println!()` family of functions was removed, or if its message was changed: https://github.com/rust-lang/rust/blob/104f4300cfddbd956e32820ef202a732f06ec848/library/std/src/io/stdio.rs#L1007-L1009 So add such a test. This is in preparation of adding a hint about the existence of [`unix_sigpipe`](https://github.com/rust-lang/rust/issues/97889) if that is the reason for the panic. Even if we don't end up adding a hint, this is still a sensible test to have, I think. `@rustbot` label +A-testsuite +A-io +T-libs +O-unix
2023-07-27Add additional testMichael Goulet-0/+44
2023-07-27Insert RPITITs that were shadowed by missing ADTs that resolve to type errorMichael Goulet-4/+49
2023-07-27tighten span slightly for synthetic itemMichael Goulet-4/+12
2023-07-27Skip reporting item name when checking RPITIT GAT's associated type bounds holdMichael Goulet-6/+67
2023-07-27Auto merge of #114144 - workingjubilee:rollup-jkmtgdo, r=workingjubileebors-4338/+41
Rollup of 4 pull requests Successful merges: - #97571 (Add documentation on v0 symbol mangling.) - #114122 (tests/ui/hello_world/main.rs: Remove FIXME (#62277)) - #114133 (Revert "add tidy check that forbids issue ui test filenames") - #114139 (Make `--print` with path unstable) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-27Rollup merge of #114139 - Urgau:make-print-with-path-unstable, r=jackh726Jubilee-8/+34
Make `--print` with path unstable https://github.com/rust-lang/rust/pull/113780 should have gone through an MCP+FCP but wasn't, but instead of reverting the original PR, this PR just make that new option unstable. [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202023-07-27/near/379199738) cc `@dtolnay`
2023-07-27Rollup merge of #114133 - workingjubilee:revert-add-tidy-check-issue-12345, ↵Jubilee-4329/+6
r=jackh726 Revert "add tidy check that forbids issue ui test filenames" This reverts commit 13e2abf6b388762af2e97ce065d6206961264a8f. Reverting because an MCP was requested and it turned out there was a lack of a consensus on what to do in this area.
2023-07-27Rollup merge of #114122 - Enselic:hello-build-pass, r=petrochenkovJubilee-1/+1
tests/ui/hello_world/main.rs: Remove FIXME (#62277) The purpose of the test is to make sure that compiling hello world produces no compiler output. To properly test that, we need to run the entire compiler pipeline. We don't want the test to pass if codegen accidentally starts writing to stdout. So keep it as build-pass. Part of #62277
2023-07-27Auto merge of #113779 - Kobzol:try-build-no-lto, r=Mark-Simulacrumbors-1/+31
Build the first LLVM without LTO in try builds Currently, we perform three LLVM builds in the Linux x64 dist builder, which is used for `try` builds: 1) "Normal" LLVM - takes ~5s to compile thanks to `sccache`, but ~8 minutes to link because of ThinLTO 2) PGO instrumented LLVM - same timings as 1) 3) PGO optimized LLVM - takes about 20 minutes to build When I tried to disable LTO for build 1), it suddenly takes only about a minute to build, because the linking step is much faster. The first LLVM doesn't really need LTO all that much. Without it, it will be a bit slower to build `rustc` in two subsequent steps, but it seems that the ~7 minutes saved on linking it do win that back. Btw, we can't use the host LLVM for build 1), because this LLVM then builds `rustc` in PGO instrumented mode, and we need the same compiler when later PGO optimizing `rustc`. And we want to use our in-house LLVM for that I think.
2023-07-27Dont report CTFE errors that are due to references-error layoutsMichael Goulet-1/+4
2023-07-27Fix aksama templateMichael Goulet-0/+5