about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-07-28Add #[track_caller] for some function in core::mem.Mara Bos-10/+2
These functions can panic for some types. This makes the panic point to the code that calls e.g. mem::uninitialized(), instead of inside the definition of mem::uninitialized.
2021-07-28Stabilize `arbitrary_enum_discriminant`Deadbeef-114/+8
2021-07-28Rollup merge of #87524 - FabianWolff:issue-87495, r=Aaron1011Yuki Okushi-0/+26
Fix ICE in `diagnostic_hir_wf_check` Fixes #87495. The [documentation for `ObligationCauseCode::WellFormed`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/traits/enum.ObligationCauseCode.html#variant.WellFormed) says that > it is always correct [...] to specify `WellFormed(None)` instead of `WellFormed(Some(...))`, which seems to have caused the issue here, as `diagnostic_hir_wf_check` does not expect to be called with an associated constant and will ICE: https://github.com/rust-lang/rust/blob/fd853c00e255559255885aadff9e93a1760c8728/compiler/rustc_typeck/src/hir_wf_check.rs#L131-L134 Therefore, I have changed `check_associated_item()` to pass a `WellFormed(None)` for associated constants. r? ``@Aaron1011``
2021-07-28Rollup merge of #87501 - spastorino:remove-min-tait, r=oli-obkYuki Okushi-5113/+938
Remove min_type_alias_impl_trait in favor of type_alias_impl_trait r? ``@oli-obk``
2021-07-28Rollup merge of #87453 - ibraheemdev:i-68697, r=wesleywiserYuki Okushi-22/+34
Suggest removing unnecessary &mut as help message Closes #68697
2021-07-28Auto merge of #86251 - Smittyvb:thir-tree-again, r=oli-obkbors-0/+59
Support -Z unpretty=thir-tree again Currently `-Z unpretty=thir-tree` is broken after some THIR refactorings. This re-implements it, making it easier to debug THIR-related issues. We have to do analyzes before getting the THIR, since trying to create THIR from invalid HIR can ICE. But doing those analyzes requires the THIR to be built and stolen. We work around this by creating a separate query to construct the THIR tree string representation. Closes https://github.com/rust-lang/project-thir-unsafeck/issues/8, fixes #85552.
2021-07-28Show discriminant before overflow in diagnostic.Maarten de Vries-5/+28
2021-07-28Auto merge of #86735 - jhpratt:rfc-3107, r=petrochenkovbors-42/+267
Implement RFC 3107: `#[derive(Default)]` on enums with a `#[default]` attribute This PR implements RFC 3107, which permits `#[derive(Default)]` on enums where a unit variant has a `#[default]` attribute. See comments for current status.
2021-07-28Fix ICE in `diagnostic_hir_wf_check`Fabian Wolff-0/+26
2021-07-27Update stderrAaron Hill-1/+11
2021-07-27Remove min_tait and full_tait stderr dangling filesSantiago Pastorino-5211/+0
2021-07-27Bless nll testsSantiago Pastorino-0/+79
2021-07-27Update testsJacob Pratt-422/+96
2021-07-27Prohibit `#[default]` in invalid placesJacob Pratt-26/+94
2021-07-27Permit deriving default on enums with `#[default]`Jacob Pratt-42/+199
2021-07-27Only emit lint for local macrosAaron Hill-0/+13
2021-07-27Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by defaultAaron Hill-26/+89
2021-07-27Add long explanation for E0498Chris Midgley-0/+2
2021-07-27Auto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnrbors-20/+167
Add hir::GenericArg::Infer In order to extend inference to consts, make an Infer type on hir::GenericArg.
2021-07-27remove allow(unconditional_recursion)ibraheemdev-3/+15
2021-07-27Remove min_type_alias_impl_trait featureSantiago Pastorino-168/+0
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-522/+2712
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-2252/+1187
2021-07-27Rollup merge of #87497 - midgleyc:long-E0544, r=GuillaumeGomezYuki Okushi-1/+1
Add long explanation for E0544. Helps with #61137
2021-07-27Rollup merge of #86764 - estebank:issue-86756, r=pnkfelixYuki Okushi-0/+58
Avoid ICE on type error recovery Fix #86756
2021-07-27Rollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelixYuki Okushi-5/+45
Add flag to configure `large_assignments` lint The `large_assignments` lints detects moves over specified limit. The limit is configured through `move_size_limit = "N"` attribute placed at the root of a crate. When attribute is absent, the lint is disabled. Make it possible to enable the lint without making any changes to the source code, through a new flag `-Zmove-size-limit=N`. For example, to detect moves exceeding 1023 bytes in a cargo crate, including all dependencies one could use: ``` $ env RUSTFLAGS=-Zmove-size-limit=1024 cargo build -vv ``` Lint tracking issue #83518.
2021-07-27Auto merge of #85305 - MarcusDunn:master, r=pnkfelixbors-278/+219
Stabilize bindings_after_at attempting to stabilze bindings_after_at [#65490](https://github.com/rust-lang/rust/issues/65490), im pretty new to the whole thing so any pointers are greatly appreciated.
2021-07-27Auto merge of #83491 - jyn514:remove-pretty, r=pnkfelixbors-5/+4
Remove unstable `--pretty` flag It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it. Closes https://github.com/rust-lang/rust/issues/36473.
2021-07-26Add long explanation for E0544.Chris Midgley-1/+1
2021-07-26Auto merge of #87480 - GuillaumeGomez:rollup-3ly8t5d, r=GuillaumeGomezbors-8/+94
Rollup of 8 pull requests Successful merges: - #87436 (Suggest `;` on parse error where applicable) - #87444 (Flatten nested `format!` calls) - #87447 (Miri: santiy check that null pointer can never have an AllocId) - #87457 (freebsd remove compiler workaround.) - #87458 (Fix help message for modification to &T created by &{t}) - #87464 (Remove unnecessary `structhead` parameter from `render_union`) - #87473 (Notify the Rust 2021 edition working group in zulip of edition bugs) - #87474 (Add missing whitespace after attribute in HTML template) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-26Actually infer args in visitorskadmin-7/+165
2021-07-26Integrate context into the memorial to AnnaJames Munns-6/+10
2021-07-26Mir borrowck does not generate lifetime variables for 'static lifetimes ↵Oli Scherer-0/+73
during opaque type resolution
2021-07-26Rollup merge of #87458 - ibraheemdev:help-msg-block-borrow, r=oli-obkGuillaume Gomez-1/+33
Fix help message for modification to &T created by &{t} Previous: ```rust error[E0594]: cannot assign to `*x` which is behind a `&` reference --> src/main.rs:3:5 | 2 | let x: &usize = &mut{0}; | ------- help: consider changing this to be a mutable reference: `&mut mut{0}` 3 | *x = 1; | ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written ```
2021-07-26Rollup merge of #87436 - ebobrow:suggest-semicolon, r=oli-obkGuillaume Gomez-7/+61
Suggest `;` on parse error where applicable fixes #87197
2021-07-26Add test for enum item tuple fields documentationGuillaume Gomez-4/+21
2021-07-262229: Don't capture preicese paths on top of a unionAman Arora-0/+90
- Accessing fields of a union require unsafe block - As part of 2229 we don't allow precision where we need an unsafe block to capture. Fixes: #87378 r? @nikomatsakis
2021-07-25Auto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, ↵bors-196/+196
r=GuillaumeGomez Rustdoc accessibility: use real headers for doc items Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25Rustdoc accessibility: use real headers for doc itemsbors-196/+196
Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25Add test for tuple struct documentation fieldsGuillaume Gomez-0/+19
2021-07-25Auto merge of #86595 - a1phyr:allocator_api_for_vecdeque, r=Amanieubors-2/+2
Add support for custom allocator in `VecDeque` This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections. `@rustbot` modify labels: +A-allocators +T-libs
2021-07-25Fix failing testBenoît du Garreau-2/+2
2021-07-25fix help message for modification to &T created by &{t}ibraheemdev-1/+33
2021-07-25Auto merge of #86438 - FabianWolff:issue-83693, r=jackh726bors-0/+87
Fix the ICE described in #83693 This pull request fixes #83693 and fixes #84768.
2021-07-25fix test/ui/borrowck/issue-33819ibraheemdev-1/+1
2021-07-25tidyibraheemdev-1/+1
2021-07-25suggest removing unnecessary \&mut as help messageibraheemdev-35/+35
2021-07-25Auto merge of #85646 - Moxinilian:separate-const-switch, r=cjgillotbors-0/+710
MIR opt: separate constant predecessors of a switch For each block S ending with a switch, this pass copies S for each of S's predecessors that seem to assign the value being switched over as a const. This is done using a somewhat simple heuristic to determine what seems to be a const transitively. More precisely, this is what the pass does: - find a block that ends in a switch - track if there is an unique place set before the current basic block that determines the result of the switch (this is the part that resolves switching over discriminants) - if there is, iterate over the parents that have a reasonable terminator and find if the found determining place is likely to be (transitively) set from a const within that parent block - if so, add the corresponding edge to a vector of edges to duplicate - once this is done, iterate over the found edges: copy the target block and replace the reference to the target block in the origin block with the new block This pass is not optimal and could probably duplicate in more cases, but the intention was mostly to address cases like in #85133 or #85365, to avoid creating new enums that get destroyed immediately afterwards (notably making the new try v2 `?` desugar zero-cost). A benefit of this pass working the way it does is that it is easy to ensure its correctness: the worst that can happen is for it to needlessly copy a basic block, which is likely to be destroyed by cleanup passes afterwards. The complex parts where aliasing matters are only heuristics and the hard work is left to further passes like ConstProp. # LLVM blocker Unfortunately, I believe it would be unwise to enable this optimization by default for now. Indeed, currently switch lowering passes like SimplifyCFG in LLVM lose the information on the set of possible variant values, which means it tends to actually generate worse code with this optimization enabled. A fix would have to be done in LLVM itself. This is something I also want to look into. I have opened [a bug report at the LLVM bug tracker](https://bugs.llvm.org/show_bug.cgi?id=50455). When this is done, I hope we can enable this pass by default. It should be fairly fast and I think it is beneficial in many cases. Notably, it should be a sound alternative to simplify-arm-identity. By the way, ConstProp only seems to pick up the optimization in functions that are not generic. This is however most likely an issue in ConstProp that I will look into afterwards. This is my first contribution to rustc, and I would like to thank everyone on the Zulip mir-opt chat for the help and support, and especially `@scottmcm` for the guidance.
2021-07-25Auto merge of #83723 - cjgillot:ownernode, r=petrochenkovbors-163/+163
Store all HIR owners in the same container This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem. This should allow for a more compact storage. Based on https://github.com/rust-lang/rust/pull/83114
2021-07-25Bless tests.Camille GILLOT-161/+161