about summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2021-12-12Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnrbors-1/+1
Stabilise `feature(const_generics_defaults)` `feature(const_generics_defaults)` is complete implementation wise and has a pretty extensive test suite so I think is ready for stabilisation. needs stabilisation report and maybe an RFC :sweat_smile: r? `@lcnr` cc `@rust-lang/project-const-generics`
2021-12-12add regression test for #91489SNCPlay42-0/+40
2021-12-11Auto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obkbors-16/+31
Tweak assoc type obligation spans * Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors r? `@oli-obk` This is a(n uncontroversial) subset of #85799.
2021-12-11Rollup merge of #89734 - estebank:issue-72312, r=nikomatsakisMatthias Krüger-2/+2
Point at capture points for non-`'static` reference crossing a `yield` point ``` error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement --> $DIR/issue-72312.rs:10:24 | LL | pub async fn start(&self) { | ^^^^^ this data with an anonymous lifetime `'_`... ... LL | require_static(async move { | -------------- ...is required to live as long as `'static` here... LL | &self; | ----- ...and is captured here | note: `'static` lifetime requirement introduced by this trait bound --> $DIR/issue-72312.rs:2:22 | LL | fn require_static<T: 'static>(val: T) -> T { | ^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0759`. ``` Fix #72312.
2021-12-11Rollup merge of #91373 - djkoloski:fuchsia_test_suite, r=Mark-SimulacrumMatthias Krüger-0/+8
Add needs-unwind to tests that depend on panicking These tests were found by running the test suite on fuchsia which compiles with `panic=abort` by default, then picking through the failures manually to locate the tests that require unwinding support. Most of these tests are already opted-out on platforms that compile with `panic=abort` by default. This just generalizes it a bit more so that fuchsia tests can be run properly. Currently, the `needs-unwind` directive needs to be manually passed to compiletest (e.g. via `--test-args '--target-panic=abort'`). Eventually, I would like `x.py` or compiletest to determine whether the directive should be used automatically based on the target panic settings.
2021-12-11Tweak assoc type obligation spansEsteban Kuber-16/+31
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-12-10Rollup merge of #91470 - wesleywiser:code_coverage_link_error, r=tmandryMatthias Krüger-0/+27
code-cov: generate dead functions with private/default linkage As discovered in #85461, the MSVC linker treats weak symbols slightly differently than unix-y linkers do. This causes link.exe to fail with LNK1227 "conflicting weak extern definition" where as other targets are able to link successfully. This changes the dead functions from being generated as weak/hidden to private/default which, as the LLVM reference says: > Global values with “private” linkage are only directly accessible by objects in the current module. In particular, linking code into a module with a private global value may cause the private to be renamed as necessary to avoid collisions. Because the symbol is private to the module, all references can be updated. This doesn’t show up in any symbol table in the object file. This fixes the conflicting weak symbols but doesn't address the reason *why* we have conflicting symbols for these dead functions. The test cases added in this commit contain a minimal repro of the fundamental issue which is that the logic used to decide what dead code functions should be codegen'd in the current CGU doesn't take into account that functions can be duplicated across multiple CGUs (for instance, in the case of `#[inline(always)]` functions). Fixing that is likely to be a more complex change (see https://github.com/rust-lang/rust/issues/85461#issuecomment-985005805). Fixes #85461
2021-12-10bless testsEllen-1/+1
2021-12-10fix tests after rebaseEsteban Kuber-1/+1
2021-12-10Tweak wordingEsteban Kuber-1/+1
2021-12-10Clean up visual output logicEsteban Kuber-1/+1
2021-12-09Add needs-unwind to tests that depend on panickingDavid Koloski-0/+8
This directive isn't automatically set by compiletest or x.py, but can be turned on manually for targets that require it.
2021-12-07Rollup merge of #91503 - estebank:call-fn-span, r=michaelwoeristerMatthias Krüger-5/+16
Tweak "call this function" suggestion to have smaller span
2021-12-04Use multipart suggestions.Camille GILLOT-4/+21
2021-12-04Lint bare traits in AstConv.Camille GILLOT-4/+39
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-14/+90
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03Tweak "call this function" suggestion to have smaller spanEsteban Kuber-5/+16
2021-12-03Annotate `derive`d spans and move span suggestion codeEsteban Kuber-2/+2
* Annotate `derive`d spans from the user's code with the appropciate context * Add `Span::can_be_used_for_suggestion` to query if the underlying span at the users' code
2021-12-03Keep spans for generics in `#[derive(_)]` desugaringEsteban Kuber-14/+90
Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03code-cov: generate dead functions with private/default linkageWesley Wiser-0/+27
As discovered in #85461, the MSVC linker treats weak symbols slightly differently than unix-y linkers do. This causes link.exe to fail with LNK1227 "conflicting weak extern definition" where as other targets are able to link successfully. This changes the dead functions from being generated as weak/hidden to private/default which, as the LLVM reference says: > Global values with “private” linkage are only directly accessible by objects in the current module. In particular, linking code into a module with a private global value may cause the private to be renamed as necessary to avoid collisions. Because the symbol is private to the module, all references can be updated. This doesn’t show up in any symbol table in the object file. This fixes the conflicting weak symbols but doesn't address the reason *why* we have conflicting symbols for these dead functions. The test cases added in this commit contain a minimal repro of the fundamental issue which is that the logic used to decide what dead code functions should be codegen'd in the current CGU doesn't take into account that functions can be duplicated across multiple CGUs (for instance, in the case of `#[inline(always)]` functions). Fixing that is likely to be a more complex change (see https://github.com/rust-lang/rust/issues/85461#issuecomment-985005805). Fixes #85461
2021-12-03Rollup merge of #90854 - sanxiyn:unsized-and-uninhabited, r=estebankMatthias Krüger-0/+21
Type can be unsized and uninhabited Fix #88150.
2021-12-01Stop treating extern crate loading failures as fatal errorsMichael-3/+19
2021-11-28Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillotMatthias Krüger-0/+4
Fix a format_args span to be expansion I found this while exploring solutions for rust-lang/rust-clippy#7843. r? `@m-ou-se`
2021-11-28Rollup merge of #91251 - oli-obk:wf_sync_statics, r=matthewjasperMatthias Krüger-53/+54
Perform Sync check on static items in wf-check instead of during const checks r? `@RalfJung` This check is solely happening on the signature of the static item and not on its body, therefor it belongs into wf-checking instead of const checking.
2021-11-27Only check for errors in predicate when skipping impl assemblyAaron Hill-8/+9
Prior to PR #91205, checking for errors in the overall obligation would check checking the `ParamEnv`, due to an incorrect `super_visit_with` impl. With this bug fixed, we will now bail out of impl candidate assembly if the `ParamEnv` contains any error types. In practice, this appears to be overly conservative - when an error occurs early in compilation, we end up giving up early for some predicates that we could have successfully evaluated without overflow. By only checking for errors in the predicate itself, we avoid causing additional spurious 'type annotations needed' errors after a 'real' error has already occurred. With this PR, the diagnostic changes caused by PR #91205 are reverted.
2021-11-27regression test for issue 87490cameron-0/+24
2021-11-26Perform Sync check on static items in wf-check instead of during const checksOli Scherer-53/+54
2021-11-26Auto merge of #91205 - Aaron1011:visit_param_env, r=lcnrbors-9/+8
Visit `param_env` field in Obligation's `TypeFoldable` impl This oversight appears to have gone unnoticed for a long time without causing issues, but it should still be fixed.
2021-11-26Auto merge of #85102 - estebank:point-at-assignment, r=oli-obkbors-61/+67
Diagnostic tweaks * On type mismatch caused by assignment, point at the source of the expectation * Hide redundant errors * Suggest `while let` when `let` is missing in some cases
2021-11-25Visit `param_env` field in Obligation's `TypeFoldable` implAaron Hill-9/+8
This oversight appears to have gone unnoticed for a long time without causing issues, but it should still be fixed.
2021-11-25On type mismatch caused by assignment, point at assigneeEsteban Küber-61/+67
* Do not emit unnecessary E0308 after E0070 * Show fewer errors on `while let` missing `let` * Hide redundant E0308 on `while let` missing `let` * Point at binding definition when possible on invalid assignment * do not point at closure twice * do not suggest `if let` for literals in lhs * account for parameter types
2021-11-23Fix printing unit return ty, don't elaborate FnOnce unless we see itMichael Goulet-4/+4
2021-11-23Update test outputsMichael Goulet-4/+4
2021-11-21Simplify for loop desugarCameron Steffen-14/+3
2021-11-21Auto merge of #91104 - matthiaskrgr:rollup-duk33o1, r=matthiaskrgrbors-0/+4
Rollup of 4 pull requests Successful merges: - #91008 (Adds IEEE 754-2019 minimun and maximum functions for f32/f64) - #91070 (Make `LLVMRustGetOrInsertGlobal` always return a `GlobalVariable`) - #91097 (Add spaces in opaque `impl Trait` with more than one trait) - #91098 (Don't suggest certain fixups (`.field`, `.await`, etc) when reporting errors while matching on arrays ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-20Use same_type_modulo_infer in more placesMichael Goulet-0/+4
2021-11-20Move tests for missing trait bounds to their own directoryEsteban Kuber-95/+0
2021-11-20Suggest constraining `fn` type params when appropriateEsteban Kuber-2/+39
2021-11-20Do not mention associated items when they introduce an obligationEsteban Kuber-181/+0
2021-11-20Point at bounds when comparing impl items to traitEsteban Kuber-11/+7
2021-11-20Point at source of trait bound obligations in more placesEsteban Kuber-63/+126
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
2021-11-20Rollup merge of #90575 - m-ou-se:compatible-variant-improvements, r=estebankMatthias Krüger-2/+2
Improve suggestions for compatible variants on type mismatch. Fixes #90553. Before: ![image](https://user-images.githubusercontent.com/783247/140385675-6ff41090-eca2-41bc-b161-99c5dabfec61.png) After: ![image](https://user-images.githubusercontent.com/783247/140385748-20cf26b5-ea96-4e56-8af2-5fe1ab16fd3b.png) r? `````@estebank`````
2021-11-16Update tests.Mara Bos-2/+2
2021-11-14Improve diagnostics when a static lifetime is expectedLucas Kent-4/+16
2021-11-13Type can be unsized and uninhabitedSeo Sanghyeon-0/+21
2021-11-10no overlap errors after failing the orphan checklcnr-22/+11
2021-11-09Auto merge of #87337 - jyn514:lint-error, r=oli-obk,flip1995bors-1/+10
Don't abort compilation after giving a lint error The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors. Closes https://github.com/rust-lang/rust/issues/82761. This is a WIP because I have a feeling it will exit with 0 even if there were lint errors; I don't have a computer that can build rustc locally at the moment.
2021-11-08Auto merge of #89488 - c410-f3r:testsssssss, r=petrochenkovbors-3788/+0
Move some tests to more reasonable directories - 8 cc #73494 r? `@petrochenkov`
2021-11-08Don't abort compilation after giving a lint errorJoshua Nelson-1/+10
The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors.
2021-11-06Move some tests to more reasonable directoriesCaio-3788/+0