about summary refs log tree commit diff
path: root/src/tools/tidy
AgeCommit message (Collapse)AuthorLines
2024-02-07Add parallel rustc ui testsSparrowLii-1/+1
2024-02-07Update testsr0cky-2/+3
2024-02-06Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errorsMatthias Krüger-1/+1
Remove `ffi_returns_twice` feature The [tracking issue](https://github.com/rust-lang/rust/issues/58314) and [RFC](https://github.com/rust-lang/rfcs/pull/2633) have been closed for a couple of years. There is also an attribute gate in R-A which should be removed if this lands.
2024-02-05Auto merge of #117372 - Amanieu:stdarch_update, r=Mark-Simulacrumbors-0/+6
Update stdarch submodule Splits up #27731 into multiple tracking issues. Closes #27731
2024-02-01Auto merge of #120447 - lnicola:sync-from-ra, r=lnicolabors-0/+1
Subtree update of `rust-analyzer` r? ghost
2024-01-30Remove `ffi_returns_twice` featureclubby789-1/+1
2024-01-30Update allowed depdendencies for craneliftAmanieu d'Antras-0/+6
2024-01-29Move multiple UI issue tests to subdirectoriesMarek 'seqre' Grzelak-2/+5
Issue tests numbered 1920, 3668, 5997, 23302, 32122, 40510, 57741, 71676, and 76077 were moved to relevant better-named subdirectories. ISSUES_ENTRY_LIMIT was adjusted to match new number of files and FIXME note was expanded.
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-17/+17
Error codes are integers, but `String` is used everywhere to represent them. Gross! This commit introduces `ErrCode`, an integral newtype for error codes, replacing `String`. It also introduces a constant for every error code, e.g. `E0123`, and removes the `error_code!` macro. The constants are imported wherever used with `use rustc_errors::codes::*`. With the old code, we have three different ways to specify an error code at a use point: ``` error_code!(E0123) // macro call struct_span_code_err!(dcx, span, E0123, "msg"); // bare ident arg to macro call \#[diag(name, code = "E0123")] // string struct Diag; ``` With the new code, they all use the `E0123` constant. ``` E0123 // constant struct_span_code_err!(dcx, span, E0123, "msg"); // constant \#[diag(name, code = E0123)] // constant struct Diag; ``` The commit also changes the structure of the error code definitions: - `rustc_error_codes` now just defines a higher-order macro listing the used error codes and nothing else. - Because that's now the only thing in the `rustc_error_codes` crate, I moved it into the `lib.rs` file and removed the `error_codes.rs` file. - `rustc_errors` uses that macro to define everything, e.g. the error code constants and the `DIAGNOSTIC_TABLES`. This is in its new `codes.rs` file.
2024-01-28Add rustc_apfloat license exception for RALaurențiu Nicola-0/+1
2024-01-27Auto merge of #120201 - clubby789:dep-update, r=dtolnaybors-2/+0
Bump some deps with syn 1.0 dependencies cc #109302 `cargo update`ing `unic-langid` and `object` removes two dependencies on Syn 1.0.
2024-01-27Auto merge of #120062 - davidtwco:llvm-data-layout-check, r=wesleywiserbors-3/+4
llvm: change data layout bug to an error and make it trigger more Fixes #33446. Don't skip the inconsistent data layout check for custom LLVMs or non-built-in targets. With #118708, all targets will have a simple test that would trigger this error if LLVM's data layouts do change - so data layouts would be corrected during the LLVM upgrade. Therefore, with builtin targets, this error won't happen with our LLVM because each target will have been confirmed to work. With non-builtin targets, this error is probably useful to have because you can change the data layout in your target and if it is wrong then that could lead to bugs. When using a custom LLVM, the same justification makes sense for non-builtin targets as with our LLVM, the user can update their target to match their LLVM and that's probably a good thing to do. However, with a custom LLVM, the user cannot change the builtin target data layouts if they don't match - though given that the compiler's data layout is used for layout computation and a bunch of other things - you could get some bugs because of the mismatch and probably want to know about that. I'm not sure if this is something that people do and is okay, but I doubt it? `CFG_LLVM_ROOT` was also always set during local development with `download-ci-llvm` so this bug would never trigger locally. In #33446, two points are raised: - In the issue itself, changing this from a `bug!` to a proper error is what is suggested, by using `isCompatibleDataLayout` from LLVM, but that function still just does the same thing that we do and check for equality, so I've avoided the additional code necessary to do that FFI call. - `@Mark-Simulacrum` suggests a different check is necessary to maintain backwards compatibility with old LLVM versions. I don't know how often this comes up, but we can do that with some simple string manipulation + LLVM version checks as happens already for LLVM 17 just above this diff.
2024-01-21Bump `object` versionclubby789-2/+0
2024-01-19Teach tidy about line/col information for malformed featuresOli Scherer-6/+26
2024-01-18llvm: simplify data layout checkDavid Wood-3/+4
Don't skip the inconsistent data layout check for custom LLVMs. With #118708, all targets will have a simple test that would trigger this check if LLVM's data layouts do change - so data layouts would be corrected during the LLVM upgrade. Therefore, with builtin targets, this check won't trigger with our LLVM because each target will have been confirmed to work. With non-builtin targets, this check is probably useful to have because you can change the data layout in your target and if its wrong then that could lead to bugs. When using a custom LLVM, the same justification makes sense for non-builtin targets as with our LLVM, the user can update their target to match their LLVM and that's probably a good thing to do. However, with a custom LLVM, the user cannot change the builtin target data layouts if they don't match - though given that the compiler's data layout is used for layout computation and a bunch of other things - you could get some bugs because of the mismatch and probably want to know about that. `CFG_LLVM_ROOT` was also always set during local development with `download-ci-llvm` so this bug would never trigger locally. Signed-off-by: David Wood <david@davidtw.co>
2024-01-17tests: add sanity-check assembly test for every targetDavid Wood-0/+54
Adds a basic assembly test checking that each target can produce assembly and update the target tier policy to require this. Signed-off-by: David Wood <david@davidtw.co>
2024-01-15Auto merge of #119581 - Nadrieril:detangle-arena, r=compiler-errorsbors-1/+0
Exhaustiveness: remove the need for arena-allocation within the algorithm After https://github.com/rust-lang/rust/pull/119688, exhaustiveness checking doesn't need access to the arena anymore. This simplifies the lifetime story and makes it compile on stable without the extra dependency. r? `@compiler-errors`
2024-01-13tidy: allow platform-dependent code in `sys`joboet-2/+2
2024-01-13Auto merge of #117285 - joboet:move_platforms_to_pal, r=ChrisDentonbors-2/+2
Move platform modules into `sys::pal` This is the initial step of #117276. `sys` just re-exports everything from the current `sys` for now, I'll move the implementations for the individual features one-by-one after this PR merges.
2024-01-12rustc_pattern_analysis no longer needs to be passed an arenaNadrieril-1/+0
2024-01-12Delegation implementation: step 1Bryanskiy-1/+1
2024-01-12update paths in toolsjoboet-2/+2
2024-01-11Rollup merge of #119448 - klensy:annotate-snippets-0.10, r=davidtwcoMatthias Krüger-1/+1
annotate-snippets: update to 0.10 Ports `annotate-snippets` to 0.10, temporary dupes versions; other crates left that depends on 0.9 is `ui_test` and `rustfmt`.
2024-01-10Stop mentioning internal lang items in no_std binary errorsNilstrieb-1/+1
When writing a no_std binary, you'll be greeted with nonsensical errors mentioning lang items like eh_personality and start. That's pretty bad because it makes you think that you need to define them somewhere! But oh no, now you're getting the `internal_features` lint telling you that you shouldn't use them! But you need a no_std binary! What now? No problem! Writing a no_std binary is super easy. Just use panic=abort and supply your own platform specific entrypoint symbol (like `main`) and you're good to go. Would be nice if the compiler told you that, right? This makes it so that it does do that.
2024-01-09Rollup merge of #118680 - djkoloski:shell_argfiles, r=compiler-errorsGuillaume Gomez-1/+6
Add support for shell argfiles Closes https://github.com/rust-lang/compiler-team/issues/684
2024-01-08Add support for shell argfilesDavid Koloski-1/+6
2024-01-07Delete unused makefile in tests/uiNilstrieb-1/+0
??????????
2024-01-07tidy: add\remove depsklensy-1/+1
2024-01-05Stabilize THIR unsafeckMatthew Jasper-1/+1
2023-12-23Rollup merge of #119248 - lukas-code:purge-unused-outlives-test, r=cjgillotMatthias Krüger-1/+1
remove dead inferred outlives testing code The `test_inferred_outlives` function was never run, because the code that's actually used for the tests was part of the `inferred_outlives_of` query, which ran before `test_inferred_outlives` during type collecting. This PR separates the test code from the query and moves it inside the dedicated function.
2023-12-23move rustc_outlives test code from query to dedicated functionLukas Markeffsky-1/+1
2023-12-22fix some typos found scrolling through the docsTakashi Idobe-1/+1
2023-12-15Make the crate compile on stableNadrieril-0/+1
2023-12-14Rollup merge of #118943 - lqd:update-deps2, r=michaelwoeristerJubilee-1/+0
update `measureme` to 10.1.2 to deduplicate `parking_lot` This PR updates `measureme` to the latest release to remove the last duplicates of `parking_lot` 0.11 we had in our dependency tree. ```console Updating measureme v10.1.1 -> v10.1.2 Removing parking_lot v0.11.2 Removing parking_lot_core v0.8.6 ``` Also removes `instant` from the allowed list of dependencies, as it's no longer used. r? `@michaelwoerister` (Thanks for the release in the first place 🙏)
2023-12-14Auto merge of #118375 - ouz-a:add_emit_stable_mir_tests, r=celinvalbors-1/+1
Add -Zunpretty=stable-mir output test As strongly suggested here https://github.com/rust-lang/rust/pull/118364#issuecomment-1827974148 this adds output test for `-Zunpretty=stable-mir`, added test shows almost all the functionality of the current printer. r? `@compiler-errors`
2023-12-14remove `instant` from allowed dependenciesRémy Rakic-1/+0
2023-12-14add stable_mir output testouz-a-1/+1
2023-12-14Auto merge of #118566 - klensy:cstr-new, r=WaffleLapkinbors-1/+0
use c literals in compiler and library Relands refreshed https://github.com/rust-lang/rust/pull/111647
2023-12-12Rollup merge of #117914 - estebank:issue-85843, r=wesleywiserMatthias Krüger-1/+1
On borrow return type, suggest borrowing from arg or owned return type When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-12-12Rollup merge of #118756 - jyn514:colors, r=estebankMatthias Krüger-1/+1
use bold magenta instead of bold white for highlighting according to a poll of gay people in my phone, purple is the most popular color to use for highlighting | color | percentage | | ---------- | ---------- | | bold white | 6% | | blue | 14% | | cyan | 26% | | purple | 37% | | magenta | 17% | unfortunately, purple is not supported by 16-color terminals, which rustc apparently wants to support for some reason. until we require support for full 256-color terms (e.g. by doing the same feature detection as we currently do for urls), we can't use it. instead, i have collapsed the purple votes into magenta on the theory that they're close, and also because magenta is pretty. before: ![image](https://github.com/rust-lang/rust/assets/23638587/9a89eee2-8b89-422e-8554-812827bb2a23) after: ![image](https://github.com/rust-lang/rust/assets/23638587/5bf3a917-8a20-4afd-af3e-f9491d0d57f5) other colors for comparison: blue: ![image](https://github.com/rust-lang/rust/assets/23638587/6f199c7b-d598-4009-8ffc-6b7b1d0d1f8c) cyan: ![image](https://github.com/rust-lang/rust/assets/23638587/a77e4fe3-563e-4aa5-ae92-745bb67287d1) purple: ![image](https://github.com/rust-lang/rust/assets/23638587/ffe603fb-d811-4106-95a9-4dd4c955924c) magenta without bolding: ![image](https://github.com/rust-lang/rust/assets/23638587/cf927e5f-8b25-4dc2-b8e7-32905a11a459) r? ``@estebank``
2023-12-08use magenta instead of bold for highlightingjyn-1/+1
according to a poll of gay people in my phone, purple is the most popular color to use for highlighting | color | percentage | | ---------- | ---------- | | bold white | 6% | | blue | 14% | | cyan | 26% | | purple | 37% | | magenta | 17% | unfortunately, purple is not supported by 16-color terminals, which rustc apparently wants to support for some reason. until we require support for full 256-color terms (e.g. by doing the same feature detection as we currently do for urls), we can't use it. instead, i have collapsed the purple votes into magenta on the theory that they're close, and also because magenta is pretty.
2023-12-08Extend tidy alphabetical checking to `tests/`.Nicholas Nethercote-0/+1
This is desired for #118702.
2023-12-06Auto merge of #117072 - betrusted-io:unwinding-crate-support, r=cuviperbors-0/+1
Use `unwinding` crate for unwinding on Xous platform This patch adds support for using [unwinding](https://github.com/nbdd0121/unwinding) on platforms where libunwinding isn't viable. An example of such a platform is `riscv32imac-unknown-xous-elf`. ### Background The Rust project maintains a fork of llvm at [llvm-project](https://github.com/rust-lang/llvm-project/) where it applies patches on top of the llvm project. This mostly seems to be to get unwinding support for the SGX project, and there may be other patches that I'm unaware of. There is a lot of machinery in the build system to support compiling `libunwind` on other platforms, and I needed to add additional patches to llvm in order to add support for Xous. Rather than continuing down this path, it seemed much easier to use a Rust-based library. The `unwinding` crate by `@nbdd0121` fits this description perfectly. ### Future work This could potentially replace the custom patches for `libunwind` on other platforms such as SGX, and could enable unwinding support on many more exotic platforms. ### Anti-goals This is not designed to replace `libunwind` on tier-one platforms or those where unwinding support already exists. There is already a well-established approach for unwinding there. Instead, this aims to enable unwinding on new platforms where C++ code may be difficult to compile.
2023-12-06tidy: add `unwinding` as an allowed dependencySean Cross-0/+1
Add `unwinding` as a permitted dependency of rustc, as it is now used as part of panic unwinding within platforms such as Xous. Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-03compiler: replace cstr macro with c str literals in compiler and few other c ↵klensy-1/+0
str replacements
2023-12-02allow zerocopy licenseRalf Jung-0/+3
2023-12-02move packed-struct tests into packed/ folderRalf Jung-1/+1
2023-11-27Remove instant from EXCEPTIONS_RUST_ANALYZERLaurențiu Nicola-1/+0
2023-11-24Update cargoWeihang Lo-40/+0
This removes the check to ensure that `rustfix` between * src/tools/cargo * src/tools/compiletest has the same version, since `rust-lang/rustfix` has migrated to under `rust-lang/cargo`.
2023-11-20On borrow return type, suggest borrowing from arg or owned return typeEsteban Küber-1/+1
When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.