about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-07-15Auto merge of #99288 - Aaron1011:stable-intrinsics, r=yaahcbors-0/+17
Mark stabilized intrinsics with `rustc_allowed_through_unstable_modules` Fixes #99286 PR #95956 accidentally made these intrinsics unstable when accessed through the unstable path segment 'std::intrinsics'
2022-07-15Move tests to fit in limitEsteban Küber-0/+0
2022-07-15Avoid incorrect suggestionEsteban Küber-18/+5
We check that there's a single level of block nesting to ensure always correct suggestions. If we don't, then we only provide a free-form message to avoid misleading users in cases like `src/test/ui/nll/borrowed-temporary-error.rs`. We could expand the analysis to suggest hoising all of the relevant parts of the users' code to make the code compile, but that could be too much.
2022-07-15Provide structured suggestion for dropped temp valueEsteban Küber-34/+173
2022-07-15Fix ICE in named_arguments_used_positionally lintMichael Goulet-0/+17
2022-07-15Revert "Highlight conflicting param-env candidates"Michael Goulet-34/+5
This reverts commit 08135254dcf22be0d5661ea8f75e703b29a83514.
2022-07-15Auto merge of #99015 - lcnr:fn-ctxt-no-more, r=compiler-errorsbors-42/+9
stop using `FnCtxt` outside of hir typeck the requirements between **hir typeck**™, and **not hir typeck**™ are different enough to warrant a full split. with this PR `FnCtxt` is now only used for hir typeck (and for one clippy lint which seems to be emulating hir typeck). Once this PR has landed I intend to move `FnCtxt` into a new crate. This should also allow some further general improvements here. r? rust-lang/types
2022-07-15Mark stabilized intrinsics with `rustc_allowed_through_unstable_modules`Aaron Hill-0/+17
Fixes #99286 PR #95956 accidentally made these intrinsics unstable when accessed through the unstable path segment 'std::intrinsics'
2022-07-15Infer wildcard type from other patterns at every pattern levelOli Scherer-0/+41
2022-07-15Make destructuring a defining useOli Scherer-0/+12
2022-07-15Allow destructuring opaque types, since the patterns constrain the opaque typesOli Scherer-24/+78
2022-07-15passes: migrate half of `check_attr`David Wood-74/+74
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-15provide `generic_param_scope` for region errorslcnr-91/+96
2022-07-15try to avoid `FnCtxt` during wflcnr-90/+54
2022-07-15remove `impl_implied_bounds` from `FnCtxt`lcnr-5/+3
2022-07-15Auto merge of #99046 - nnethercote:final-derive-output-improvements, ↵bors-255/+432
r=Mark-Simulacrum Final derive output improvements With all these changes, the derive output in `deriving-all-codegen.stdout` is pretty close to optimal, i.e. very similar to what you'd write by hand. r? `@ghost`
2022-07-15Rollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods, ↵Dylan DPC-31/+72
r=cjgillot Refactor: remove a string matching about methods This patch remove a string matching about methods and adds some rustfix tests.
2022-07-15Rollup merge of #98869 - compiler-errors:stop_guessing_head_span, r=cjgillotDylan DPC-123/+91
Remove some usages of `guess_head_span` No need to pass things through `guess_head_span` if they already point to the head span. Only major change is that we point to the head span of `enum`s on some errors now, which I prefer. r? `@cjgillot`
2022-07-15add `#[must_use]` to `Box::from_raw`rhysd-0/+26
2022-07-15Auto merge of #99267 - Dylan-DPC:rollup-d8l7y1o, r=Dylan-DPCbors-16/+153
Rollup of 6 pull requests Successful merges: - #99113 (Simplify [a]rc code a little) - #99131 (Add label for generic arg (+ APIT) and RPIT callables in `label_fn_like`) - #99237 (removed unused CSS and unused HTML IDs) - #99239 (Add myself to the set of people notified when MIR changes.) - #99241 (Remove comment referring to constness.rs) - #99257 (Add regression test for #89436) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-15Rollup merge of #99257 - Manishearth:regression, r=jackh726Dylan DPC-0/+44
Add regression test for #89436 I never got around to adding such a test. In general I think the `yoke` crate has a bunch of interesting testcases that exercise various edges of the algorithms here, it would be nice if we could simply depend on the crate and add some tests that exercise it, but I don't think that's possible. Do you or `@eddyb` think there's any use trying to upstream a bunch of common yoke minimal working example code to the testsuite and having a ton of yoke tests?
2022-07-15Rollup merge of #99131 - compiler-errors:label-fn, r=cjgillotDylan DPC-16/+109
Add label for generic arg (+ APIT) and RPIT callables in `label_fn_like` Fixes #98308
2022-07-15Auto merge of #97406 - aliemjay:verify-bounds-fix-master, r=oli-obkbors-0/+62
Make outlives::{components,verify} agree fixes #97405 cc `@oli-obk` this is should fix https://github.com/rust-lang/rust/pull/95474#discussion_r880660075 r? `@oli-obk`
2022-07-15Move item_span from check_item_type into each functionMichael Goulet-5/+5
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-2/+6
2022-07-15Remove some usages of guess_head_span from typeckMichael Goulet-4/+4
2022-07-15Make item spans more consistentMichael Goulet-112/+76
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-196/+196
r=cjgillot gather body owners Issue #96341
2022-07-14Point out custom Fn-family trait implMichael Goulet-0/+16
2022-07-14Add support for APIT and RPIT callables in label_fn_likeMichael Goulet-20/+97
2022-07-14Add regression test for #89436Manish Goregaokar-0/+44
2022-07-14Use constant eval to do strict validity checks5225225-22/+44
2022-07-14Auto merge of #99242 - Dylan-DPC:rollup-34bqdh8, r=Dylan-DPCbors-9/+285
Rollup of 6 pull requests Successful merges: - #98072 (Add provider API to error trait) - #98580 (Emit warning when named arguments are used positionally in format) - #99000 (Move abstract const to middle) - #99192 (Fix spans for asm diagnostics) - #99222 (Better error message for generic_const_exprs inference failure) - #99236 (solaris: unbreak build on native platform) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Rollup merge of #99222 - atsuzaki:generic_const_err, r=lcnrDylan DPC-7/+10
Better error message for generic_const_exprs inference failure Fixes #90531 This code: ```rs #![feature(generic_const_exprs)] fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} fn main() { let arr = [5; 5]; foo(arr); } ``` Will now emit the following error: ```rs warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> test.rs:1:12 | 1 | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information error[E0284]: type annotations needed --> test.rs:8:7 | 8 | foo(arr); | ^^^ cannot infer the value of the const parameter `N` declared on the function `foo` | note: required by a bound in `foo` --> test.rs:3:56 | 3 | fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {} | ^^^^^ required by this bound in `foo` help: consider specifying the generic argument | 8 | foo::<N>(arr); | +++++ error: aborting due to previous error; 1 warning emitted ``` cc: `@lcnr` thanks a lot again for the help on this
2022-07-14Rollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkovDylan DPC-2/+40
Fix spans for asm diagnostics Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-0/+36
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-14Rollup merge of #98580 - PrestonFrom:issue_98466, r=estebankDylan DPC-0/+199
Emit warning when named arguments are used positionally in format Addresses Issue 98466 by emitting an error if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-14Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillotbors-15/+195
Support unstable moves via stable in unstable items part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328. The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge. This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-43/+407
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-14Fix spans for asm diagnosticsAmanieu d'Antras-2/+40
Line spans were incorrect if the first line of an asm statement was an empty string.
2022-07-14Fix overlapping implskadmin-0/+36
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-9/+287
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-14Rollup merge of #97720 - cjgillot:all-fresh, r=petrochenkovDylan DPC-34/+120
Always create elided lifetime parameters for functions Anonymous and elided lifetimes in functions are sometimes (async fns) --and sometimes not (regular fns)-- desugared to implicit generic parameters. This difference of treatment makes it some downstream analyses more complicated to handle. This step is a pre-requisite to perform lifetime elision resolution on AST. There is currently an inconsistency in the treatment of argument-position impl-trait for functions and async fns: ```rust trait Foo<'a> {} fn foo(t: impl Foo<'_>) {} //~ ERROR missing lifetime specifier async fn async_foo(t: impl Foo<'_>) {} //~ OK fn bar(t: impl Iterator<Item = &'_ u8>) {} //~ ERROR missing lifetime specifier async fn async_bar(t: impl Iterator<Item = &'_ u8>) {} //~ OK ``` The current implementation reports "missing lifetime specifier" on `foo`, but **accepts it** in `async_foo`. This PR **proposes to accept** the anonymous lifetime in both cases as an extra generic lifetime parameter. This change would be insta-stable, so let's ping t-lang. Anonymous lifetimes in GAT bindings keep being forbidden: ```rust fn foo(t: impl Foo<Assoc<'_> = Bar<'_>>) {} ^^ ^^ forbidden ok ``` I started a discussion here: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Anonymous.20lifetimes.20in.20universal.20impl-trait/near/284968606 r? ``@petrochenkov``
2022-07-14Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiserbors-1/+1
Rename `debugging_opts` to `unstable_opts` This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-14Auto merge of #98754 - jyn514:non-trivial-drop, r=compiler-errorsbors-32/+344
Fix drop-tracking ICE when a struct containing a field with a significant drop is used across an await Previously, drop-tracking would incorrectly assume the struct would be dropped immediately, which was not true. Fixes #98476. Also fixes https://github.com/rust-lang/rust/issues/98477, I think because the parent HIR node for type variables is the whole function instead of the expression where the variable is used. r? `@eholk`
2022-07-13Update testsKatherine Philip-7/+10
2022-07-14bless testsAli MJ Al-Nasrawy-21/+6
2022-07-14Make outlives::{components,verify} agreeAli MJ Al-Nasrawy-0/+77
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13add array tests, cleanup, tidy, and blessRalf Jung-11/+30