about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2020-11-01Auto merge of #75534 - Aaron1011:feature/new-future-breakage, r=pnkfelixbors-9/+59
Implement rustc side of report-future-incompat cc https://github.com/rust-lang/rust/issues/71249 This is an alternative to `@pnkfelix's` initial implementation in https://github.com/pnkfelix/rust/commits/prototype-rustc-side-of-report-future-incompat (mainly because I started working before seeing that branch :smile: ). My approach outputs the entire original `Diagnostic`, in a way that is compatible with incremental compilation. This is not yet integrated with compiletest, but can be used manually by passing `-Z emit-future-incompat-report` to `rustc`. Several changes are made to support this feature: * The `librustc_session/lint` module is moved to a new crate `librustc_lint_defs` (name bikesheddable). This allows accessing lint definitions from `librustc_errors`. * The `Lint` struct is extended with an `Option<FutureBreakage>`. When present, it indicates that we should display a lint in the future-compat report. `FutureBreakage` contains additional information that we may want to display in the report (currently, a `date` field indicating when the crate will stop compiling). * A new variant `rustc_error::Level::Allow` is added. This is used when constructing a diagnostic for a future-breakage lint that is marked as allowed (via `#[allow]` or `--cap-lints`). This allows us to capture any future-breakage diagnostics in one place, while still discarding them before they are passed to the `Emitter`. * `DiagnosticId::Lint` is extended with a `has_future_breakage` field, indicating whether or not the `Lint` has future breakage information (and should therefore show up in the report). * `Session` is given access to the `LintStore` via a new `SessionLintStore` trait (since `librustc_session` cannot directly reference `LintStore` without a cyclic dependency). We use this to turn a string `DiagnosticId::Lint` back into a `Lint`, to retrieve the `FutureBreakage` data. Currently, `FutureBreakage.date` is always set to `None`. However, this could potentially be interpreted by Cargo in the future. I've enabled the future-breakage report for the `ARRAY_INTO_ITER` lint, which can be used to test out this PR. The intent is to use the field to allow Cargo to determine the date of future breakage (as described in [RFC 2834](https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md)) without needing to parse the diagnostic itself. cc `@pnkfelix`
2020-10-30Update Clippy path to `Lint`Aaron Hill-1/+1
2020-10-30Always pass `-Z future-incompat-report` to UI testsAaron Hill-0/+1
2020-10-30Don't display empty future-compat reportAaron Hill-16/+21
2020-10-30Update into-iter-on-arrays test to check future-incompat-reportAaron Hill-11/+22
2020-10-30Only error on unfixed diagnosticsAaron Hill-1/+3
2020-10-30Strip out non-diagnostic lines from rustfix inputAaron Hill-7/+20
2020-10-30Print future breakage reportAaron Hill-6/+9
2020-10-30Some workAaron Hill-2/+17
2020-10-30Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obkbors-4/+6
TypeVisitor: use `std::ops::ControlFlow` instead of `bool` Implements MCP rust-lang/compiler-team#374. Blocked on FCP in rust-lang/compiler-team#374. r? `@lcnr` cc `@jonas-schievink`
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-1/+1
2020-10-30Use `ControlFlow::is{break,continue}`LeSeulArtichaut-2/+2
2020-10-30TypeVisitor: use `ControlFlow` in clippyLeSeulArtichaut-4/+6
2020-10-30Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011Yuki Okushi-0/+5
Avoid BorrowMutError with RUSTC_LOG=debug ```console $ touch empty.rs $ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs ``` Fails with a `BorrowMutError` because source map files are already borrowed while `features_query` attempts to format a log message containing a span. Release the borrow before the query to avoid the issue.
2020-10-30Auto merge of #78540 - RalfJung:miri, r=RalfJungbors-7/+7
update Miri Cc `@rust-lang/miri` r? `@ghost`
2020-10-29update MiriRalf Jung-7/+7
2020-10-29Rollup merge of #78505 - ebroto:clippyup, r=oli-obkJonas Schievink-672/+2832
Update Clippy - temporary_cstring_as_ptr deprecation In #75671 `clippy::temporary_cstr_as_ptr` was removed instead of being deprecated. This will trigger an error (unknown lint) for users that refer to that lint to e.g. allow it, instead of a more informative warning. This update should fix that for nightly users. r? @oli-obk
2020-10-29Rollup merge of #78493 - ehuss:update-cargo, r=ehussJonas Schievink-0/+0
Update cargo 8 commits in dd83ae55c871d94f060524656abab62ec40b4c40..becb4c282b8f37469efb8f5beda45a5501f9d367 2020-10-20 19:31:26 +0000 to 2020-10-28 16:41:55 +0000 - List available packages if providing `--package` with an empty value (rust-lang/cargo#8808) - Add a future-compatibility warning on allowed feature name characters. (rust-lang/cargo#8814) - New namespaced features implementation. (rust-lang/cargo#8799) - Remove redundant "For example, " (rust-lang/cargo#8810) - Document platform-specific build-dependencies (rust-lang/cargo#8809) - Remove some unused code. (rust-lang/cargo#8807) - Some minor clippy fixes. (rust-lang/cargo#8804) - Update TOML website links. (rust-lang/cargo#8803)
2020-10-29Auto merge of #78486 - pietroalbini:manifest-artifacts, r=Mark-Simulacrumbors-22/+125
Include non-rustup artifacts in the manifest This PR fixes https://github.com/rust-lang/promote-release/issues/22 by including all the files we ship in the generated manifests, even the ones that are not installable through rustup. In practice this adds the following "artifacts": * `source-code`: the tarball containing the full source code used to build the release (`rustc-{channel}-src.tar.xz`) * `installer-msi`: the MSI installer for Windows systems (`rust-{channel}-{target}.msi`) * `installer-pkg`: the PKG installer for macOS systems (`rust-{channel}-{target}.pkg`) These files are included in a new `artifacts` table of the manifest, like so: ```toml [[artifacts.installer-msi.target.aarch64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-pc-windows-msvc.msi" hash-sha256 = "6b41d5b829d20834c5d93628d008ec618f8914ee79303363bd13a86fd5f305dd" [[artifacts.installer-msi.target.i686-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-gnu.msi" hash-sha256 = "83f020de6e180c155add9fce1cea2ac6e5f744edbd6dc1581e24de8f56b2ca7a" [[artifacts.installer-msi.target.i686-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-msvc.msi" hash-sha256 = "dbc80c24e9d5df01616c6f216114b4351f51a94218e2368b5cebe4165b270702" [[artifacts.installer-msi.target.x86_64-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-gnu.msi" hash-sha256 = "8196eca3f02d72d4c8776ad4fcc72897125e2cf6404ae933e31c07e197e3c9fa" [[artifacts.installer-msi.target.x86_64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-msvc.msi" hash-sha256 = "b2e7fd6463790732fcf9c726b9448068712341943199cb40fc11d1138b8a207b" [[artifacts.installer-pkg.target.aarch64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-apple-darwin.pkg" hash-sha256 = "70421c191752fb33886f8033b029e634bcc993b72308cef52a38405840e91f5c" [[artifacts.installer-pkg.target.x86_64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-apple-darwin.pkg" hash-sha256 = "ebd7a5acb61e82d85e855146cc9bd856f32228ee7f40dd94c659b00614ed4f1f" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.gz" hash-sha256 = "5fcc487ee4c15c689de8ddf7daac7ff6a65c80498197b9aea58622dc2b3bca10" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.xz" hash-sha256 = "0c618ef0ec5f64da1801e9d0df6c755f6ed1a8780ec5c8ee75e55614be51d42c" ``` Each artifact can be available for multiple targets, and each target can have multiple versions of the same file (for example, a `gz`-compressed one and a `xz`-compressed one). In the future rustup might add functionality to let users retrieve the artifacts, but that's not needed to land this PR, and whether to do the implementation is up to the rustup maintainers. r? `@kinnison` cc `@Mark-Simulacrum`
2020-10-29Add support for rustc-env and unset-rustc-env for aux-buildsTomasz Miąsko-0/+5
2020-10-28Merge commit '645ef505da378b6f810b1567806d1bcc2856395f' into clippyupEduardo Broto-672/+2832
2020-10-28Update cargoEric Huss-0/+0
2020-10-28Auto merge of #78409 - pietroalbini:build-manifest-checksum-cache, ↵bors-50/+106
r=Mark-Simulacrum Add checksums cache to build-manifest During the release process we're currently calculating the SHA256 of each file three times: 1. In `build-manifest`, to fill the `hash = "f00"` keys of the manifests. 2. In `promote-release`, to generate the `.sha256` files. 3. In `promote-release`, to generate the `.asc` GPG signatures. Calculations 1. and 2. could be merged into a single one if there was a way for `build-manifest` to pass the checksums it generated over to `promote-release`. Unfortunately calculation 3. can't be merged as GPG requires extra metadata to be hashed. This PR adds support for merging 1. and 2. by creating the `BUILD_MANIFEST_CHECKSUM_CACHE` environment variable, which points to a JSON file storing a cache of all the calculated checksums. `build-manifest` will load it at startup and avoid generating existing checksums, and it will dump its internal checksums cache into it when it exits successfully. This PR also allows to run `build-manifest` multiple times without the need to wait for checksums to be calculated in the following invocations. The speedup will allow to work torwards a fix for https://github.com/rust-lang/promote-release/issues/15 without impacting the release process duration nor our storage costs. This PR can be reviewed commit-by-commit. r? `@Mark-Simulacrum`
2020-10-28build-manifest: include artifacts in a new tablePietro Albini-22/+125
This commit adds to the generated manifest all files we ship that are not rustup components, namely: * Source code tarballs (rustc-{channel}-src.tar.xz) * Windows installers (rust-{channel}-{target}.msi) * macOS installers (rust-{channel}-{target}.pkg) Those files are included in a new "artifacts" table of the manifest, to avoid interfering with existing rustup installations.
2020-10-27Auto merge of #75671 - nathanwhit:cstring-temp-lint, r=oli-obkbors-140/+3
Uplift `temporary-cstring-as-ptr` lint from `clippy` into rustc The general consensus seems to be that this lint covers a common enough mistake to warrant inclusion in rustc. The diagnostic message might need some tweaking, as I'm not sure the use of second-person perspective matches the rest of rustc, but I'd like to hear others' thoughts on that. (cc #53224). r? `@oli-obk`
2020-10-26Remove lint from clippyNathan Whitaker-140/+3
2020-10-26build-manifest: add BUILD_MANIFEST_CHECKSUM_CACHEPietro Albini-5/+29
The checksum cache allows to reuse the calculated checksums between build-manifest and promote-release, or between multiple invocations of build-manifest.
2020-10-26build-manifest: refactor checksum generation into a structPietro Albini-50/+82
2020-10-26Auto merge of #77975 - bjorn3:cg_clif_subtree3, r=Mark-Simulacrumbors-0/+1
Add cg_clif as optional codegen backend Rustc_codegen_cranelift is an alternative codegen backend for rustc based on Cranelift. It has the potential to improve compilation times in debug mode. In my experience the compile time improvements over debug mode LLVM for a clean build are about 20-30% in most cases. This PR adds cg_clif as optional codegen backend. By default it is only enabled for `./x.py check`. It can be enabled for `./x.py build` too by adding `cranelift` to the `rust.codegen-backends` array in `config.toml`. MCP: https://github.com/rust-lang/compiler-team/issues/270 r? `@Mark-Simulacrum`
2020-10-26Auto merge of #78395 - RalfJung:miri, r=RalfJungbors-11/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/78339 Cc `@rust-lang/miri` r? `@ghost`
2020-10-26Auto merge of #78196 - pietroalbini:shipped-files, r=Mark-Simulacrumbors-12/+41
Allow creating a list of files shipped in a release This PR adds the `BUILD_MANIFEST_SHIPPED_FILES_PATH` environment variable to `build-manifest`, which writes a list of all the files referenced in the manifest to the path defined in the variable. The use for this is for `promote-release` to prune files unused files before publishing a release. This PR **does not implement any pruning**, it just adds support for it to be implemented in the future on `promote-release`'s side. r? `@Mark-Simulacrum`
2020-10-26update MiriRalf Jung-11/+7
2020-10-26build-manifest: allow creating a list of files shipped in a releasePietro Albini-12/+41
2020-10-26Add support for using cg_clif to bootstrap rustcbjorn3-0/+1
2020-10-26Rollup merge of #78137 - tmiasko:compiletest-tracing, r=Mark-SimulacrumDylan DPC-2/+2
Initialize tracing subscriber in compiletest tool The logging in compiletest was migrated from log crate to a tracing, but the initialization code was never changed, so logging is non-functional. Initialize tracing subscriber using default settings.
2020-10-25Rollup merge of #78326 - Aaron1011:fix/min-stmt-lints, r=petrochenkovYuki Okushi-2/+2
Split out statement attributes changes from #78306 This is the same as PR https://github.com/rust-lang/rust/pull/78306, but `unused_doc_comments` is modified to explicitly ignore statement items (which preserves the current behavior). This shouldn't have any user-visible effects, so it can be landed without lang team discussion. --------- When the 'early' and 'late' visitors visit an attribute target, they activate any lint attributes (e.g. `#[allow]`) that apply to it. This can affect warnings emitted on sibiling attributes. For example, the following code does not produce an `unused_attributes` for `#[inline]`, since the sibiling `#[allow(unused_attributes)]` suppressed the warning. ```rust trait Foo { #[allow(unused_attributes)] #[inline] fn first(); #[inline] #[allow(unused_attributes)] fn second(); } ``` However, we do not do this for statements - instead, the lint attributes only become active when we visit the struct nested inside `StmtKind` (e.g. `Item`). Currently, this is difficult to observe due to another issue - the `HasAttrs` impl for `StmtKind` ignores attributes for `StmtKind::Item`. As a result, the `unused_doc_comments` lint will never see attributes on item statements. This commit makes two interrelated fixes to the handling of inert (non-proc-macro) attributes on statements: * The `HasAttr` impl for `StmtKind` now returns attributes for `StmtKind::Item`, treating it just like every other `StmtKind` variant. The only place relying on the old behavior was macro which has been updated to explicitly ignore attributes on item statements. This allows the `unused_doc_comments` lint to fire for item statements. * The `early` and `late` lint visitors now activate lint attributes when invoking the callback for `Stmt`. This ensures that a lint attribute (e.g. `#[allow(unused_doc_comments)]`) can be applied to sibiling attributes on an item statement. For now, the `unused_doc_comments` lint is explicitly disabled on item statements, which preserves the current behavior. The exact locatiosn where this lint should fire are being discussed in PR #78306
2020-10-24Add unbounded_depth to serde_json (clippy-driver)Eduardo Broto-1/+1
2020-10-24Fix inconsistencies in handling of inert attributes on statementsAaron Hill-2/+2
When the 'early' and 'late' visitors visit an attribute target, they activate any lint attributes (e.g. `#[allow]`) that apply to it. This can affect warnings emitted on sibiling attributes. For example, the following code does not produce an `unused_attributes` for `#[inline]`, since the sibiling `#[allow(unused_attributes)]` suppressed the warning. ```rust trait Foo { #[allow(unused_attributes)] #[inline] fn first(); #[inline] #[allow(unused_attributes)] fn second(); } ``` However, we do not do this for statements - instead, the lint attributes only become active when we visit the struct nested inside `StmtKind` (e.g. `Item`). Currently, this is difficult to observe due to another issue - the `HasAttrs` impl for `StmtKind` ignores attributes for `StmtKind::Item`. As a result, the `unused_doc_comments` lint will never see attributes on item statements. This commit makes two interrelated fixes to the handling of inert (non-proc-macro) attributes on statements: * The `HasAttr` impl for `StmtKind` now returns attributes for `StmtKind::Item`, treating it just like every other `StmtKind` variant. The only place relying on the old behavior was macro which has been updated to explicitly ignore attributes on item statements. This allows the `unused_doc_comments` lint to fire for item statements. * The `early` and `late` lint visitors now activate lint attributes when invoking the callback for `Stmt`. This ensures that a lint attribute (e.g. `#[allow(unused_doc_comments)]`) can be applied to sibiling attributes on an item statement. For now, the `unused_doc_comments` lint is explicitly disabled on item statements, which preserves the current behavior. The exact locatiosn where this lint should fire are being discussed in PR #78306
2020-10-23Remove duplicate import of `Target`Eduardo Broto-1/+0
2020-10-23Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyupEduardo Broto-566/+2120
2020-10-23Rollup merge of #78169 - ehuss:update-cargo, r=ehussYuki Okushi-0/+0
Update cargo 3 commits in 79b397d72c557eb6444a2ba0dc00a211a226a35a..dd83ae55c871d94f060524656abab62ec40b4c40 2020-10-15 14:41:21 +0000 to 2020-10-20 19:31:26 +0000 - Support glob patterns for package/target selection (rust-lang/cargo#8752) - Update env_logger requirement from 0.7.0 to 0.8.1 (rust-lang/cargo#8795) - Fix man page links inside `option` blocks. (rust-lang/cargo#8793)
2020-10-23Rollup merge of #77488 - varkor:repr128-incomplete_features, r=jonas-schievinkYuki Okushi-0/+3
Mark `repr128` as `incomplete_features` As mentioned in https://github.com/rust-lang/rust/issues/56071 and noticed in https://github.com/rust-lang/rust/issues/77457, `repr(u128)` and `repr(i128)` do not work properly due to lack of LLVM support. We should thus warn users trying to use the feature that they may encounter ICEs when using it. Closes https://github.com/rust-lang/rust/issues/77457.
2020-10-22Fix clippy testsvarkor-0/+3
2020-10-21Update rustc-demanglevarkor-1/+1
2020-10-20Update cargoEric Huss-0/+0
2020-10-20Initialize tracing subscriber in compiletest toolTomasz Miąsko-2/+2
The logging in compiletest was migrated from log crate to a tracing, but the initialization code was never changed, so logging is non-functional. Initialize tracing subscriber using default settings.
2020-10-18Rollup merge of #78059 - JohnTitor:fix-linkcheck, r=ehussYuki Okushi-0/+3
Set `MDBOOK_OUTPUT__HTML__INPUT_404` on linkchecker This is found in https://github.com/rust-lang/nomicon/pull/240. It seems the spurious failure shows up without this flag.
2020-10-18Rollup merge of #77851 - exrook:split-btreemap, r=dtolnayYuki Okushi-1/+1
BTreeMap: refactor Entry out of map.rs into its own file btree/map.rs is approaching the 3000 line mark, splitting out the entry code buys about 500 lines of headroom. I've created this PR because the changes I've made in #77438 will push `map.rs` over the 3000 line limit and cause tidy to complain. I picked `Entry` to factor out because it feels less tightly coupled to the rest of `BTreeMap` than the various iterator implementations. Related: #60302
2020-10-18Rollup merge of #76607 - Mark-Simulacrum:tidy-bins, r=pnkfelixYuki Okushi-12/+50
Modify executable checking to be more universal This uses a dummy file to check if the filesystem being used supports the executable bit in general. Supersedes #74753.
2020-10-17Appease the almightly lord clippy, hallowed be thy nameJacob Hughes-1/+1