about summary refs log tree commit diff
path: root/src/tools/tidy
AgeCommit message (Collapse)AuthorLines
2022-03-01Provide C FFI types via core::ffi, not just in stdJosh Triplett-1/+1
The ability to interoperate with C code via FFI is not limited to crates using std; this allows using these types without std. The existing types in `std::os::raw` become type aliases for the ones in `core::ffi`. This uses type aliases rather than re-exports, to allow the std types to remain stable while the core types are unstable. This also moves the currently unstable `NonZero_` variants and `c_size_t`/`c_ssize_t`/`c_ptrdiff_t` types to `core::ffi`, while leaving them unstable.
2022-02-26Rollup merge of #94235 - Dirbaio:fix-chalk-opaque-debrujin, r=jackh726Matthias Krüger-2/+2
chalk: Fix wrong debrujin index in opaque type handling. A folder in opaque type lowering was substituting all opaque type references with a variable with debrujin index 0 ignoring how many binders deep we are. This caused an ICE with `Not enough bound vars: ^0 not found in []` ([full logs](https://gist.github.com/Dirbaio/2b9374ff4fce37afb9d665dc9f0000df)) with the following code. ```rust fn main() -> () {} async fn foo(x: u32) -> u32 { x } ``` With the fix, it no longer ICEs. It still doesn't typecheck due to generator issues. I've added a "known-bug" test so that at least it doesn't regress back to ICEing. r? ``@jackh726``
2022-02-22Rollup merge of #94178 - est31:tolerant_lines_check, r=Mark-SimulacrumMatthias Krüger-0/+3
tidy: fire less "ignoring file length unneccessarily" warnings This avoids a situation where a file is at the border of the limit, and alternates between hitting the limit and not hitting it, causing a back and forth of addition of the ignore-tidy-linelength directive. As an example, consider the ignore-tidy-filelength of compiler/rustc_typeck/src/collect.rs. It was added in 2ca4964db5d263a8f9222846bd70a7f26cf414cf, removed in 37354ebc9794b0eb14b08c02177e3094c8fe91cd (a revert of the earlier commit), added again in 448d07683a6defd567996114793a09c9a8aef5df, removed in 3171bd5bf54fb91f7f7df7c40df5adc7d8bd5dea, added in 438826fd1a9a119d00992ede948cdd479431ecbb, and removed in bb0a2f985cb6e980cc026ea952733d53bb868f87. To avoid this back and forth, we exempt files from the unneccessary ignoring warning that have length of at least 70% of the limit.
2022-02-22chalk: add known-bug test that was previously ICEing.Dario Nieuwenhuis-2/+2
2022-02-20tidy: fire less "ignoring file length unneccessarily" warningsest31-0/+3
This avoids a situation where a file is at the border of the limit, and alternates between hitting the limit and not hitting it, causing a back and forth of addition of the ignore-tidy-linelength directive. As an example, consider the ignore-tidy-filelength of compiler/rustc_typeck/src/collect.rs. It was added in 2ca4964db5d263a8f9222846bd70a7f26cf414cf, removed in 37354ebc9794b0eb14b08c02177e3094c8fe91cd, added again in 448d07683a6defd567996114793a09c9a8aef5df, removed in 3171bd5bf54fb91f7f7df7c40df5adc7d8bd5dea, added in 438826fd1a9a119d00992ede948cdd479431ecbb, and #94142 is going to remove it again. To avoid this back and forth, we exempt files from the unneccessary ignoring warning that have length of at least 70% of the limit.
2022-02-18Rollup merge of #93915 - Urgau:rfc-3013, r=petrochenkovMatthias Krüger-1/+1
Implement --check-cfg option (RFC 3013), take 2 This pull-request implement RFC 3013: Checking conditional compilation at compile time (https://github.com/rust-lang/rfcs/pull/3013) and is based on the previous attempt https://github.com/rust-lang/rust/pull/89346 by `@mwkmwkmwk` that was closed due to inactivity. I have address all the review comments from the previous attempt and added some more tests. cc https://github.com/rust-lang/rust/issues/82450 r? `@petrochenkov`
2022-02-16Implement --check-cfg option (RFC 3013)Loïc BRANSTETT-1/+1
Co-authored-by: Urgau <lolo.branstett@numericable.fr> Co-authored-by: Marcelina Kościelnicka <mwk@0x04.net>
2022-02-13Update `sha1`, `sha2`, and `md5` dependenciespierwill-1/+2
This removes the `cpuid-bool` dependency, which is deprecated, while adding `crypto-common` as a new dependency.
2022-02-13Auto merge of #93713 - klensy:deps-up, r=Mark-Simulacrumbors-2/+1
Update deps cargo_metadata 0.12 -> 0.14, to dedupe and remove some `semver`, `semver-parser` versions pretty_assertions 0.6 -> 0.7, to drop some `ansi_term` version futures 0.1.29 -> 0.1.31, backported some [fixes](https://github.com/rust-lang/futures-rs/compare/0.1.29...0.1.31) to old versions futures-* 0.3.12 -> 0.3.19, to remove `proc-macro-hack`, `proc-macro-nested` and fix some [issues](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#0319---2021-12-18). There exist 0.3.21, but it's quite new (06.02.22), so not updated to. itertools 0.9 -> 0.10 for rustdoc, will be droppped when rustfmt will bump `itertools` version linked-hash-map 0.5.3 -> 0.5.4, fix [UB](https://github.com/contain-rs/linked-hash-map/pull/106) markup5ever 0.10.0 -> 0.10.1, internally drops `serde`, reducing [build time](https://github.com/servo/html5ever/commit/3afd8d63853627e530b3063b0185eea3732cc29f#diff-4c20e8293515259c0aa26932413a55a334aa5f2b37de5a5adc92a2186f632606) for some usecases mio 0.7.13 -> 0.7.14 fix [unsoundness](https://github.com/tokio-rs/mio/compare/v0.7.13...v0.7.14) num_cpus 1.13.0 -> 1.13.1 fix parsing mountinfo and other [fixes](https://github.com/seanmonstar/num_cpus/compare/v1.13.0...v1.13.1) openssl-src 111.16.0+1.1.1l -> 111.17.0+1.1.1m fix CVE-2021-4160
2022-02-11Check that error code explanations are listed in error_codes.rsGuillaume Gomez-4/+29
2022-02-07cargo_metadata 0.12 -> 0.14, to dedupe and remove some `semver`, ↵klensy-2/+1
`semver-parser` versions pretty_assertions 0.6 -> 0.7, to drop some `ansi_term` version futures 0.1.29 -> 0.1.31, backported some [fixes](https://github.com/rust-lang/futures-rs/compare/0.1.29...0.1.31) to old verions futures-* 0.3.12 -> 0.3.19, to remove `proc-macro-hack`, `proc-macro-nested` and fix some [issues](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#0319---2021-12-18). There exist 0.3.21, but it's quite new (06.02.22), so not updated to. itertools 0.9 -> 0.10 for rustdoc, will be droppped when rustfmt will bump `itertools` version linked-hash-map 0.5.3 -> 0.5.4, fix [UB](https://github.com/contain-rs/linked-hash-map/pull/106) markup5ever 0.10.0 -> 0.10.1, internally drops `serde`, reducing [build time](https://github.com/servo/html5ever/commit/3afd8d63853627e530b3063b0185eea3732cc29f#diff-4c20e8293515259c0aa26932413a55a334aa5f2b37de5a5adc92a2186f632606) for some usecases mio 0.7.13 -> 0.7.14 fix [unsoundness](https://github.com/tokio-rs/mio/compare/v0.7.13...v0.7.14) num_cpus 1.13.0 -> 1.13.1 fix parsing mountinfo and other [fixes](https://github.com/seanmonstar/num_cpus/compare/v1.13.0...v1.13.1) openssl-src 111.16.0+1.1.1l -> 111.17.0+1.1.1m fix CVE-2021-4160
2022-02-02Configure panic hook backtrace behaviorMark Rousskov-0/+1
2022-01-16Drop duplicate checks for now missing rustc_ast dep in tidyIgor Matuszewski-1/+0
2022-01-16Auto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrumbors-14/+11
Update rayon and rustc-rayon This updates rayon for various tools and rustc-rayon for the compiler's parallel mode. - rayon v1.3.1 -> v1.5.1 - rayon-core v1.7.1 -> v1.9.1 - rustc-rayon v0.3.1 -> v0.3.2 - rustc-rayon-core v0.3.1 -> v0.3.2 ... and indirectly, this updates all of crossbeam-* to their latest versions. Fixes #92677 by removing crossbeam-queue, but there's still a lingering question about how tidy discovers "runtime" dependencies. None of this is truly in the standard library's dependency tree at all.
2022-01-13Rollup merge of #90001 - Fearyncess:master, r=alexcrichtonMatthias Krüger-0/+1
Make rlib metadata strip works with MIPSr6 architecture Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags). This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts. e_flags REF: https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/llvm/include/llvm/BinaryFormat/ELF.h#L562
2022-01-10Update rayon and rustc-rayonJosh Stone-14/+11
2022-01-08Auto merge of #92068 - fee1-dead:libcore2021, r=m-ou-sebors-26/+7
Switch all libraries to the 2021 edition The fix for https://github.com/rust-lang/rust/issues/88638#issuecomment-996620107 is to simply add const-stability for these functions. r? `@m-ou-se` Closes #88638.
2022-01-08tidy: add `ahash` to permitted dep listLain Yang-0/+1
2022-01-06cg: use thorin instead of llvm-dwpDavid Wood-0/+2
`thorin` is a Rust implementation of a DWARF packaging utility that supports reading DWARF objects from archive files (i.e. rlibs) and therefore is better suited for integration into rustc. Signed-off-by: David Wood <david.wood@huawei.com>
2021-12-31Make tidy check for magic numbers that spell thingsJosh Triplett-0/+15
Remove existing problematic cases.
2021-12-28docs(error-codes): Add long error explanation for E0227TmLev-2/+2
2021-12-23Switch all libraries to the 2021 editionDeadbeef-26/+7
2021-12-23Auto merge of #92167 - pierwill:chalk-update, r=jackh726bors-1/+0
Update chalk to 0.75.0 - Compute flags in `intern_ty` - Remove `tracing-serde` from `PERMITTED_DEPENDENCIES` - Bump `tracing-tree` to 0.2.0 - Bump `tracing-subscriber` to 0.3.3
2021-12-22Update chalk to 0.75.0pierwill-1/+0
- Compute flags in `intern_ty` - Remove tracing-serde from PERMITTED_DEPENDENCIES - Disable `tracing-full` feature in `chalk-solve` - Bump tracing-tree to 0.2.0
2021-12-18Update stdlib to the 2021 editionLucas Kent-2/+4
2021-12-06replace dynamic library module with libloadingAndy Russell-1/+2
2021-11-25Auto merge of #91037 - c410-f3r:testsssssss, r=petrochenkovbors-5/+1
Move some tests to more reasonable directories - 10 cc #73494 r? `@petrochenkov`
2021-11-25Move some tests to more reasonable directoriesCaio-5/+1
2021-11-23Add `unic-emoji-char` and its dependencies to the allow listEsteban Kuber-3/+8
2021-11-20Fix float ICEthreadexception-1/+1
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-11-20Rollup merge of #90930 - Nilstrieb:fix-non-const-value-ice, r=estebankMatthias Krüger-1/+9
Fix `non-constant value` ICE (#90878) This also fixes the same suggestion, which was kind of broken, because it just searched for the last occurence of `const` to replace with a `let`. This works great in some cases, but when there is no const and a leading space to the file, it doesn't work and panic with overflow because it thought that it had found a const. I also changed the suggestion to only trigger if the `const` and the non-constant value are on the same line, because if they aren't, the suggestion is very likely to be wrong. Also don't trigger the suggestion if the found `const` is on line 0, because that triggers the ICE. Asking Esteban to review since he was the last one to change the relevant code. r? ``@estebank`` Fixes #90878
2021-11-18Move some tests to more reasonable directoriesCaio-2/+2
2021-11-17tidy-ignore-leading-newlinesNilstrieb-1/+9
2021-11-17Rollup merge of #90861 - 5225225:nonprinting-char, r=davidtwcoMatthias Krüger-1/+1
Print escaped string if char literal has multiple characters, but only one printable character Fixes #90857 I'm not sure about the error message here, it could get rather long and *maybe* using the names of characters would be better? That wouldn't help the length any, though.
2021-11-16Rollup merge of #90935 - jhpratt:alphabetize-features, r=joshtriplettMatthias Krüger-7/+40
Alphabetize language features This should significantly reduce the frequency of merge conflicts. r? ````@joshtriplett```` ````@rustbot```` label: +A-contributor-roadblock +S-waiting-on-review
2021-11-16Increase tidy limit for parser by 15225225-1/+1
2021-11-15Suggest where feature should be placedJacob Pratt-6/+39
2021-11-15Alphabetize language featuresJacob Pratt-7/+7
This should significantly reduce the frequency of merge conflicts.
2021-11-14Move some tests to more reasonable directoriesCaio-1/+5
2021-11-13Auto merge of #89167 - workingjubilee:use-simd, r=MarkSimulacrumbors-0/+1
pub use core::simd; A portable abstraction over SIMD has been a major pursuit in recent years for several programming languages. In Rust, `std::arch` offers explicit SIMD acceleration via compiler intrinsics, but it does so at the cost of having to individually maintain each and every single such API, and is almost completely `unsafe` to use. `core::simd` offers safe abstractions that are resolved to the appropriate SIMD instructions by LLVM during compilation, including scalar instructions if that is all that is available. `core::simd` is enabled by the `#![portable_simd]` nightly feature tracked in https://github.com/rust-lang/rust/issues/86656 and is introduced here by pulling in the https://github.com/rust-lang/portable-simd repository as a subtree. We built the repository out-of-tree to allow faster compilation and a stochastic test suite backed by the proptest crate to verify that different targets, features, and optimizations produce the same result, so that using this library does not introduce any surprises. As these tests are technically non-deterministic, and thus can introduce overly interesting Heisenbugs if included in the rustc CI, they are visible in the commit history of the subtree but do nothing here. Some tests **are** introduced via the documentation, but these use deterministic asserts. There are multiple unsolved problems with the library at the current moment, including a want for better documentation, technical issues with LLVM scalarizing and lowering to libm, room for improvement for the APIs, and so far I have not added the necessary plumbing for allowing the more experimental or libm-dependent APIs to be used. However, I thought it would be prudent to open this for review in its current condition, as it is both usable and it is likely I am going to learn something else needs to be fixed when bors tries this out. The major types are - `core::simd::Simd<T, N>` - `core::simd::Mask<T, N>` There is also the `LaneCount` struct, which, together with the SimdElement and SupportedLaneCount traits, limit the implementation's maximum support to vectors we know will actually compile and provide supporting logic for bitmasks. I'm hoping to simplify at least some of these out of the way as the compiler and library evolve.
2021-11-12Expose portable-simd as core::simdJubilee Young-0/+1
This enables programmers to use a safe alternative to the current `extern "platform-intrinsics"` API for writing portable SIMD code. This is `#![feature(portable_simd)]` as tracked in #86656
2021-11-06Move some tests to more reasonable directoriesCaio-2/+2
2021-11-02Also check for feature gates in "src/test/rustdoc"Guillaume Gomez-0/+1
2021-10-24tidy: Remove submodules from edition exception listNoah Lev-9/+1
Both style-check and date-check are now on the 2021 edition, and this commit also updates their repositories' submodules.
2021-10-20Increase `ROOT_ENTRY_LIMIT` to 1331Yuki Okushi-1/+1
2021-10-12Add long explanation for E0464Noah Lev-1/+1
The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and its auxiliary tests. I added it to the `compile_fail` code example check exemption list since it's hard if not impossible to reproduce this error in a standalone code example.
2021-10-12Test crate loading error stderrNoah Lev-2/+2
And remove E0464 from test-exemption list, since it now has a full test.
2021-10-11Rollup merge of #89710 - sireliah:e0482, r=GuillaumeGomezMatthias Krüger-1/+1
Add long explanation for error E0482 This is longer explanation for error E0482 in the #61137. Please take a look and leave some feedback!
2021-10-09Allow the E0482 to be testedsireliah-1/+1
2021-09-30Implemented -Z randomize-layoutChase Wilson-0/+1