about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-04-27Auto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, ↵bors-2/+100
r=joshtriplett Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`. Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`, This addresses [this concern](https://github.com/rust-lang/rust/issues/87074#issuecomment-1080031167). This is the same as #95387. r? `@joshtriplett`
2022-04-27Auto merge of #96459 - Dylan-DPC:rollup-de6ud9d, r=Dylan-DPCbors-23/+268
Rollup of 6 pull requests Successful merges: - #92569 (Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts) - #96370 (Cleanup `report_method_error` a bit) - #96383 (Fix erased region escaping into wfcheck due to #95395) - #96385 (Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL) - #96410 (rustdoc: do not write `{{root}}` in `pub use ::foo` docs) - #96430 (Fix handling of `!` in rustdoc search) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-27Rollup merge of #96385 - ↵Dylan DPC-6/+128
marmeladema:nll-fix-trait-lifetime-bound-suggestions, r=jackh726 Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`. Fixes #96277 r? ```@jackh726```
2022-04-26Auto merge of #96425 - oli-obk:fix_incremental_regression_unsafety_checking, ↵bors-113/+148
r=compiler-errors Fix incremental perf regression unsafety checking Perf regression introduced in #96294 We will simply avoid emitting the name of the unsafe function in MIR unsafeck, since we're moving to THIR unsafeck anyway.
2022-04-26TidyGeorge-4/+4
2022-04-26Add new diagnosticGeorge-17/+140
2022-04-26Fix the filename in the expected error message.Dan Gohman-2/+2
2022-04-26Add `only-windows` versions of the coerce-issue-49593-box-never test.Dan Gohman-0/+97
2022-04-26Revert "add `DefId` to unsafety violations and display function path in E0133"Oli Scherer-113/+148
This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.
2022-04-26Rollup merge of #96372 - compiler-errors:field-method-suggest, r=oli-obkGuillaume Gomez-0/+56
Suggest calling method on nested field when struct is missing method Similar to the suggestion to change `x.field` to `x.nested.field`, implement a similar suggestion for when `x.method()` should be replaced with `x.nested.method()`.
2022-04-26Auto merge of #94034 - willcrichton:fix-trait-suggestion-for-binops, r=estebankbors-71/+62
Fix incorrect suggestion for trait bounds involving binary operators This PR fixes #93927, #92347, #93744 by replacing the bespoke trait-suggestion logic in `op.rs` with a more common code path. The downside is that this fix causes some suggestions to not include an `Output=` type, reducing their usefulness. Note that this causes one case in the `missing-bounds.rs` test to fail rustfix. So I would need to move that code into a separate non-fix test if this PR is otherwise acceptable.
2022-04-25Update unop path, fix testsWill Crichton-60/+12
2022-04-26Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPCbors-6/+128
Rollup of 6 pull requests Successful merges: - #90312 (Fix some confusing wording and improve slice-search-related docs) - #96149 (Remove unused macro rules) - #96279 (rustdoc: Remove .woff font files) - #96355 (Better handle too many `#` recovery in raw str) - #96379 (delay bug when adjusting `NeverToAny` twice during diagnostic code) - #96384 (do not consider two extern types to be similar) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-25Replace suggest_constraining_param with suggest_restricting_param_boundWill Crichton-12/+51
to fix incorrect suggestion for trait bounds involving binary operators. Fixes #93927, #92347, #93744.
2022-04-26Rollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errorsDylan DPC-0/+38
do not consider two extern types to be similar
2022-04-26Rollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errorsDylan DPC-0/+40
delay bug when adjusting `NeverToAny` twice during diagnostic code Addresses Issue 96335 (https://github.com/rust-lang/rust/issues/96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`. Fixes #96335
2022-04-26Rollup merge of #96355 - estebank:issue-95030, r=compiler-errorsDylan DPC-6/+50
Better handle too many `#` recovery in raw str Point at all the unnecessary trailing `#`. Better handle interaction with outer attributes when `;` is missing. Fix #95030.
2022-04-25Auto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obkbors-97/+101
Display function path in unsafety violations - E0133 adds `DefId` to `UnsafetyViolationDetails` this enables consumers to access the function definition that was reported to be unsafe and also changes the output for some E0133 diagnostics
2022-04-25avoid fully qualifying error output of issue-43733 testEmil Gardström-8/+10
2022-04-25Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLLmarmeladema-6/+128
2022-04-25do not consider two extern types to be similarlcnr-0/+38
2022-04-24Delay bug when adjusting NeverToAny twice during diagnosticPreston From-0/+40
2022-04-24suggestion if struct field has methodMichael Goulet-0/+56
2022-04-25Rollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726Matthias Krüger-470/+743
Use revisions instead of nll compare mode for `/regions/` ui tests Created https://github.com/rust-lang/rust/issues/96211 for the duplicated mismatched types errors r? `@jackh726`
2022-04-24Fix suggestion for `_` on return type for fn in impl for TraitMichael Goulet-23/+32
2022-04-24Suggest replacing `_` in type signature of impl for TraitMichael Goulet-6/+49
2022-04-24Use revisions instead of nll compare mode for `/regions/` ui testsmarmeladema-470/+743
2022-04-24only show a simple description in E0133 span labelEmil Gardström-63/+63
2022-04-24add `DefId` to unsafety violations and display function path in E0133Emil Gardström-158/+160
this enables consumers to access the function definition that was reported to be unsafe
2022-04-24Rollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, ↵Matthias Krüger-114/+201
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-24diagnostics: regression test for <usize as Iterator>::revMichael Howell-0/+20
Closes #90315
2022-04-24Bless testsmarmeladema-66/+136
2022-04-24Recover missing suggestion part under NLLmarmeladema-16/+22
2022-04-24Improve span for `consider adding an explicit lifetime bound` suggestions ↵marmeladema-32/+43
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-23Add support for `nounused` --extern flagJeremy Fitzhardinge-0/+23
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-23Better handle too many `#` recovery in raw strEsteban Küber-6/+50
Point at all the unnecessary trailing `#`. Better handle interaction with outer attributes when `;` is missing. Fix #95030.
2022-04-23Auto merge of #93970 - cjgillot:novis, r=petrochenkovbors-20/+30
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-2/+2
2022-04-23Fix lints.Camille GILLOT-18/+28
2022-04-23Auto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obkbors-6/+6
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-30/+181
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-22Rollup merge of #96273 - TaKO8Ki:make-E0117-error-clear, r=davidtwcoMatthias Krüger-28/+28
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 #96197 - erikdesjardins:scalarpairenum, r=oli-obkbors-0/+774
Mark payload fields of ScalarPair enums as Scalar::Union when they're not always initialized Fixes #96158 r? `@RalfJung`
2022-04-22normalize out pref_align (copied from another test)Erik Desjardins-56/+23
2022-04-22Auto merge of #96144 - c410-f3r:z-errors, r=petrochenkovbors-0/+0
Move some tests to more reasonable places cc #73494 r? `@petrochenkov`
2022-04-21Update `validate_uninhabited_zsts.rs` test after MIR building changesTomasz Miąsko-34/+55
to ensure that it still tests validation, instead of failing earlier on during evaluation.
2022-04-21Move some tests to more reasonable directoriesCaio-0/+0
2022-04-21make `E0117` error clearTakayuki Maeda-28/+28
2022-04-21Rollup merge of #96236 - Aaron1011:constraint-debug, r=jackh726Dylan DPC-45/+17
Add an explicit `Span` field to `OutlivesConstraint` Previously, we would retrieve the span from the `Body` using the `locations` field. However, we may end up changing the `locations` field when moving a constraint from a promoted to a different body. We now store the original `Span` in a dedication field, so that changes to the `locations` do not affect the quality of our diagnostics.