about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-04-24Auto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrumbors-15/+30
espidf: fix stat Marking as draft as currently dependant on [a libc fix](https://github.com/rust-lang/libc/pull/2708) and release.
2022-04-24Auto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgrbors-287/+400
Rollup of 5 pull requests Successful merges: - #94893 (diagnostics: regression test for `<usize as Iterator>::rev`) - #95504 (Add `x {check,build,doc} {compiler,library}` aliases.) - #96237 (compiletest: combine `--*-python` args) - #96303 (Improve bootstrap tests) - #96352 (Improve span for `consider adding an explicit lifetime bound` suggestions under NLL) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-24Rollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, ↵Matthias Krüger-143/+231
r=jackh726 Improve span for `consider adding an explicit lifetime bound` suggestions under NLL Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound. We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body. This helps with #96332
2022-04-24Rollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-SimulacrumMatthias Krüger-119/+129
Improve bootstrap tests - Don't checkout submodules in bootstrap tests This doesn't cause any tests to fail, and can greatly speed them up. - Add a test for --exclude test::XXX I didn't know that the `test::` syntax was valid before, and it doesn't seem to be documented anywhere. Add a test so it doesn't regress accidentally, and as executable documentation. This also moves the `exclude` tests out of `dist`, to avoid assertion errors when the `cmd` passed to configure didn't match the `subcommand` used. - Use run_build helper consistently across most bootstrap tests This is not super important to do, but the consistency is nice. I didn't change any tests that call `configure("dist")` and then override the subcommand - doing that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor. Found while working on the "one call to Step for all paths" change mentioned in https://github.com/rust-lang/rust/pull/95503#issuecomment-1105914384, but independent of that work. cc `@pietroalbini` for the `--exclude` test, git blame says you added support for it originally.
2022-04-24Rollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-SimulacrumMatthias Krüger-19/+11
compiletest: combine `--*-python` args Since these arguments are now always the same, combine them into a singular `--python` argument. Fixes #96011
2022-04-24Rollup merge of #95504 - jyn514:library-alias, r=Mark-SimulacrumMatthias Krüger-6/+9
Add `x {check,build,doc} {compiler,library}` aliases. While working on https://github.com/rust-lang/rust/pull/95503, I realized that it will interfere with existing command lines: Currently people run `x build library/std` expecting it to "add all library crates to the sysroot", but after that change, it will *only* build `libstd` and its dependencies (and add them to the sysroot), not libtest or libproc_macro. That will work for local testing in most cases, but could be confusing. Even if not, though, I think `x build library` is more clear about what actually happens than the current `x build library/std`. The intended end goal is something like: - For check/build/doc, we have library + compiler aliases, which correspond to basically "most possible" for that piece. This is the intended path of entry (rather than library/test or similar as today) for when you just want the thing to work -- for example, getting a compiler that is "crates.io-compatible" would be roughly `x.py build library`). #95504 - Specific crate invocations build up to that crate, which means that if you don't care about tests you probably want x.py build library/proc_macro or library/std for faster build times. #95503 Note that this is already implemented today for the `doc` command and seems to work pretty well in practice. I plan to change the dev-guide and various instructions in the README to `build library` once this is merged. `@rustbot` label +A-rustbuild
2022-04-24Rollup merge of #94893 - notriddle:notriddle/regression-test-issue-90315, ↵Matthias Krüger-0/+20
r=Mark-Simulacrum diagnostics: regression test for `<usize as Iterator>::rev` Closes #90315
2022-04-24diagnostics: regression test for <usize as Iterator>::revMichael Howell-0/+20
Closes #90315
2022-04-24Bless testsmarmeladema-66/+136
2022-04-24Auto merge of #96359 - SparrowLii:drop_kind, r=oli-obkbors-35/+38
make `classify_drop_access_kind` iterate This PR: 1. fixes the FIXME of `classify_drop_access_kind` func in the borrowck part. The process of obtaining `StorageDeadOrDrop` has been changed from recursive to iterative. 2. gets `place_ty` in each iteration, avoid repeatedly getting the `ty` of the same place (O(n^2) => O(n))
2022-04-24make `classify_drop_access_kind` iterateSparrowLii-35/+38
2022-04-24Recover missing suggestion part under NLLmarmeladema-17/+26
2022-04-24Improve span for `consider adding an explicit lifetime bound` suggestions ↵marmeladema-60/+69
under NLL Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound. We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body.
2022-04-24Auto merge of #96067 - jsgf:extern-nounused, r=compiler-errorsbors-1/+38
Add support for `nounused` --extern flag This adds `nounused` to the set of extern flags: `--extern nounused:core=/path/to/core/libcore.rlib`. The effect of this flag is to suppress `unused-crate-dependencies` warnings relating to the crate.
2022-04-23Add support for `nounused` --extern flagJeremy Fitzhardinge-1/+38
This adds `nounused` to the set of extern flags: `--extern nounused:core=/path/to/core/libcore.rlib`. The effect of this flag is to suppress `unused-crate-dependencies` warnings relating to the crate.
2022-04-24Auto merge of #96281 - SparrowLii:const_prop, r=wesleywiserbors-29/+11
Optimize `const_prop` mir-opt by accessing `local_decls` through `ecx` From the FIXME in the impl of `ConstPropagator`. Accessing `local_decls` and `scource_scopes` from `ecx` can reduce `clone` calls and save compile time. Besides, according to #96213 , the FIXME about writing `layouts` to `ecx` in advance can also be removed.
2022-04-23Auto merge of #93970 - cjgillot:novis, r=petrochenkovbors-549/+311
Remove visibility information from HIR The resolver exports all the necessary visibility information through the `tcx.visibility` query. This PR stops having a dedicated visibility field in HIR, in order to use this query. We keep a `vis_span` field for diagnostic purposes.
2022-04-23Bless pretty-print output.Camille GILLOT-12/+12
2022-04-23Hash visibilities in crate_hash.Camille GILLOT-0/+4
2022-04-23Compute has_pub_restricted in the resolver.Camille GILLOT-12/+13
2022-04-23Make clippy inspector more precise.Camille GILLOT-2/+14
2022-04-23Fix lints.Camille GILLOT-96/+79
2022-04-23Auto merge of #96326 - JakobDegen:relax-operand, r=oli-obkbors-3/+8
Relax restrictions for copy operands This was [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Removing.20requirement.20that.20.60Copy.60.20operands.20have.20.60Copy.60.20types/near/279102313). Details about motivation and such can be found there r? `@oli-obk`
2022-04-23Auto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obkbors-7/+8
Unstably constify `impl<I: Iterator> IntoIterator for I` This constifies the default `IntoIterator` implementation under the `const_intoiterator_identity` feature. Tracking Issue: #90603
2022-04-23Auto merge of #95971 - workingjubilee:no-weird-fp-in-const, r=oli-obkbors-48/+479
No "weird" floats in const fn {from,to}_bits I suspect this code is subtly incorrect and that we don't even e.g. use x87-style floats in CTFE, so I don't have to guard against that case. A future PR will be hopefully removing them from concern entirely, anyways. But at the moment I wanted to get this rolling because small questions like that one seem best answered by review. r? `@oli-obk` cc `@eddyb` `@thomcc`
2022-04-23Auto merge of #96323 - bjorn3:sync_cg_clif-2022-04-22, r=bjorn3bors-142/+189
Sync rustc_codegen_cranelift Mostly fixing bugs this time, but also a Cranelift update. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-04-23Bless incremental tests.Camille GILLOT-24/+20
2022-04-23Drop vis in Item.Camille GILLOT-166/+54
2022-04-23Drop vis in ImplItem.Camille GILLOT-36/+16
2022-04-23Drop vis from ForeignItem.Camille GILLOT-4/+4
2022-04-23Drop vis in FieldDef.Camille GILLOT-62/+80
2022-04-23Stop pretty-printing HIR visibility.Camille GILLOT-83/+29
2022-04-23Stop visiting visibility.Camille GILLOT-95/+29
2022-04-23Auto merge of #96316 - michaelwoerister:debuginfo-fix-unit-msvc, r=wesleywiserbors-9/+87
debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled As already discovered in https://github.com/rust-lang/rust/commit/24a728a8eb4832568509eb757c2374934a76cb98, PDB does not play well with custom basic types. This PR extends to the fix to `()`: Instead of a custom basic type, we treat it like an empty tuple (i.e. it is described as a struct which happens to have no fields). Before this change anything with a `()` in it would cause trouble, which is especially bad for `*const ()` and `*mut ()` which are often used for opaque pointers. E.g. the test case added in this PR would look like: ``` 0:000> dx _ref Error: Unable to bind name '_ref' 0:000> dx _ptr Error: Unable to bind name '_ptr' 0:000> dx _local Error: Unable to bind name '_local' 0:000> dx _field,d _field,d [Type: unit_type::_TypeContainingUnitField] [+0x008] _a : 123 [Type: unsigned int] [+0x000] _unit : Unexpected failure to dereference object [+0x000] _b : 456 [Type: unsigned __int64] 0:000> dx ((__int64 *)_ptr),x Error: Unable to bind name '_ptr' ``` With the PR it produces the expected output: ``` 0:000> dx _ref _ref : 0x7ff6f2012230 : () [Type: tuple$<> *] 0:000> dx _ptr _ptr : 0x7e8ddffc20 : () [Type: tuple$<> *] 0:000> dx _local _local : () [Type: tuple$<>] 0:000> dx _field,d _field,d [Type: unit_type::_TypeContainingUnitField] [+0x008] _a : 123 [Type: unsigned int] [+0x000] _unit : () [Type: tuple$<>] [+0x000] _b : 456 [Type: unsigned __int64] 0:000> dx ((__int64 *)_ptr),x ((__int64 *)_ptr),x : 0x7e8ddffc20 : 0x1122334455667788 [Type: __int64 *] ``` r? `@wesleywiser`
2022-04-23Auto merge of #96314 - AronParker:issue-96297-fix, r=thomccbors-1/+7
Reduce allocations for path conversions on Windows Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.
2022-04-22Remove unnecessary const-time x87-related checksJubilee Young-32/+16
2022-04-22Fix comments for float classifyJubilee Young-5/+11
2022-04-23Auto merge of #94887 - dylni:move-normpath-crate-impl-to-libstd, r=ChrisDentonbors-57/+142
Improve Windows path prefix parsing This PR fixes improves parsing of Windows path prefixes. `parse_prefix` now supports both types of separators on Windows (`/` and `\`).
2022-04-22Auto merge of #95739 - lqd:proc-macro-expansions, r=wesleywiserbors-3/+49
self-profiler: record spans for proc-macro expansions This PR is a follow-up to #95473, using the arg recorder feature from #95689: - it adds support code to easily record spans in the event's arguments, when using `generic_activity_with_arg_recorder`. - uses that to record the spans where proc-macro expansions happen in addition to their name. As for the other 2 PRs, the goal here is to provide visibility into proc-macro expansion performance, so that users can diagnose which uses of proc-macros in their code could be causing compile time issues. Some areas where I'd love feedback: - [x] the API and names: the `SpannedEventArgRecorder` trait and its method, much like #95689 had the same question about the `EventArgRecorder` naming - [x] we don't currently have a way to record the names of the event arguments, so should `record_arg_spanned` record the span as "location: {}" or similar ?
2022-04-22Relax restrictions for copy operandsJakob Degen-3/+8
2022-04-22Auto merge of #96322 - matthiaskrgr:rollup-9xejxrf, r=matthiaskrgrbors-70/+94
Rollup of 3 pull requests Successful merges: - #96272 (Update `validate_uninhabited_zsts.rs` test after MIR building changes) - #96273 (Make `E0117` error clear) - #96315 (Make the lifetime accurate which is used in the region constraints part) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-22Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into ↵bjorn3-142/+189
sync_cg_clif-2022-04-22
2022-04-22Rollup merge of #96315 - SparrowLii:graph_lt, r=petrochenkovMatthias Krüger-6/+3
Make the lifetime accurate which is used in the region constraints part This PR fixes the FIXME about lifetime using in the region constraints part. We cannot write `<'graph, 'tcx, D>` because the definition of `Successors<'0, '1, D>` requires `'1 : '0`. We cannot add bound to `'graph` either because `'graph` is required to be an arbitrary value in the definition of `WithSuccessors` So the most accurate way is to use `<'s, 'tcx, D>`. cc `@Aaron1011` who added this FIXME in #85343
2022-04-22Rollup merge of #96273 - TaKO8Ki:make-E0117-error-clear, r=davidtwcoMatthias Krüger-30/+36
Make `E0117` error clear closes #96227
2022-04-22Rollup merge of #96272 - tmiasko:validate-uninhabited, r=RalfJungMatthias Krüger-34/+55
Update `validate_uninhabited_zsts.rs` test after MIR building changes to ensure that it still tests validation, instead of failing earlier on during evaluation. r? `@RalfJung`
2022-04-22Auto merge of #96301 - notriddle:notriddle/synthetic-impl-prim, r=GuillaumeGomezbors-4/+9
rustdoc: make primitive synthetic impls for correct doc module This improves the accuracy of libcore primitive docs, which was missing the blanket and auto impls for most primitive types. To test this, compare nightly [libcore::str] docs, which lack auto traits like Send, with [std::str] docs, which show them. [libcore::str]: https://doc.rust-lang.org/nightly/core/primitive.str.html [libstd::str]: https://doc.rust-lang.org/nightly/std/primitive.str.html It also avoids getting synthetic impls for primitive types on crates that do not actually show them. <details> <summary>Before and After trace logs</summary> ## Before [notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +nightly test.rs 2>&1 | grep -E 'get_blanket_impls\(' TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever) TRACE rustdoc::clean::blanket_impl get_blanket_impls(isize) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(char) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u128) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u16) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i128) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i16) TRACE rustdoc::clean::blanket_impl get_blanket_impls(str) TRACE rustdoc::clean::blanket_impl get_blanket_impls(str) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u8) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i8) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const T) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut T) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const [T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut [T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T; N]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(bool) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(usize) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i32) ## After [notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +dev test.rs 2>&1 | grep -E 'get_blanket_impls\(' TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever) </details>
2022-04-22start tracking proc-macros expansion spans in the self-profilerRémy Rakic-3/+12
2022-04-22extend `EventArgRecorder` into span-aware `SpannedEventArgRecorder`Rémy Rakic-0/+37
The self-profiler's `EventArgRecorder` is general-purpose in its ability to record Strings (and `rustc_span` depends on the crate its defined in, `rustc_data_structure`). Some generic activities could use recording locations where they happen in the user's code: to allow e.g. to track macro expansions and diagnose performance issues there. This adds a `SpannedEventArgRecorder` that can record an argument given as a span, rather than a String, since turning spans into Strings can be tricky if you're not happy with its default Debug output. This way the recorder can have a `record_arg_spanned` method which will do that.
2022-04-22Auto merge of #96226 - xldenis:thir-clone, r=oli-obkbors-12/+12
Make all thir types implement clone This PR adds `Clone` impl to all of the `Thir<'tcx>` types. I would like to be able to clone a `Thir` body so that I can make a copy in my rustc driver without breaking further compilation. Without this my driver is forced to run in the `after_expansion` callback and thus doesn't benefit from running all the safety checks that `rustc` usually does, instead i need to do them all myself.
2022-04-22debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo ↵Michael Woerister-9/+87
is enabled (instead of custom basic type).