about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-07-29Do not allow bad projection term to leak into the type checkerMichael Goulet-6/+41
2022-07-29check if T is sliceTakayuki Maeda-1/+1
fix msg
2022-07-29Auto merge of #99660 - PrestonFrom:issue_99265, r=compiler-errorsbors-24/+864
Generate correct suggestion with named arguments used positionally Address issue #99265 by checking each positionally used argument to see if the argument is named and adding a lint to use the name instead. This way, when named arguments are used positionally in a different order than their argument order, the suggested lint is correct. For example: ``` println!("{b} {}", a=1, b=2); ``` This will now generate the suggestion: ``` println!("{b} {a}", a=1, b=2); ``` Additionally, this check now also correctly replaces or inserts only where the positional argument is (or would be if implicit). Also, width and precision are replaced with their argument names when they exists. Since the issues were so closely related, this fix for issue #99265 also fixes issue #99266. Fixes #99265 Fixes #99266
2022-07-29fix ICE when computing codegen_fn_attrs on closure with non-fn parentMichael Goulet-0/+9
2022-07-28Remove guess_head_span.Camille GILLOT-56/+65
2022-07-28location-detail: disable all location details when passed `none`Hudson Ayers-0/+10
Prior to this fix, `-Z location-detail` provided no mechanism for disabling all location details. This commit also adds a test case to verify that this option continues to work as intended, and clarifies the documentation of this option.
2022-07-28Rollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-SimulacrumDylan DPC-6/+11
Fix PermissionDenied UI tests on WSL On my WSL with `appendWindowsPath=true`, running an invalid command returns `PermissionDenied` instead of `NotFound`, causing two UI tests to fail.
2022-07-28Rollup merge of #99689 - dtolnay:write, r=Mark-SimulacrumDylan DPC-16/+130
Revert `write!` and `writeln!` to late drop temporaries Closes (on master, but not on beta) #99684 by reverting the `write!` and `writeln!` parts of #96455. argument position | before<br>#94868 | after<br>#94868 | after<br>#96455 | after<br>this PR | desired<br>(unimplementable) --- |:---:|:---:|:---:|:---:|:---: `write!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late** `write!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺* `writeln!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late** `writeln!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺* `print!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺* `println!("…", $tmp)` | *early⸺* | **⸺late** | *early⸺* | *early⸺* | *early⸺* `eprint!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺* `eprintln!("…", $tmp)` | *early⸺* | **⸺late**| *early⸺* | *early⸺* | *early⸺* `panic!("…", $tmp)` | *early⸺* | *early⸺* | *early⸺* | *early⸺* | *early⸺* "Late drop" refers to dropping temporaries at the nearest semicolon **outside** of the macro invocation. "Early drop" refers to dropping temporaries inside of the macro invocation.
2022-07-28--bless testsMaybe Waffle-63/+119
2022-07-28orphan check: remove const generics fixmelcnr-0/+29
2022-07-28Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk"Oli Scherer-57/+47
This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf.
2022-07-28anonymize all bound vars, not just regionslcnr-0/+14
2022-07-28Rollup merge of #99714 - ouz-a:issue_57961, r=oli-obkDylan DPC-1/+18
Fix regression introduced with #99383 Fixes #99642
2022-07-28suggest adding/removing `ref` for binding patternsTakayuki Maeda-2/+111
2022-07-27add suggestion when there is a impl of external trait on pointerVincenzo Palazzo-0/+56
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-07-27safe transmute: reference tracking issueJack Wrenn-1/+14
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925266769
2022-07-27safe transmute: add `rustc_on_unimplemented` to `BikeshedIntrinsicFrom`Jack Wrenn-364/+482
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925266583
2022-07-27safe transmute: test to ensure that trait is correctly feature-gatedJack Wrenn-0/+17
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925265476
2022-07-27safe transmute: test when `ASSUME` params are passed indirectlyJack Wrenn-0/+73
ref: https://github.com/rust-lang/rust/pull/92268/files#r925258420
2022-07-27safe transmute: gracefully handle const params of wrong typesJack Wrenn-0/+67
ref: https://github.com/rust-lang/rust/pull/92268/files#r925244819
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-0/+3840
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-27Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkovGuillaume Gomez-0/+24
Clean up HIR-based lifetime resolution Based on https://github.com/rust-lang/rust/pull/97313. Fixes #98932. r? `@petrochenkov`
2022-07-27Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, ↵Guillaume Gomez-17/+71
r=oli-obk Deeply deny fn and raw ptrs in const generics I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter. We now reject both of these in the same way: ``` #![feature(adt_const_params)] #[derive(Eq, PartialEq)] struct Wrapper(); fn foo<const W: Wrapper>() {} fn foo2<const F: fn()>() {} ``` This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place. cc: ``@b-naber`` who introduced that test^ fixes #99641
2022-07-27Fix linkage-attr/issue-10755.rs ui test on WSLNilstrieb-1/+4
It checked for a "not found", but on WSL with appendWindowsPath=true, PermissionDenied is the error instead.
2022-07-27Fix process-spawn-nonexistent on WSLNilstrieb-5/+7
If appendWindowsPath is set to true (the default IIRC), running invalid commands returns PermissionDenied instead of NotFound.
2022-07-27add tests and commentouz-a-0/+15
2022-07-27Rollup merge of #99704 - fee1-dead-contrib:add_self_tilde_const_trait, r=oli-obkYuki Okushi-194/+164
Add `Self: ~const Trait` to traits with `#[const_trait]` r? `@oli-obk`
2022-07-27Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obkYuki Okushi-21/+20
Check that RPITs constrained by a recursive call in a closure are compatible Fixes #99073 Adapts a similar visitor pattern to `find_opaque_ty_constraints` (that we use to check TAITs), but with some changes: 0. Only walk the "OnlyBody" children, instead of all items in the RPIT's defining scope 1. Only walk through the body's children if we found a constraining usage 2. Don't actually do any inference, just do a comparison and error if they're mismatched ---- r? `@oli-obk` -- you know all this impl-trait stuff best... is this the right approach? I can explain the underlying issue better if you'd like, in case that might reveal a better solution. Not sure if it's possible to gather up the closure's defining usages of the RPIT while borrowck'ing the outer function, that might be a better place to put this check...
2022-07-27use check_region_obligations_and_report_errors in more places to avoid ICEsMichael Goulet-0/+27
2022-07-27Rollup merge of #99712 - davidtwco:translation-migrate-passes-2, ↵Yuki Okushi-6/+6
r=compiler-errors passes: port more of `check_attr` module Continues from #99213. Port more diagnostics in `rustc_passes::check_attr` to using the diagnostic derive and translation machinery. r? `@compiler-errors`
2022-07-27Rollup merge of #99698 - compiler-errors:no-doc-hidden, r=cjgillotYuki Okushi-0/+69
Prefer visibility map parents that are not `doc(hidden)` first Far simpler approach to #98876. This only fixes the case where the parent is `doc(hidden)`, not where the child is `doc(hidden)` since I don't know how to get the attrs on the import statement given a `ModChild`... I'll try to follow up with that, but this is a good first step.
2022-07-27Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by ↵est31-11/+5
default
2022-07-26Check that we do not ICE when anonymous lifetimes appear in AnonConst.Camille GILLOT-0/+24
Fixes #98932.
2022-07-26Rollup merge of #99758 - WaffleLapkin:remove_useless_allow, r=Dylan-DPCMatthias Krüger-1/+0
remove useless `#[allow]` in a test The mentioned issue, https://github.com/rust-lang/rust/issues/54586 was fixed 4 years ago :)
2022-07-26Fix diagnostics for unfulfilled obligationsDeadbeef-19/+1
2022-07-26bless tests, remove nonexistent E0395Deadbeef-194/+182
2022-07-26Improve error message for unstable default bodyMaybe Waffle-7/+13
2022-07-26Add tests for `#[rustc_default_body_unstable]`Maybe Waffle-0/+119
2022-07-26Lib kind -l link-arg:Daniil Belov-8/+38
arbitrary link argument like -C link-arg, but respecting relative order to other `-l` options, unstable
2022-07-26remove useless `#[allow]` in a testMaybe Waffle-1/+0
2022-07-26Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-deadDylan DPC-24/+24
Use full type name instead of just saying `impl Trait` in "captures lifetime" error I think this is very useful, especially when there's >1 `impl Trait`, and it just means passing around a bit more info that we already have access to.
2022-07-26Rollup merge of #99739 - nnethercote:rm-E0133, r=Dylan-DPCDylan DPC-8/+8
Remove erroneous E0133 code from an error message. This error message is about `derive` and `packed`, but E0133 is for "Unsafe code was used outside of an unsafe function or block". r? ``@estebank``
2022-07-26Rollup merge of #99692 - RalfJung:too-far, r=oli-obkDylan DPC-22/+103
interpret, ptr_offset_from: refactor and test too-far-apart check We didn't have any tests for the "too far apart" message, and indeed that check mostly relied on the in-bounds check and was otherwise probably not entirely correct... so I rewrote that check, and it is before the in-bounds check so we can test it separately.
2022-07-26Rollup merge of #99666 - compiler-errors:issue-99663, r=lcnrDylan DPC-1/+45
Restore `Opaque` behavior to coherence check Fixes #99663. This broke in 84c3fcd2a0285c06a682c9b064640084e4c7271b. I'm not exactly certain that adding this behavior back is necessarily correct, but at least the UI test I provided may stimulate some thoughts. I think delaying a bug here is certainly not correct in the case of opaques -- if we want to change coherence behavior for opaques, then we should at least be emitting a new error. r? ``@lcnr``
2022-07-26Rollup merge of #99618 - compiler-errors:uhh-idk, r=lcnrDylan DPC-43/+2
handle consts with param/infer in `const_eval_resolve` better This PR addresses [this thread here](https://github.com/rust-lang/rust/pull/99449#discussion_r924141230). Was this the change you were looking for ``@lcnr?`` Interestingly, one test has begun to pass. Was that expected? r? ``@lcnr``
2022-07-26Check that RPITs constrained by a recursive call in a closure are compatibleMichael Goulet-21/+20
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-24/+24
2022-07-26Rollup merge of #99593 - TaKO8Ki:suggest-removing-tuple-struct-field, ↵Yuki Okushi-0/+75
r=compiler-errors Suggest removing the tuple struct field for the unwrapped value fixes #99416
2022-07-26Rollup merge of #99353 - compiler-errors:gat-where-clause-mismatch, r=cjgillotYuki Okushi-32/+33
Slightly improve mismatched GAT where clause error This makes the error reporting a bit more standardized between `where` on GATs and functions. cc #99206 (`@BoxyUwU),` don't want to mark this as as "fixed" because they're still not perfect, but this is still an improvement IMO so I want to land it incrementally. regarding "consider adding where clause to trait definition", we don't actually do that for methods as far as i can tell? i could file an issue to look into that maybe.
2022-07-26Remove erroneous E0133 code from an error message.Nicholas Nethercote-8/+8
This error message is about `derive` and `packed`, but E0133 is for "Unsafe code was used outside of an unsafe function or block".