about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-07-06Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-deadbors-13/+25
Rollup of 9 pull requests Successful merges: - #111119 (style-guide: Add chapter about formatting for nightly-only syntax) - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`) - #113145 (style-guide: Document newline rules for assignment operators) - #113163 (Add a regression test for #112895) - #113332 (resolve: Use `Interned` for some interned structures) - #113334 (Revert the lexing of `c"…"` string literals) - #113350 (Fix the issue of wrong diagnosis for extern pub fn) - #113371 (Fix submodule handling when the current branch is named after a tag) - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change)) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-06Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errorsfee1-dead-11/+12
style-guide: Clarify grammar for small patterns (not a semantic change) The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes. Also rename "smallntp" to "small_no_tuple" to make it self-describing.
2023-07-06Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68fee1-dead-0/+3
Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output.
2023-07-06Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errorsfee1-dead-0/+1
Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated
2023-07-06Rollup merge of #113145 - ↵fee1-dead-2/+3
joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett style-guide: Document newline rules for assignment operators The style guide gives general rules for binary operators including assignment, and one of those rules says to put the operator on the subsequent line; the style guide needs to explicitly state the exception of breaking *after* assignment operators rather than before. This is already what rustfmt does and what users do; this fixes the style guide to match the expected default style.
2023-07-06Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJungbors-3/+4
Specialize `try_destructure_mir_constant` for its sole user (pretty printing) We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval. r? `@RalfJung` for a first round. While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.
2023-07-05style-guide: Expand example of combinable expressions to include arraysJosh Triplett-0/+10
Arrays are allowed as combinable expressions, but none of the examples show that.
2023-07-05style-guide: Fix chain example to match rustfmt behaviorJosh Triplett-4/+3
The style guide gave an example of breaking a multi-line chain element and all subsequent elements to a new line, but that same example and the accompanying text also had several chain items stacked on the first line. rustfmt doesn't do this, except when the rule saying to combine ``` shrt .y() ``` into ``` shrt.y() ``` applies.
2023-07-06Fix LLVM config path on WindowsJakub Beránek-1/+1
2023-07-05style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarityJosh Triplett-4/+4
The meaning of "smallntp" was not immediately obvious at a glance. Rename it to the self-describing "small_no_tuple"
2023-07-05style-guide: Clarify grammar for small patterns (not a semantic change)Josh Triplett-11/+12
The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes.
2023-07-05fix: handle skip_macro_invocations from config fileCaleb Cartwright-2/+12
2023-07-05style-guide: Add chapter for nightly formattingJosh Triplett-3/+5
Co-authored-by: Michael Goulet <michael@errs.io>
2023-07-05Clarify that style guide does not cover nightly-only featuresMichael Goulet-0/+4
2023-07-05C "memcpy" shim: ensure the pointers are validRalf Jung-0/+108
Also add tests for some other shims that already behave correctly
2023-07-05style-guide: Add section on bugs, and resolving bugsJosh Triplett-0/+13
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-31/+35
2023-07-05allow mixing `llvm.assertions` and `download-rustc`jyn-22/+22
by using `rustc-builds-alt` if download-rustc is set this also changes the download code to use a separate build/cache/ directory and .rustc-stamp stamp file depending on whether assertions are enabled.
2023-07-05Patch clippyOli Scherer-3/+4
2023-07-05fix `x test --stage 0 core`jyn-1/+1
2023-07-05check ci-rustc optionsjyn-3/+39
2023-07-05Make `--dry-run` more useful when download-rustc is enabledjyn-2/+6
Previously, it would always treat download-rustc as set to false, which made bootstrap issues with download-rustc hard to debug.
2023-07-05Fix submodule handling when the current branch is named after a tagjyn-0/+3
If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output.
2023-07-05Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obkMichael Goulet-1/+6
Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.
2023-07-05Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obkMichael Goulet-2/+2
Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of #113325, only the second and third commits needs reviewing
2023-07-05Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonurMichael Goulet-886/+879
rust-installer & rls: remove exclusion from rustfmt & tidy <strike>based on #112884</strike> `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them.
2023-07-05Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.Havard Eidnes-1/+6
2023-07-05Revert "use c literals in library"León Orell Valerian Liehr-0/+1
This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.
2023-07-05Deal with falloutBoxy-2/+2
2023-07-05Auto merge of #112697 - tgross35:explain-markdown, r=oli-obkbors-0/+5
Add simple markdown formatting to `rustc --explain` output This is a second attempt at #104540, which is #63128 without dependencies. This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`) <img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee"> After this patch, sample output from the same file: <img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9"> This also obeys the `--color always/auto/never` command option. Behavior: - If pager is available and supports color, print with formatting to the pager - If pager is not available or fails print with formatting to stdout - otherwise without formatting - Follow `--color always/never` if suppied - If everything fails, just print plain text to stdout r? `@oli-obk` cc `@estebank` (since the two of you were involved in the previous discussion)
2023-07-04Auto merge of #113330 - matthiaskrgr:rollup-zm3owin, r=matthiaskrgrbors-32/+32
Rollup of 5 pull requests Successful merges: - #113192 (`assemble_candidates_after_normalizing_self_ty` docs) - #113251 (Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures) - #113282 (Update platform-support.md to improve ARM target descriptions) - #113296 (add flag for enabling global cache usage for proof trees and printing proof trees on error) - #113324 (implement `ConstEvaluatable` goals in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-04Copy stage0 `rustc` binaries to `stage0-sysroot`Jakub Beránek-0/+43
2023-07-04Auto merge of #113274 - workingjubilee:demote-mips, r=jyn514bors-12/+0
Remove `mips*-unknown-linux-gnu*` builders Pursuant to the current consensus in https://github.com/rust-lang/compiler-team/issues/648
2023-07-04fix typoklensy-1/+1
2023-07-04bootstrap: rust-installer no loger subtree, so allow running lints over itklensy-1/+1
2023-07-04tidy: exclude sh files from rust-installer tests from tidy bins checkklensy-1/+25
2023-07-04Rollup merge of #113282 - jonathanpallant:update-arm-target-descriptions, ↵Matthias Krüger-32/+32
r=JohnTitor Update platform-support.md to improve ARM target descriptions Updates the descriptions of the various ARM targets in platform-support.md so they are a little more consistent. For example, all instances of ARMv7 are changed to ARMv7-A (as opposed to ARMv7-R and ARMv7-M). I also remove the Cortex-Mx CPUs on the thumbv6/7m targets, as most of the other targets refer only to CPU architectures and not specific CPUs (and the list was missing on thumbv8m anyway, so this is more consistent).
2023-07-04fix bash long lines and replace TODO with FIXMEklensy-11/+18
2023-07-04replace tabs with 4 spaces in .shklensy-804/+804
2023-07-04rust-installer and rls no longer submodule, so fix tidy walk listklensy-2/+2
2023-07-04rust-installer and rls no longer submodule, so fix rustfmt.tomlklensy-67/+29
2023-07-04Use `llvm-config` instead of `download-ci-llvm` in PGO scriptJakub Beránek-2/+7
This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI.
2023-07-04Auto merge of #2960 - oli-obk:run_filter, r=oli-obkbors-1/+2
Restore test filtering by substring. Previously it was only looking for tests whose path was a prefix of the given filter fixes #2958
2023-07-04Auto merge of #2963 - RalfJung:start, r=RalfJungbors-2/+6
better error on missing #[start]
2023-07-04Restore test filtering by substring.Oli Scherer-1/+2
Previously it was only looking for tests whose path was a prefix of the given filter
2023-07-04better error on missing #[start]Ralf Jung-2/+6
2023-07-04Update debuginfo test runner to provide more useful outputTrevor Gross-108/+131
This change makes debuginfo tests more user friendly. Changes: - Print all lines that fail to match the patterns instead of just the first - Provide better error messages that also say what did match - Strip leading whitespace from directives so they are not skipped if indented - Improve documentation and improve nesting on some related items As an example, given the following debuginfo test with intentional fails: ```rust // from tests/debuginfo/rc_arc.rs // cdb-command:dx rc,d // cdb-check:rc,d : 111 [Type: alloc::rc::Rc<i32>] // cdb-check: [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>] // cdb-check: [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>] // ... ``` The current output (tested in #113313) only shows the first mismatch: ``` 2023-07-04T08:10:00.1939267Z ---- [debuginfo-cdb] tests\debuginfo\rc_arc.rs stdout ---- 2023-07-04T08:10:00.1942182Z 2023-07-04T08:10:00.1957463Z error: line not found in debugger output: [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>] 2023-07-04T08:10:00.1958272Z status: exit code: 0 ``` With this change, you are able to see all failures in that check group, as well as what parts were successful. The output is now: ``` 2023-07-04T09:45:57.2514224Z error: check directive(s) from `C:\a\rust\rust\tests\debuginfo\rc_arc.rs` not found in debugger output. errors: 2023-07-04T09:45:57.2514631Z (rc_arc.rs:31) ` [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]` 2023-07-04T09:45:57.2514908Z (rc_arc.rs:32) ` [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]` 2023-07-04T09:45:57.2515181Z (rc_arc.rs:41) ` [Reference count] : 21 [Type: core::sync::atomic FAIL::AtomicUsize]` 2023-07-04T09:45:57.2515452Z (rc_arc.rs:50) `dyn_rc,d [Type: alloc::rc::Rc<dyn$<core::fmt FAIL::Debug> >]` 2023-07-04T09:45:57.2515695Z the following subset of check directive(s) was found successfully:: 2023-07-04T09:45:57.2516080Z (rc_arc.rs:30) `rc,d : 111 [Type: alloc::rc::Rc<i32>]` 2023-07-04T09:45:57.2516312Z (rc_arc.rs:35) `weak_rc,d : 111 [Type: alloc::rc::Weak<i32>]` 2023-07-04T09:45:57.2516555Z (rc_arc.rs:36) ` [Reference count] : 11 [Type: core::cell::Cell<usize>]` 2023-07-04T09:45:57.2516881Z (rc_arc.rs:37) ` [Weak reference count] : 2 [Type: core::cell::Cell<usize>]` ... ``` Which makes it easier to see what did and didn't succeed without manual comparison against the source test file.
2023-07-04Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnrbors-14/+3
Remove chalk support from the compiler Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly: * Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk` * Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation * Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms) * Remove the chalk migration mode from compiletest * Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??) Fulfills rust-lang/types-team#93. r? `@jackh726`
2023-07-04Auto merge of #2957 - RalfJung:zulip, r=oli-obkbors-5/+11
send link to PR to Zulip
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-2/+1