about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2023-07-27bless clippyDeadbeef-33/+36
2023-07-27Auto merge of #113298 - tgross35:update-bless-envs, r=oli-obkbors-12/+14
Unite bless environment variables under `RUST_BLESS` Currently, Clippy and Miri both use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Rename the variable `MIRI_BLESS` (as used in the Miri subtree) to `RUST_BLESS` - Rename the variable `BLESS` (as used in the Clippy subtree) to `RUST_BLESS` - Move emitting `RUST_BLESS` into `prepare_cargo_test` so it is always available (I need this for a WIP PR) --- I prefer something like `RUST_BLESS` to `BLESS` just for a lower chance of conflict (not super common but other tools [do use `BLESS`](https://grep.app/search?q=%22BLESS%22&case=true&words=true&filter[lang][0]=Text&filter[lang][1]=Rust&filter[lang][2]=Python&filter[lang][3]=C%2B%2B&filter[lang][4]=Markdown&filter[lang][5]=C&filter[lang][6]=JSON)), but I can change it to whatever is preferred. Original discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/BLESS.20env.20var.3A.20rename.20to.20CLIPPY_BLESS r? `@oli-obk` cc `@flip1995`
2023-07-27Remove `constness` from `ParamEnv`Deadbeef-4/+3
2023-07-27Revert "add tidy check that forbids issue ui test filenames"Jubilee Young-4329/+6
This reverts commit 13e2abf6b388762af2e97ce065d6206961264a8f. Reverting because an MCP was requested and it turned out there was a lack of a consensus on what to do in this area.
2023-07-27Rollup merge of #114032 - tshepang:patch-1, r=GuillaumeGomezGuillaume Gomez-2/+2
typos
2023-07-27fmtRalf Jung-20/+11
2023-07-27Merge from rustcRalf Jung-155/+143
2023-07-27Preparing for merge from rustcRalf Jung-1/+1
2023-07-27Rollup merge of #114102 - compiler-errors:fulldeps-stage1-hack, r=pnkfelixMatthias Krüger-1/+8
Dont pass `-Zwrite-long-types-to-disk=no` for `ui-fulldeps --stage=1` Due to this hack: https://github.com/rust-lang/rust/blob/601a34de8c10458b72a7781eb0b44a7981e4a2b1/src/bootstrap/test.rs#L1473-L1484 We use the stage 0 compiler to build the stage 1 fulldeps tests. That means that we don't have `-Zwrite-long-types-to-disk=no` which was added in #113893. Add a temporary hack to fix this (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Some.20tests.20failing.20with.20--stage.201) until the next beta bump.
2023-07-27Avoid `into_trees` usage in rustfmt.Nicholas Nethercote-14/+14
Token tree cloning is only needed in one place.
2023-07-26Auto merge of #113843 - wesleywiser:replace_rustc_apfloat, r=pnkfelixbors-14/+2
Replace in-tree `rustc_apfloat` with the new version of the crate Replace the in-tree version of `rustc_apfloat` with the new version of the crate which has been correctly licensed. The new crate incorporates upstream changes from LLVM since the original port was done including many correctness fixes and has been extensively fuzz tested to validate correctness. Fixes #100233 Fixes #102403 Fixes #113407 Fixes #113409 Fixes #55993 Fixes #93224 Closes #93225 Closes #109573
2023-07-26Unite bless environment variables under `RUSTC_BLESS`Trevor Gross-12/+14
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
2023-07-26Rollup merge of #114090 - mdibaiee:remove-remap-path-prefix-ci, r=wesleywiserMatthias Krüger-8/+0
compiletest: remove ci-specific remap-path-prefix Now that we have fixed the underlying cause of long type name inconsistencies in #113893, we can remove the remap-path-prefix logic from CI resolves #113424
2023-07-26Rollup merge of #114070 - blyxyas:iter_mut_symbol, r=oli-obkMatthias Krüger-1/+1
Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy We currently have `sym::iter` and `sym::iter_repeat`, this PR adds `sym::iter_mut` as it's useful for https://github.com/rust-lang/rust-clippy/pull/11038 and another Clippy lint, it also adds `sym::as_mut_ptr` as it's useful for https://github.com/rust-lang/rust-clippy/pull/10962.
2023-07-26Dont pass -Zwrite-long-types-to-disk=no for ui-fulldeps --stage=1Michael Goulet-1/+8
2023-07-26Fix miriWesley Wiser-10/+0
2023-07-26Replace in-tree `rustc_apfloat` with the new version of the crateWesley Wiser-4/+2
2023-07-26Auto merge of #114071 - RalfJung:interpret-generic-read-write, r=oli-obkbors-125/+125
interpret: make read/write methods generic Instead of always having to call `into()` to convert things to `PlaceTy`/`OpTy`, make the relevant methods generic. This also means that when we read from an `MPlaceTy`, we avoid creating an intermediate `PlaceTy`. This makes it feasible to remove the `Copy` from `MPlaceTy`. All the other `*Ty` interpreter types already had their `Copy` removed a while ago so this is only consistent. (And in fact we had one function that accidentally took `MPlaceTy` instead of `&MPlaceTy`.)
2023-07-26we correctly check that the perm is not lazy when triggering protectorsNeven Villani-0/+16
2023-07-26fix protectors so that all reads actually commuteNeven Villani-87/+59
2023-07-26Auto merge of #114054 - oli-obk:cleanups, r=estebankbors-14/+15
Split some functions with many arguments into builder pattern functions r? `@estebank` This doesn't resolve all of the ones in rustc, mostly because I need to do other cleanups in order to be able to use some builder derives from crates.io Works around https://github.com/rust-lang/rust/issues/90672 by making `x test rustfmt --bless` format itself instead of testing that it is formatted
2023-07-26compiletest: remove ci-specific remap-path-prefixMahdi Dibaiee-8/+0
Now that we have fixed the underlying cause of long type name inconsistencies in #113893, we can remove the remap-path-prefix logic from CI
2023-07-26Auto merge of #2991 - rust-lang:rustup-2023-07-26, r=RalfJungbors-607/+5255
Automatic sync from rustc
2023-07-26normalize tree borrow diagnostics across targetsRalf Jung-52/+54
2023-07-26Make `x test src/tools/rustfmt --bless` format rustfmt with the freshly ↵Oli Scherer-9/+13
built in-tree version
2023-07-26move CI var uses after their declarationRalf Jung-4/+4
2023-07-26sparse registry has been stable for a bit nowRalf Jung-3/+0
2023-07-26move nightly cron job a little earlierRalf Jung-1/+1
2023-07-26fmtThe Miri Conjob Bot-2/+3
2023-07-26Merge from rustcThe Miri Conjob Bot-554/+5199
2023-07-26Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-07-26Auto merge of #113583 - asquared31415:tidy_no_issue_tests, r=workingjubileebors-6/+4329
add tidy check that forbids issue-XXXX and ice-XXXX test filenames Helps with #113345 by preventing any future tests with non-descriptive names from being added. This PR only checks modified ui test files because there are far too many existing problematic tests to be fixed at once: 3063/15424 (~19.86%) `*.rs` ui test files match `^issue[-_ ]?\d+$`. Another 1349 files, totaling ~28.60% of all ui test files, contain that pattern in addition to some other text, where they should probably omit it in favor of a comment. note: between the creation of this PR and 2023-07-25 (14 days), 10 more tests were added that failed this check. r? `@workingjubilee`
2023-07-26add tidy check that forbids issue ui test filenamesasquared31415-6/+4329
2023-07-26Auto merge of #113893 - mdibaiee:type-name-spill-flag, r=compiler-errorsbors-0/+1
new unstable option: -Zwrite-long-types-to-disk This option guards the logic of writing long type names in files and instead using short forms in error messages in rustc_middle/ty/error behind a flag. The main motivation for this change is to disable this behaviour when running ui tests. This logic can be triggered by running tests in a directory that has a long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/ This means ui tests can fail depending on how long the path to their file is. Some ui tests actually rely on this behaviour for their assertions, so for those we enable the flag manually.
2023-07-25Add `sym::iter_mut` + `sym::as_mut_ptr`blyxyas-1/+1
2023-07-25Auto merge of #114076 - matthiaskrgr:rollup-cpqq1n9, r=matthiaskrgrbors-20/+44
Rollup of 5 pull requests Successful merges: - #112995 (Check for `<&NotClone as Clone>::clone()` calls and suggest to add Clone trait appropriately) - #113578 (Don't say that a type is uncallable if its fn signature has errors in it) - #113661 (Double check that hidden types match the expected hidden type) - #114044 (factor out more stable impls) - #114062 (CI: split nested GHA groups instead of panicking) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-25Rollup merge of #114062 - Kobzol:ci-group-splitting, r=Mark-SimulacrumMatthias Krüger-19/+43
CI: split nested GHA groups instead of panicking Bootstrap uses Github Actions groups to reduce clutter in CI job output. However, GHA doesn't support group nesting, and currently, when a group would be nested, bootstrap would panic. This is causing intermittent CI failures, because it's not trivial to make sure that groups won't be nested, and subtle changes in bootstrap (or even in caches being present) can cause nesting. This PR changes the logic so that groups are never nested. Instead, when a group would be nested, the previous group is ended, and only then is the subgroup started. When the subgroup finishes, it will then restart any previously ended parent group. r? `@Mark-Simulacrum`
2023-07-25Rollup merge of #113661 - oli-obk:tait_wtf, r=lcnrMatthias Krüger-1/+1
Double check that hidden types match the expected hidden type Fixes https://github.com/rust-lang/rust/issues/113278 specifically, but I left a TODO for where we should also add some hardening. It feels a bit like papering over the issue, but at least this way we don't get unsoundness, but just surprising errors. Errors will be improved and given spans before this PR lands. r? `@compiler-errors` `@lcnr`
2023-07-25Auto merge of #114027 - arlosi:update-cargo, r=ehussbors-0/+0
Update cargo 8 commits in 1b15556767f4b78a64e868eedf4073c423f02b93..7ac9416d82cd4fc5e707c9ec3574d22dff6466e5 2023-07-18 14:44:47 +0000 to 2023-07-24 14:29:38 +0000 - fix(cargo-credential): should enable feature `serde/derive` (rust-lang/cargo#12396) - fix: encode URL params correctly for SourceId in Cargo.lock (rust-lang/cargo#12280) - docs: format config override caveat as a note (rust-lang/cargo#12392) - credential provider implementation (rust-lang/cargo#12334) - feat(crates-io): expose HTTP headers and Error type (rust-lang/cargo#12310) - chore: Don't update test data (rust-lang/cargo#12380) - fix: only skip mtime check on `~/.cargo/{git,registry}` (rust-lang/cargo#12369) - Update docs for artifact JSON debuginfo levels. (rust-lang/cargo#12376) Since rust-lang/cargo#12334 makes built-in credential providers part of the cargo binary, it's no longer needed to build them in bootstrap.
2023-07-25make MPlaceTy non-CopyRalf Jung-12/+12
2023-07-25interpret: make read functions generic over operand typeRalf Jung-45/+45
2023-07-25interpret: make write functions generic over the place typeRalf Jung-71/+71
2023-07-25Split nested GHA groups instead of panickingJakub Beránek-19/+43
2023-07-25Auto merge of #114063 - matthiaskrgr:rollup-c90czu6, r=matthiaskrgrbors-2/+4
Rollup of 7 pull requests Successful merges: - #114008 (coverage: Obtain the `__llvm_covfun` section name outside a per-function loop) - #114014 (builtin_macros: expect raw strings too) - #114043 (docs(LazyLock): add example pass local LazyLock variable to struct) - #114051 (Add regression test for invalid "unused const" in method) - #114052 (Suggest `{Option,Result}::as_ref()` instead of `cloned()` in some cases) - #114058 (Add help for crate arg when crate name is invalid) - #114060 (abi: unsized field in union - assert to delay bug ) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-25Rollup merge of #114058 - chenyukang:yukang-fix-113981-crate-arg, ↵Matthias Krüger-1/+3
r=fmease,oli-obk Add help for crate arg when crate name is invalid Fixes #113981
2023-07-25Rollup merge of #114014 - davidtwco:issue-114010-env-rawstr, r=cjgillotMatthias Krüger-1/+1
builtin_macros: expect raw strings too Fixes #114010. `expr_to_string` allows raw strings through so this code should be expected to handle those.
2023-07-25Auto merge of #113393 - compiler-errors:next-solver-unsize-rhs, r=lcnrbors-2/+2
Normalize the RHS of an `Unsize` goal in the new solver `Unsize` goals are... tricky. Not only do they structurally match on their self type, but they're also structural on their other type parameter. I'm pretty certain that it is both incomplete and also just plain undesirable to not consider normalizing the RHS of an unsize goal. More practically, I'd like for this code to work: ```rust trait A {} trait B: A {} impl A for usize {} impl B for usize {} trait Mirror { type Assoc: ?Sized; } impl<T: ?Sized> Mirror for T { type Assoc = T; } fn main() { // usize: Unsize<dyn B> let x = Box::new(1usize) as Box<<dyn B as Mirror>::Assoc>; // dyn A: Unsize<dyn B> let y = x as Box<<dyn A as Mirror>::Assoc>; } ``` --- In order to achieve this, we add `EvalCtxt::normalize_non_self_ty` (naming modulo bikeshedding), which *must* be used for all non-self type arguments that are structurally matched in candidate assembly. Currently this is only necessary for `Unsize`'s argument, but I could see future traits requiring this (hopefully rarely) in the future. It uses `repeat_while_none` to limit infinite looping, and normalizes the self type until it is no longer an alias. Also, we need to fix feature gate detection for `trait_upcasting` and `unsized_tuple_coercion` when HIR typeck has unnormalized types. We can do that by checking the `ImplSource` returned by selection, which necessitates adding a new impl source for tuple upcasting.
2023-07-25Make everything builtin!Michael Goulet-2/+2
2023-07-26Add help for crate arg when crate name is invalidyukang-1/+3
2023-07-25Auto merge of #114011 - RalfJung:place-projection, r=oli-obkbors-110/+99
interpret: Unify projections for MPlaceTy, PlaceTy, OpTy For ~forever, we didn't really have proper shared code for handling projections into those three types. This is mostly because `PlaceTy` projections require `&mut self`: they might have to `force_allocate` to be able to represent a project part-way into a local. This PR finally fixes that, by enhancing `Place::Local` with an `offset` so that such an optimized place can point into a part of a place without having requiring an in-memory representation. If we later write to that place, we will still do `force_allocate` -- for now we don't have an optimized path in `write_immediate` that would avoid allocation for partial overwrites of immediately stored locals. But in `write_immediate` we have `&mut self` so at least this no longer pollutes all our type signatures. (Ironically, I seem to distantly remember that many years ago, `Place::Local` *did* have an `offset`, and I removed it to simplify things. I guess I didn't realize why it was so useful... I am also not sure if this was actually used to achieve place projection on `&self` back then.) The `offset` had type `Option<Size>`, where `None` represent "no projection was applied". This is needed because locals *can* be unsized (when they are arguments) but `Place::Local` cannot store metadata: if the offset is `None`, this refers to the entire local, so we can use the metadata of the local itself (which must be indirect); if a projection gets applied, since the local is indirect, it will turn into a `Place::Ptr`. (Note that even for indirect locals we can have `Place::Local`: when the local appears in MIR, we always start with `Place::Local`, and only check `frame.locals` later. We could eagerly normalize to `Place::Ptr` but I don't think that would actually simplify things much.) Having done all that, we can finally properly abstract projections: we have a new `Projectable` trait that has the basic methods required for projecting, and then all projection methods are implemented for anything that implements that trait. We can even implement it for `ImmTy`! (Not that we need that, but it seems neat.) The visitor can be greatly simplified; it doesn't need its own trait any more but it can use the `Projectable` trait. We also don't need the separate `Mut` visitor any more; that was required only to reflect that projections on `PlaceTy` needed `&mut self`. It is possible that there are some more `&mut self` that can now become `&self`... I guess we'll notice that over time. r? `@oli-obk`