summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2022-03-14bootstrap: correct reading of flags for llvmJon Gjengset-2/+13
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-03-02[beta] Update cargoEric Huss-0/+0
2022-02-21Fix up unused imports in rustfmt testsMark Rousskov-5/+4
2022-02-18Rollup merge of #93953 - jackh726:known_bug, r=Mark-SimulacrumMatthias Krüger-221/+186
Add the `known-bug` test directive, use it, and do some cleanup cc rust-lang/compiler-team#476 Now tests can be annotated with `known-bug`, which should indicate that the test *should* pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort. I've used this attribute for the GAT tests added in #93757. Finally, I've also cleaned up `header.rs` in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions from `Config` and makes `TestProps::load_from` read nicer. I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward. r? ``@Mark-Simulacrum``
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-18Rollup merge of #91675 - ivanloz:memtagsan, r=nagisaMatthias Krüger-0/+5
Add MemTagSanitizer Support Add support for the LLVM [MemTagSanitizer](https://llvm.org/docs/MemTagSanitizer.html). On hardware which supports it (see caveats below), the MemTagSanitizer can catch bugs similar to AddressSanitizer and HardwareAddressSanitizer, but with lower overhead. On a tag mismatch, a SIGSEGV is signaled with code SEGV_MTESERR / SEGV_MTEAERR. # Usage `-Zsanitizer=memtag -C target-feature="+mte"` # Comments/Caveats * MemTagSanitizer is only supported on AArch64 targets with hardware support * Requires `-C target-feature="+mte"` * LLVM MemTagSanitizer currently only performs stack tagging. # TODO * Tests * Example
2022-02-18Auto merge of #94088 - oli-obk:revert, r=jackh726bors-10/+2
Revert #91403 fixes #94004 r? `@pnkfelix` `@cjgillot`
2022-02-17Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"Oli Scherer-10/+2
This reverts commit 3cfa4def7c87d571bd46d92fed608edf8fad236e, reversing changes made to 5d8767cb229b097fedb1dd4bd9420d463c37774f.
2022-02-17Don't lint `needless_borrow` in method receiver positionsJason Newcomb-26/+8
2022-02-17Rollup merge of #94030 - ChayimFriedman2:issue-94010, r=petrochenkovMatthias Krüger-1/+1
Correctly mark the span of captured arguments in `format_args!()` It should not include the braces, or misspelling suggestions will be wrong. Fixes #94010.
2022-02-16Rollup merge of #94054 - lnicola:rust-analyzer-2022-02-16, r=lnicolaMatthias Krüger-22/+16
:arrow_up: rust-analyzer r? ``@ghost``
2022-02-16:arrow_up: rust-analyzerLaurențiu Nicola-22/+16
2022-02-16MemTagSanitizer SupportIvan Lozano-0/+5
Adds support for the LLVM MemTagSanitizer.
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-16Correctly mark the span of captured arguments in `format_args!()`Chayim Refael Friedman-1/+1
It should only include the identifier, or misspelling suggestions will be wrong.
2022-02-15Update cargoEric Huss-0/+0
2022-02-15Rollup merge of #94014 - flip1995:clippy_transmute_lint_regroup, r=dtolnayMatthias Krüger-3/+2
Move transmute_undefined_repr back to nursery There's still open discussion if this lint is ready to be enabled by default. We want to give us more time to figure this out and prevent this lint from getting to stable as an enabled-by-default lint. cc https://github.com/rust-lang/rust-clippy/pull/8432 r? `@Manishearth` `@dtolnay` I think this is the way to go here. We can re-enable this lint with the next sync, if we should decide to do so. But I would hold of for this release. We have until Friday (beta branching) to decide if we want to merge this.
2022-02-15Auto merge of #93148 - nnethercote:Uniq, r=fee1-deadbors-91/+92
Overhaul interning. A number of types are interned and `eq` and `hash` are implemented on the pointer rather than the contents. But this is not well enforced within the type system like you might expect. This PR introduces a new type `Interned` which encapsulates this concept more rigorously, and uses it to convert a couple of the less common interned types. r? `@fee1-dead`
2022-02-15Move transmute_undefined_repr back to nurseryflip1995-3/+2
There's still open discussion if this lint is ready to be enabled by default. We want to give us more time to figure this out and prevent this lint from getting to stable as an enabled-by-default lint.
2022-02-15Overhaul `Const`.Nicholas Nethercote-12/+12
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-2/+2
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2022-02-15Overhaul `TyS` and `Ty`.Nicholas Nethercote-77/+78
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
2022-02-15Auto merge of #93863 - pierwill:fix-93676, r=Mark-Simulacrumbors-2/+3
Update `sha1`, `sha2`, and `md-5` dependencies This replaces the deprecated [`cpuid-bool`](https://crates.io/crates/cpuid-bool) dependency with [`cpufeatures`](https://crates.io/crates/cpufeatures), while adding [`crypto-common`](https://crates.io/crates/crypto-common) as a new dependency. Closes #93676.
2022-02-14Don't allow error annotations in known-bug testsJack Huey-7/+11
2022-02-14Auto merge of #93938 - BoxyUwU:fix_res_self_ty, r=lcnrbors-4/+4
Make `Res::SelfTy` a struct variant and update docs I found pattern matching on a `(Option<DefId>, Option<(DefId, bool)>)` to not be super readable, additionally the doc comments on the types in a tuple variant aren't visible anywhere at use sites as far as I can tell (using rust analyzer + vscode) The docs incorrectly assumed that the `DefId` in `Option<(DefId, bool)>` would only ever be for an impl item and I also found the code examples to be somewhat unclear about which `DefId` was being talked about. r? `@lcnr` since you reviewed the last PR changing these docs
2022-02-13Update `sha1`, `sha2`, and `md5` dependenciespierwill-2/+3
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-12Cleanup header parsing by extracting common logicJack Huey-229/+168
2022-02-12Add the known-bug compiletest propJack Huey-1/+23
2022-02-12Auto merge of #91403 - cjgillot:inherit-async, r=oli-obkbors-2/+10
Inherit lifetimes for async fn instead of duplicating them. The current desugaring of `async fn foo<'a>(&usize) -> &u8` is equivalent to ```rust fn foo<'a, '0>(&'0 usize) -> foo<'static, 'static>::Opaque<'a, '0, '_>; type foo<'_a, '_0>::Opaque<'a, '0, '1> = impl Future<Output = &'1 u8>; ``` following the RPIT model. Duplicating all the inherited lifetime parameters and setting the inherited version to `'static` makes lowering more complex and causes issues like #61949. This PR removes the duplication of inherited lifetimes to directly use ```rust fn foo<'a, '0>(&'0 usize) -> foo<'a, '0>::Opaque<'_>; type foo<'a, '0>::Opaque<'1> = impl Future<Output = &'1 u8>; ``` following the TAIT model. Fixes https://github.com/rust-lang/rust/issues/61949
2022-02-12Auto merge of #93939 - RalfJung:miri, r=RalfJungbors-11/+7
update miri to fix the libcore test suite r? `@ghost`
2022-02-12update miriRalf Jung-11/+7
2022-02-12change to a struct variantEllen-4/+4
2022-02-12Rollup merge of #93898 - GuillaumeGomez:error-code-check, r=Mark-SimulacrumMatthias Krüger-4/+29
tidy: Extend error code check We discovered in https://github.com/rust-lang/rust/pull/93845 that the error code tidy check didn't check everything: if you remove an error code from the listing even if it has an explanation, then it should error. It also allowed me to put back `E0192` in that listing as well. r? ```@Mark-Simulacrum```
2022-02-12Rollup merge of #93897 - schopin-pro:linkchecker-symlink, r=Mark-SimulacrumMatthias Krüger-2/+3
linkchecker: fix panic on directory symlinks In Debian and Ubuntu, there are some patches that change the rustc/fonts directory to a symlink to the system fonts. This triggers a latent bug in linkchecker, as the DirEntry filetype isn't a dir but later on the file itself, when opened, is one, triggering an unreachable!() clause. This patch fixes the situation by using std::fs::metadata, which goes through symlinks. I'd have added a test case but `tidy` doesn't seem to like symlinks, and moreover I'm not sure how Git deals with symlinks on Windows. Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
2022-02-12Bless clippy test.Camille GILLOT-2/+10
2022-02-11Rollup merge of #93660 - aDotInTheVoid:rustdoc-type-tests, r=CraftSpiderMatthias Krüger-2/+16
rustdoc-json: Add some tests for typealias item r? ```@CraftSpider``` Improves https://github.com/rust-lang/rust/issues/81359 The test's arn't pretty, and I think eventually we need a better way of doing repeated tests on a deeply nested path, without repeating the way to get to that path ```@rustbot``` modify labels: +A-rustdoc-json +T-rustdoc +A-rustdoc +A-testsuite
2022-02-11Auto merge of #93893 - oli-obk:sad_revert, r=oli-obkbors-1/+0
Revert lazy TAIT PR Revert https://github.com/rust-lang/rust/pull/92306 (sorry `@Aaron1011,` will include your changes in the fix PR) Revert https://github.com/rust-lang/rust/pull/93783 Revert https://github.com/rust-lang/rust/pull/92007 fixes https://github.com/rust-lang/rust/issues/93788 fixes https://github.com/rust-lang/rust/issues/93794 fixes https://github.com/rust-lang/rust/issues/93821 fixes https://github.com/rust-lang/rust/issues/93831 fixes https://github.com/rust-lang/rust/issues/93841
2022-02-11Auto merge of #93891 - matthiaskrgr:rollup-xadut8w, r=matthiaskrgrbors-1/+4
Rollup of 8 pull requests Successful merges: - #92242 (Erase regions before calculating layout for packed field capture) - #93443 (Add comment on stable_hash_impl for OwnerNodes) - #93742 (Drop rustc-docs from complete profile) - #93852 (rustdoc: remove support for multi-query search) - #93853 (Make all `hir::Map` methods consistently by-value) - #93861 (Fix ICE if no trait assoc const eq) - #93862 (Split x86_64-apple builder into two) - #93864 (Remove ArchiveBuilder::update_symbols) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-11Check that error code explanations are listed in error_codes.rsGuillaume Gomez-4/+29
2022-02-11linkchecker: fix panic on directory symlinksSimon Chopin-2/+3
In Debian and Ubuntu, there are some patches that change the rustc/fonts directory to a symlink to the system fonts. This triggers a latent bug in linkchecker, as the DirEntry filetype isn't a dir but later on the file itself, when opened, is one, triggering an unreachable!() clause. This patch fixes the situation by using std::fs::metadata, which goes through symlinks. I'd have added a test case but `tidy` doesn't seem to like symlinks, and moreover I'm not sure how Git deals with symlinks on Windows. Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-1/+0
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-11Rollup merge of #93742 - Mark-Simulacrum:skip-rustc-docs-complete, ↵Matthias Krüger-1/+4
r=pietroalbini Drop rustc-docs from complete profile Addresses #75833, but does not fully fix it -- we should support side-by-side installation of these ideally, but that's not currently possible. r? `@pietroalbini`
2022-02-11Auto merge of #93865 - flip1995:clippyup, r=Manishearth,flip1995bors-3159/+4465
Update Clippy r? `@Manishearth`
2022-02-10Clippy: Fix botstrap falloutflip1995-21/+24
2022-02-10Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyupflip1995-3159/+4462
2022-02-10Update rlsEric Huss-0/+0
2022-02-09jsondocck: Improved error messages for invalid json value and failed @count ↵Nixon Enraght-Moony-2/+16
check
2022-02-09Auto merge of #93795 - JohnTitor:rollup-n0dmsoo, r=JohnTitorbors-3/+0
Rollup of 7 pull requests Successful merges: - #93445 (Add From<u8> for ExitCode) - #93694 (rustdoc: tweak line spacing and paragraph spacing for accessibility) - #93735 (Stabilize int_abs_diff in 1.60.0.) - #93746 (Remove defaultness from ImplItem.) - #93748 (rustc_query_impl: reduce visibility of some modules/fn's) - #93751 (Drop tracking: track borrows of projections) - #93781 (update `ty::TyKind` documentation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-09Rollup merge of #93746 - cjgillot:nodefii, r=nikomatsakisYuki Okushi-3/+0
Remove defaultness from ImplItem. This information is not really used anywhere, except HIR pretty-printing. This makes ImplItem and TraitItem more similar.