about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-06-22Rollup merge of #98199 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-0/+0
Move some tests to more reasonable directories r? `@petrochenkov`
2022-06-22Rollup merge of #97867 - lcnr:lub-binder, r=oli-obkYuki Okushi-0/+181
lub: don't bail out due to empty binders allows for the following to compile. The equivalent code using `struct Wrapper<'upper>(fn(&'upper ());` already compiles on stable. ```rust let _: fn(&'upper ()) = match v { true => lt_in_fn::<'a>(), false => lt_in_fn::<'b>(), }; ``` see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7034a677190110941223cafac6632f70 for a complete example r? ```@rust-lang/types```
2022-06-21Perform wf checking per module.Camille GILLOT-3/+3
2022-06-21Only keep a single well-formed query.Camille GILLOT-262/+146
2022-06-21Always create parameters for functions-like types.Camille GILLOT-36/+46
2022-06-21Add UI test for `cfg!(foo, bar)`beetrees-1/+10
2022-06-21[RFC 2011] Optimize non-consuming operatorsCaio-38/+179
2022-06-21Auto merge of #98335 - JohnTitor:rollup-j2zudxv, r=JohnTitorbors-1/+64
Rollup of 11 pull requests Successful merges: - #94033 (Improve docs for `is_running` to explain use case) - #97269 (adjust transmute const stabilization version) - #97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting) - #98022 (Fix erroneous span for borrowck error) - #98124 (Improve loading of crates.js and sidebar-items.js) - #98278 (Some token stream cleanups) - #98306 (`try_fold_unevaluated` for infallible folders) - #98313 (Remove lies in comments.) - #98323 (:arrow_up: rust-analyzer) - #98329 (Avoid an ICE and instead let the compiler report a useful error) - #98330 (update ioslice docs to use shared slices) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-21Move some tests to more reasonable directoriesCaio-0/+0
2022-06-21Remove `#[doc(hidden)]` logic from `unused_attributes` lintLeón Orell Valerian Liehr-177/+0
2022-06-21Rollup merge of #98329 - oli-obk:fast_path_ice, r=cjgillotYuki Okushi-0/+27
Avoid an ICE and instead let the compiler report a useful error Fixes #98299
2022-06-21Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obkYuki Okushi-1/+37
Fix erroneous span for borrowck error I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead. Fixes #97997 The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant. There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
2022-06-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-8/+10
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-21Add a full regression test for #73727Yuki Okushi-7/+15
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-21Avoid an ICE and instead let the compiler report a useful errorOli Scherer-0/+27
2022-06-20Provide a segment res in more casesMichael Goulet-115/+115
2022-06-20Give name if anonymous region appears in impl signatureMichael Goulet-0/+69
2022-06-21Auto merge of #98148 - c410-f3r:assert-compiler, r=oli-obkbors-0/+42
[RFC 2011] Expand expressions where possible Tracking issue: https://github.com/rust-lang/rust/issues/44838 Fourth step of https://github.com/rust-lang/rust/pull/96496 Extends https://github.com/rust-lang/rust/pull/97665 considering expressions that are good candidates for expansion. r? `@oli-obk`
2022-06-20Rollup merge of #98276 - compiler-errors:const-format-macro, r=oli-obkMatthias Krüger-0/+99
Mention formatting macros when encountering `ArgumentV1` method in const Also open to just closing this if it's overkill. There are a lot of other distracting error messages around, so maybe it's not worth fixing just this one. Fixes #93665
2022-06-20Rollup merge of #98267 - compiler-errors:suggest-wildcard-arm, r=oli-obkMatthias Krüger-261/+210
Don't omit comma when suggesting wildcard arm after macro expr * Also adds `Span::eq_ctxt` to consolidate the various usages of `span.ctxt() == other.ctxt()` * Also fixes an unhygenic usage of spans which caused the suggestion to render weirdly when we had one arm match in a macro * Also always suggests a comma (i.e. even after a block) if we're rendering a wildcard arm in a single-line match (looks prettier :rose:) Fixes #94866
2022-06-20Rollup merge of #98159 - PrestonFrom:issue_95665, r=petrochenkovDylan DPC-0/+33
Include ForeignItem when visiting types for WF check Addresses Issue 95665 by including `hir::Node::ForeignItem` as a valid type to visit in `diagnostic_hir_wf_check`. Fixes #95665
2022-06-20Auto merge of #98284 - JohnTitor:rollup-7lbs143, r=JohnTitorbors-85/+160
Rollup of 5 pull requests Successful merges: - #98183 (Fix pretty printing of empty bound lists in where-clause) - #98268 (Improve `lifetime arguments are not allowed on` error message) - #98273 (Fix minor documentation typo) - #98274 (Minor improvements on error for `Self` type in items that don't allow it) - #98281 (Fix typo in `HashMap::drain` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-20Rollup merge of #98274 - compiler-errors:self-type-error, r=cjgillotYuki Okushi-20/+95
Minor improvements on error for `Self` type in items that don't allow it Fixes #93796
2022-06-20point at private fields in struct literalTakayuki Maeda-6/+65
2022-06-19Include ForeignItem when visiting types for WF checkPreston From-0/+33
Addresses Issue 95665 by including `hir::Node::ForeignItem` as a valid type to visit in `diagnostic_hir_wf_check`. Fixes #95665
2022-06-19Mention formatting macros when encountering ArgumentV1::new in constMichael Goulet-0/+99
2022-06-19Don't suggest adding Self as a type parameterMichael Goulet-3/+2
2022-06-19Mention what item is using an invalid `Self` typeMichael Goulet-20/+96
2022-06-19Be more specific for what lifetimes are not allowed onMichael Goulet-65/+65
2022-06-19Be more hygenic with spansMichael Goulet-260/+174
2022-06-19Only omit trailing comma if block doesn't come from macro expansionMichael Goulet-1/+36
2022-06-19Make missing argument placeholder more obvious that it's a placeholderMichael Goulet-111/+111
2022-06-19Only use special async fn case for actual async fns in borrowck diagnostics.Camille GILLOT-1/+1
2022-06-19Greatly improve error reporting for futures and generators in ↵Joshua Nelson-60/+296
`note_obligation_cause_code` Most futures don't go through this code path, because they're caught by `maybe_note_obligation_cause_for_async_await`. But all generators do, and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses. At some point, we may want to consider unifying this with the code for `maybe_note_async_await`, so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points. But both functions are quite complicated, and it's not clear to me how to combine them; this seems like a good incremental improvement.
2022-06-19collapse dead code warnings into a single diagnosticTakayuki Maeda-267/+381
add comments in `store_dead_field_or_variant` support multiple log level add a item ident label fix ui tests fix a ui test fix a rustdoc ui test use let chain refactor: remove `store_dead_field_or_variant` fix a tiny bug
2022-06-19emit only one note per unused struct fieldTakayuki Maeda-0/+45
2022-06-19Bless 32bit ui tests.Camille GILLOT-12/+12
2022-06-19Make some lints incremental.Camille GILLOT-22/+55
2022-06-18Refactor visit_fn.Camille GILLOT-1/+1
2022-06-18Auto merge of #98216 - JohnTitor:rollup-jlcmu5d, r=JohnTitorbors-6/+3
Rollup of 5 pull requests Successful merges: - #97803 (Impl Termination for Infallible and then make the Result impls of Termination more generic) - #97828 (Allow configuring where artifacts are downloaded from) - #98150 (Emscripten target: replace -g4 with -g, and -g3 with --profiling-funcs) - #98195 (Fix rustdoc json primitive handling) - #98205 (Remove a possible unnecessary assignment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-18Rollup merge of #97803 - Gankra:term, r=dtolnayYuki Okushi-6/+3
Impl Termination for Infallible and then make the Result impls of Termination more generic This allows things like `Result<ExitCode, E>` to 'just work'
2022-06-18Auto merge of #97652 - RalfJung:cenum_impl_drop_cast, r=nagisabors-0/+15
make cenum_impl_drop_cast deny-by-default Also make it show up as future breakage diagnostic. In https://github.com/rust-lang/rust/pull/96862 we are proposing to change behavior of those drops *again*, so this looks like a good opportunity to increase our pressure on getting them out of the ecosystem. Looking at the [tracking issue](https://github.com/rust-lang/rust/issues/73333), so far nobody spoke up in favor of this (accidental) feature. Cc https://github.com/rust-lang/rust/issues/73333 `@oli-obk`
2022-06-17expand inner `or` patternouz-a-0/+77
2022-06-17bless new test result, it's a regression but seemingly a compiler bugAria Beingessner-6/+3
2022-06-17Auto merge of #97892 - klensy:fix-spaces, r=oli-obkbors-651/+651
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
2022-06-17Rollup merge of #98013 - compiler-errors:guide-inference-2, r=lcnrDylan DPC-17/+35
Subtype FRU fields first in `type_changing_struct_update` So this fixes a subtle bug that `type_changing_struct_update` introduced, where it'll no longer coerce the base expr correctly. I actually think this code is easier to understand now, too. r? `@lcnr` since you reviewed the last one
2022-06-17Rollup merge of #97798 - ↵Dylan DPC-34/+24
WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230. I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result. Here is an example of how this changes the output: Before: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | 5 | 6 | 7 | 8 | ... ``` After: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | ... 31| 32~ } }; | ``` r? `@estebank` `@rustbot` label +A-diagnostics +A-suggestion-diagnostics
2022-06-17Subtype FRU fields first in type_changing_struct_updateMichael Goulet-17/+35
2022-06-17Rollup merge of #97377 - ChayimFriedman2:issue-91800, r=estebankYuki Okushi-0/+98
Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros Fixes #91800.
2022-06-16--bless uiMaybe Waffle-34/+24