about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-02-16rustdoc: search by macro when query ends with `!`Michael Howell-23/+132
Related to #96399
2023-02-16Auto merge of #108020 - nnethercote:opt-mk_region, r=compiler-errorsbors-186/+254
Optimize `mk_region` PR #107869 avoiding some interning under `mk_ty` by special-casing `Ty` variants with simple (integer) bodies. This PR does something similar for regions. r? `@compiler-errors`
2023-02-16Auto merge of #101841 - nnethercote:rm-save-analysis, r=Mark-Simulacrumbors-5215/+50
Remove save-analysis. Most tests involving save-analysis were removed, but I kept a few where the `-Zsave-analysis` was an add-on to the main thing being tested, rather than the main thing being tested. Closes https://github.com/rust-lang/rust/issues/43606
2023-02-16Auto merge of #108116 - Dylan-DPC:rollup-h3n2vxl, r=Dylan-DPCbors-234/+174
Rollup of 6 pull requests Successful merges: - #106372 (Use id-based thread parking on SOLID) - #108050 (Fix index out of bounds ICE in `point_at_expr_source_of_inferred_type`) - #108084 (Constify `RangeBounds`, `RangeX::contains` and `RangeX::is_empty` (where applicable).) - #108101 (don't clone types that are copy) - #108102 (simplify some refs) - #108103 (be nice and don't slice) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16Rollup merge of #108103 - matthiaskrgr:lice, r=compiler-errorsDylan DPC-2/+2
be nice and don't slice These are already slices, no need to slice them again
2023-02-16Rollup merge of #108102 - matthiaskrgr:ref, r=compiler-errorsDylan DPC-4/+4
simplify some refs
2023-02-16Rollup merge of #108101 - matthiaskrgr:noclonecopy, r=compiler-errorsDylan DPC-7/+6
don't clone types that are copy
2023-02-16Rollup merge of #108084 - ink-feather-org:const_range, r=dtolnayDylan DPC-40/+63
Constify `RangeBounds`, `RangeX::contains` and `RangeX::is_empty` (where applicable). cc `@fee1-dead` `@rustbot` label +T-libs-api -T-libs Tracking issue: #108082
2023-02-16Rollup merge of #108050 - martingms:issue-108042-fix, r=compiler-errorsDylan DPC-2/+59
Fix index out of bounds ICE in `point_at_expr_source_of_inferred_type` There might be more type params than args to a method call, which leads to an index out of bounds panic. I'm not familiar with this code at all, so unsure whether this is the right fix, but at least this patch fixes #108042 for me (I hit the same issue with similar code)
2023-02-16Rollup merge of #106372 - joboet:solid_id_parking, r=m-ou-seDylan DPC-179/+40
Use id-based thread parking on SOLID By using the [`slp_tsk`/`wup_tsk`](https://cs.uwaterloo.ca/~brecht/courses/702/Possible-Readings/embedded/uITRON-4.0-specification.pdf) system functions instead of an event-flag structure, `Parker` becomes cheaper to construct and SOLID can share the implementation used by NetBSD and SGX. ping ``@kawadakk`` r? ``@m-ou-se`` ``@rustbot`` label +T-libs
2023-02-16Remove save-analysis.Nicholas Nethercote-5215/+50
Most tests involving save-analysis were removed, but I kept a few where the `-Zsave-analysis` was an add-on to the main thing being tested, rather than the main thing being tested. For `x.py install`, the `rust-analysis` target has been removed. For `x.py dist`, the `rust-analysis` target has been kept in a degenerate form: it just produces a single file `reduced.json` indicating that save-analysis has been removed. This is necessary for rustup to keep working. Closes #43606.
2023-02-16Auto merge of #107449 - saethlin:enable-copyprop, r=oli-obkbors-267/+342
Enable CopyProp r? `@tmiasko` `@rustbot` label +A-mir-opt
2023-02-16Auto merge of #108096 - matthiaskrgr:rollup-ncexzf6, r=matthiaskrgrbors-779/+1121
Rollup of 10 pull requests Successful merges: - #107034 (Migrating rustc_infer to session diagnostics (part 4)) - #107972 (Fix unintentional UB in ui tests) - #108010 (Make `InferCtxt::can_eq` and `InferCtxt::can_sub` return booleans) - #108021 (make x look for x.py if shell script does not exist) - #108047 (Use `target` instead of `machine` for mir interpreter integer handling.) - #108049 (Don't suggest `#[doc(hidden)]` trait methods with matching return type) - #108066 (Better names for illegal impl trait positions) - #108076 (rustdoc: Use more let chain) - #108088 (clarify correctness of `black_box`) - #108094 (Demonstrate I/O in File examples) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16be nice and don't sliceMatthias Krüger-2/+2
These are already slices, no need to slice them again
2023-02-15simplify some refsMatthias Krüger-4/+4
2023-02-15don't clone types that are copyMatthias Krüger-7/+6
2023-02-15Auto merge of #108012 - compiler-errors:issue-107999, r=oli-obkbors-56/+116
Don't ICE in `might_permit_raw_init` if reference is polymorphic Emitting optimized MIR for a polymorphic function may require computing layout of a type that isn't (yet) known. This happens in the instcombine pass, for example. Let's fail gracefully in that condition. cc `@saethlin` fixes #107999
2023-02-15Rollup merge of #108094 - kornelski:fsdocs, r=cuviperMatthias Krüger-1/+19
Demonstrate I/O in File examples I've noticed that some Rust novices unnecessarily reinvent `std::fs::{read,write}`, presumably because they search for equivalents of `fopen` + `fwrite`. I've added links to `std::fs::{read,write}` in the docs. The `File` examples were only showing how to open a file, but not how to use the opened handle, unnecessarily leaving out the next step. I've added a variety of different uses of file handles to their examples in docs.
2023-02-15Rollup merge of #108088 - callumio:issue-107957, r=dtolnayMatthias Krüger-1/+2
clarify correctness of `black_box` Resolves #107957, as described in the related issue. No code changes, just documentation.
2023-02-15Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddleMatthias Krüger-251/+220
rustdoc: Use more let chain Got the idea after yesterday's review. r? `@notriddle`
2023-02-15Rollup merge of #108066 - compiler-errors:better-labels-for-bad-impl-trait, ↵Matthias Krüger-42/+67
r=petrochenkov Better names for illegal impl trait positions Just some wording tweaks, no behavior changes.
2023-02-15Rollup merge of #108049 - clubby789:dont-suggest-unstable, r=compiler-errorsMatthias Krüger-1/+38
Don't suggest `#[doc(hidden)]` trait methods with matching return type Fixes #107983, addressing the bad suggestion. The test can probably be made more specific to this case, but I'm unsure how. `@rustbot` label +A-diagnostics
2023-02-15Rollup merge of #108047 - oli-obk:machine->🞋, r=RalfJungMatthias Krüger-181/+181
Use `target` instead of `machine` for mir interpreter integer handling. The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform. As per https://github.com/rust-lang/rust/pull/108029#issuecomment-1429791015 r? `@RalfJung`
2023-02-15Rollup merge of #108021 - zephaniahong:oldx, r=albertlarsan68Matthias Krüger-16/+60
make x look for x.py if shell script does not exist Fixes #107907 Manually tested by doing the following after changes were made: 1. `cargo install --path src/tools/x` 2. checked out old version: commit hash `775c3c0` from https://github.com/rust-lang/rust/pull/99992 3. Ran `x --help` and it works. Previously, it was giving the error `x.py not found`
2023-02-15Rollup merge of #108010 - compiler-errors:can_eq-returns-bool, r=lcnrMatthias Krüger-43/+33
Make `InferCtxt::can_eq` and `InferCtxt::can_sub` return booleans Nobody matches on the result, nor does the result return anything useful...
2023-02-15Rollup merge of #107972 - saethlin:fix-test-ub, r=michaelwoeristerMatthias Krüger-12/+15
Fix unintentional UB in ui tests `@matthiaskrgr` found UB in a bunch of the ui tests. This PR fixes a batch of miscellaneous tests I didn't think needed reviewers from a particular part of the project.
2023-02-15Rollup merge of #107034 - IntQuant:issue-100717-infer-5, r=oli-obkMatthias Krüger-231/+486
Migrating rustc_infer to session diagnostics (part 4) `@rustbot` label +A-translation r? rust-lang/diagnostics cc https://github.com/rust-lang/rust/issues/100717
2023-02-15Suggest simpler fs helper methods in File::{open,create}Kornel-1/+10
2023-02-15Demonstrate I/O in File examplesKornel-0/+9
2023-02-15Skip method calls with arity mismatchMartin Gammelsæter-11/+8
2023-02-15Add point-at-inference ui test for wrong arity caseMartin Gammelsæter-0/+61
2023-02-15clarify correctness of `black_box`Callum Leslie-1/+2
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-773/+312
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
2023-02-15Constify `RangeBounds`, `RangeX::contains` and `RangeX::is_empty`.onestacked-40/+63
2023-02-15Fix unintentional UB in ui testsBen Kimock-12/+15
2023-02-15Don't suggest `#[doc(hidden)]` methodsclubby789-1/+38
2023-02-15Use more let chainGuillaume Gomez-251/+220
2023-02-15Use target instead of machine for mir interpreter integer handling.Oli Scherer-181/+181
The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform
2023-02-15Auto merge of #108070 - Dylan-DPC:rollup-v6xw7vk, r=Dylan-DPCbors-556/+1092
Rollup of 7 pull requests Successful merges: - #105300 (rework min_choice algorithm of member constraints) - #107163 (Remove some superfluous type parameters from layout.rs.) - #107173 (Suggest the correct array length on mismatch) - #107411 (Handle discriminant in DataflowConstProp) - #107968 (Enable `#[thread_local]` on armv6k-nintendo-3ds) - #108032 (Un📦ing the Resolver) - #108060 (Revert to using `RtlGenRandom` as a fallback) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-15make x look for x.py if shell script does not existZephaniah Ong-16/+60
bump up x version Refactor code
2023-02-15Rollup merge of #108060 - ChrisDenton:rtlgenrandom, r=thomccDylan DPC-103/+31
Revert to using `RtlGenRandom` as a fallback This is required due to `BCryptGenRandom` failing to load a dll it depends on. Fixes #108059
2023-02-15Rollup merge of #108032 - oli-obk:un📦ing_resolver, r=petrochenkovDylan DPC-177/+97
Un📦ing the Resolver r? `@petrochenkov` pulled out of https://github.com/rust-lang/rust/pull/105462
2023-02-15Rollup merge of #107968 - ian-h-chamberlain:feature/3ds-enable-thread-local, ↵Dylan DPC-2/+1
r=Nilstrieb Enable `#[thread_local]` on armv6k-nintendo-3ds Since [libctru 2.1.2](https://github.com/devkitPro/libctru/releases/tag/v2.1.2) was released we should now be able to use real `#[thread_local]` without corruption issues on the 3DS target. CC `@Meziu` `@AzureMarker` `@Techie-Pi` https://github.com/rust3ds/ctru-rs/issues/91#issuecomment-1426821450
2023-02-15Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obkDylan DPC-112/+408
Handle discriminant in DataflowConstProp cc ``@jachris`` r? ``@JakobDegen`` This PR attempts to extend the DataflowConstProp pass to handle propagation of discriminants. We handle this by adding 2 new variants to `TrackElem`: `TrackElem::Variant` for enum variants and `TrackElem::Discriminant` for the enum discriminant pseudo-place. The difficulty is that the enum discriminant and enum variants may alias each another. This is the issue of the `Option<NonZeroUsize>` test, which is the equivalent of https://github.com/rust-lang/unsafe-code-guidelines/issues/84 with a direct write. To handle that, we generalize the flood process to flood all the potentially aliasing places. In particular: - any write to `(PLACE as Variant)`, either direct or through a projection, floods `(PLACE as OtherVariant)` for all other variants and `discriminant(PLACE)`; - `SetDiscriminant(PLACE)` floods `(PLACE as Variant)` for each variant. This implies that flooding is not hierarchical any more, and that an assignment to a non-tracked place may need to flood a tracked place. This is handled by `for_each_aliasing_place` which generalizes `preorder_invoke`. As we deaggregate enums by putting `SetDiscriminant` last, this allows to propagate the value of the discriminant. This refactor will allow to make https://github.com/rust-lang/rust/pull/107009 able to handle discriminants too.
2023-02-15Rollup merge of #107173 - clubby789:suggest-array-length, r=compiler-errorsDylan DPC-2/+119
Suggest the correct array length on mismatch Fixes #107156 I wasn't able to find a way to get the `Span` for the actual array size unfortunately, so this suggestion can't be applied automatically. ``@rustbot`` label +A-diagnostics
2023-02-15Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8KiDylan DPC-149/+148
Remove some superfluous type parameters from layout.rs. Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-02-15Rollup merge of #105300 - aliemjay:member-lower, r=oli-obkDylan DPC-11/+288
rework min_choice algorithm of member constraints See [this comment](https://github.com/rust-lang/rust/pull/105300#issuecomment-1384312743) for the description of the new algorithm. Fixes #63033 Fixes #104639 This uses a more general algorithm than #89056 that doesn't treat `'static` as a special case. It thus accepts more code. For example: ```rust async fn test2<'s>(_: &'s u8, _: &'_ &'s u8, _: &'_ &'s u8) {} ``` I claim it's more correct as well because it fixes #104639. cc ``@nikomatsakis`` ``@lqd`` ``@tmandry`` ``@eholk`` ``@chenyukang`` ``@oli-obk`` r? types
2023-02-15Auto merge of #107940 - BoxyUwU:const_ty_assertion_use_semantic_equality, ↵bors-22/+240
r=compiler-errors use semantic equality for const param type equality assertion Fixes #107898 See added test for what caused this ICE --- The current in assertion in `relate.rs` is rather inadequate when keeping in mind future expansions to const generics: - it will ICE when there are infer vars in a projection in a const param ty - it will spurriously return false when either ty has infer vars because of using `==` instead of `infcx.at(..).eq` - i am also unsure if it would be possible with `adt_const_params` to craft a situation where the const param type is not wf causing `normalize_erasing_regions` to `bug!` when we would have emitted a diagnostic. This impl feels pretty Not Great to me although i am not sure what a better idea would be. - We have to have the logic behind a query because neither `relate.rs` or `combine.rs` have access to trait solving machinery (without evaluating nested obligations this assert will become _far_ less useful under lazy norm, which consts are already doing) - `relate.rs` does not have access to canonicalization machinery which is necessary in order to have types potentially containing infer vars in query arguments. We could possible add a method to `TypeRelation` to do this assertion rather than a query but to avoid implementing the same logic over and over we'd probably end up with the logic in a free function somewhere in `rustc_trait_selection` _anyway_ so I don't think that would be much better. We could also just remove this assertion, it should not actually be necessary for it to be present. It has caught some bugs in the past though so if possible I would like to keep it. r? `@compiler-errors`
2023-02-14Try to fix codegen tests for ??? LLVM 14 ???Ben Kimock-5/+5
2023-02-14Fix codegen testsBen Kimock-94/+94