about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-02-26Auto merge of #93516 - nagisa:branch-protection, r=cjgillotbors-1/+18
No branch protection metadata unless enabled Even if we emit metadata disabling branch protection, this metadata may conflict with other modules (e.g. during LTO) that have different branch protection metadata set. This is an unstable flag and feature, so ideally the flag not being specified should act as if the feature wasn't implemented in the first place. Additionally this PR also ensures we emit an error if `-Zbranch-protection` is set on targets other than the supported aarch64. For now the error is being output from codegen, but ideally it should be moved to earlier in the pipeline before stabilization.
2022-02-26Auto merge of #93449 - JakobDegen:restrict-hasdrop-optimization, r=cjgillotbors-0/+14
Restrict query recursion in `needs_significant_drop` Overly aggressive use of the query system to improve caching lead to query cycles and consequently ICEs. This patch fixes this by restricting the use of the query system as a cache to those cases where it is definitely correct. Closes #92725 . This is essentially a revert of #90845 for the significant drop case only. The general `needs_drop` still does the same thing. The hope is that this is enough to preserve the performance improvements of that PR while fixing the ICE. Should get a perf run to verify that this is the case. cc `@cjgillot`
2022-02-26Auto merge of #94078 - ↵bors-0/+329
TaKO8Ki:suggest-float-literal-for-float-divided-by-integer, r=estebank Suggest a float literal when dividing a floating-point type by `{integer}` closes #93829
2022-02-26Auto merge of #94392 - matthiaskrgr:rollup-npscf95, r=matthiaskrgrbors-3/+83
Rollup of 5 pull requests Successful merges: - #93400 (Do not suggest using a const parameter when there are bounds on an unused type parameter) - #93982 (Provide extra note if synthetic type args are specified) - #94087 (Remove unused `unsound_ignore_borrow_on_drop`) - #94235 (chalk: Fix wrong debrujin index in opaque type handling.) - #94306 (Avoid exhausting stack space in dominator compression) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-26Rollup merge of #94235 - Dirbaio:fix-chalk-opaque-debrujin, r=jackh726Matthias Krüger-0/+48
chalk: Fix wrong debrujin index in opaque type handling. A folder in opaque type lowering was substituting all opaque type references with a variable with debrujin index 0 ignoring how many binders deep we are. This caused an ICE with `Not enough bound vars: ^0 not found in []` ([full logs](https://gist.github.com/Dirbaio/2b9374ff4fce37afb9d665dc9f0000df)) with the following code. ```rust fn main() -> () {} async fn foo(x: u32) -> u32 { x } ``` With the fix, it no longer ICEs. It still doesn't typecheck due to generator issues. I've added a "known-bug" test so that at least it doesn't regress back to ICEing. r? ``@jackh726``
2022-02-26Rollup merge of #93982 - nbdd0121:explicit-generic-args, r=jackh726Matthias Krüger-0/+1
Provide extra note if synthetic type args are specified Implement the unresolved question in #83701 as suggested in https://github.com/rust-lang/rust/pull/86176#discussion_r680613890. r? ``@jackh726``
2022-02-26Rollup merge of #93400 - ↵Matthias Krüger-3/+34
ChayimFriedman2:dont-suggest-using-const-with-bounds-unused-generic-param, r=jackh726 Do not suggest using a const parameter when there are bounds on an unused type parameter The user wrote the bound, so it's obvious they want a type.
2022-02-26suggest a float literal when dividing a floating-point type by {integer}Takayuki Maeda-0/+329
fix a message implement a rustfix-applicable suggestion implement `suggest_floating_point_literal` add `ObligationCauseCode::BinOp` remove duplicate code fix function names in uitests use `Diagnostic` instead of `DiagnosticBuilder`
2022-02-26Auto merge of #92884 - compiler-errors:const-generic-expr-recovery, r=jackh726bors-0/+81
Suggest adding `{ .. }` around more bad const generic exprs Fixes #92776
2022-02-26Provide extra note if synthetic type args are specifiedGary Guo-0/+1
2022-02-25Suggest {} around more bad const generic exprsMichael Goulet-0/+81
2022-02-26Rollup merge of #94377 - cynecx:fix-used-with-args, r=nikicMatthias Krüger-0/+9
`check_used` should only look at actual `used` attributes cc? https://github.com/rust-lang/rust/issues/94348 r? ``@nikic``
2022-02-26Rollup merge of #94355 - ouz-a:master, r=oli-bokMatthias Krüger-0/+36
Add one more case to avoid ICE Fix for the #94291, added one more case to related function to avoid ICE. Not sure if my test is in the correct place 😅
2022-02-26Rollup merge of #93870 - tmiasko:const-precise-live-drops-with-coverage, ↵Matthias Krüger-0/+16
r=ecstatic-morse Fix switch on discriminant detection in a presence of coverage counters Fixes #93848. r? ``@ecstatic-morse``
2022-02-25Add one more case to avoid ICEouz-a-0/+36
2022-02-25`check_used` should only look at actual `used` attributescynecx-0/+9
2022-02-25Rollup merge of #94353 - flip1995:fix_debug_assert_unused, r=Dylan-DPCMatthias Krüger-6/+6
Fix debug_assert in unused lint pass This fixes a debug assertion in the unused lint pass. As a side effect, this also improves the span generated for tuples in the `unused_must_use` lint. found in #94329 A reproducer for this would be ```rust fn main() { (1, (3,)); } ``` Not sure, if I should add a regression test for a `debug_assert`.
2022-02-25Rollup merge of #93850 - asquared31415:extern-static-size-ice, r=jackh726Matthias Krüger-0/+63
Don't ICE when an extern static is too big for the current architecture Fixes #93760 Emit an error instead of ICEing when an `extern` static's size overflows the allowed maximum for the target. Changes the error message in the existing `delay_span_bug` call to the true layout error, first for debugging purposes, but opted to leave in to potentially assist future developers as it was being reached in unexpected ways already.
2022-02-25Rollup merge of #94344 - notriddle:notriddle/suggest-parens-more, r=oli-obkMatthias Krüger-1/+135
diagnostic: suggest parens when users want logical ops, but get closures Fixes #93536
2022-02-25Rollup merge of #94343 - RalfJung:fn-ptr, r=oli-obkMatthias Krüger-2/+2
Miri fn ptr check: don't use conservative null check In https://github.com/rust-lang/rust/pull/94270 I used the wrong NULL check for function pointers: `memory.ptr_may_be_null` is conservative even on machines that support ptr-to-int casts, leading to false errors in Miri. This fixes that problem, and also replaces that foot-fun of a method with `scalar_may_be_null` which is never unnecessarily conservative. r? `@oli-obk`
2022-02-25Rollup merge of #94252 - lcnr:def_kind-encoding, r=cjgillotMatthias Krüger-44/+44
don't special case `DefKind::Ctor` in encoding considering that we still use `DefKind::Ctor` for these in `Res`, this seems weird and definitely felt like a bug when encountering it while working on #89862. r? `@cjgillot`
2022-02-25Rollup merge of #93845 - compiler-errors:in-band-lifetimes, r=cjgillotMatthias Krüger-1323/+35
Remove in band lifetimes As discussed in t-lang backlog bonanza, the `in_band_lifetimes` FCP closed in favor for the feature not being stabilized. This PR removes `#![feature(in_band_lifetimes)]` in its entirety. Let me know if this PR is too hasty, and if we should instead do something intermediate for deprecate the feature first. r? `@scottmcm` (or feel free to reassign, just saw your last comment on #44524) Closes #44524
2022-02-25Fix debug_assert in unused lint passflip1995-6/+6
This fixes a debug assertion in the unused lint pass. As a side effect, this also improves the span generated for tuples in the `unused_must_use` lint.
2022-02-25Rollup merge of #94068 - eholk:drop-track-field-assign, r=tmandryMatthias Krüger-0/+114
Consider mutations as borrows in generator drop tracking This is needed to match MIR more conservative approximation of any borrowed value being live across a suspend point (See #94067). This change considers an expression such as `x.y = z` to be a borrow of `x` and therefore keeps `x` live across suspend points. r? `@nikomatsakis`
2022-02-25Do not suggest using a const parameter when there are bounds on an unused ↵Chayim Refael Friedman-3/+34
type parameter The user wrote the bound, so it's obvious they want a type.
2022-02-24Remove in-band lifetimesMichael Goulet-1323/+35
2022-02-24Miri fn ptr check: don't use conservative null checkRalf Jung-2/+2
2022-02-24diagnostic: suggest parens when users want logical ops, but get closuresMichael Howell-1/+135
2022-02-24Rollup merge of #94315 - lcnr:auto-trait-lint-update, r=oli-obkDylan DPC-7/+32
update auto trait lint for `PhantomData` cc https://github.com/rust-lang/rust/issues/93367#issuecomment-1047898410
2022-02-24Rollup merge of #94242 - compiler-errors:fat-uninhabitable-pointer, ↵Dylan DPC-0/+29
r=michaelwoerister properly handle fat pointers to uninhabitable types Calculate the pointee metadata size by using `tcx.struct_tail_erasing_lifetimes` instead of duplicating the logic in `fat_pointer_kind`. Open to alternatively suggestions on how to fix this. Fixes #94149 r? ````@michaelwoerister```` since you touched this code last, I think!
2022-02-24Rollup merge of #94175 - Urgau:check-cfg-improvements, r=petrochenkovDylan DPC-1/+192
Improve `--check-cfg` implementation This pull-request is a mix of improvements regarding the `--check-cfg` implementation: - Simpler internal representation (usage of `Option` instead of separate bool) - Add --check-cfg to the unstable book (based on the RFC) - Improved diagnostics: * List possible values when the value is unexpected * Suggest if possible a name or value that is similar - Add more tests (well known names, mix of combinations, ...) r? ```@petrochenkov```
2022-02-24don't ice when an extern static is too bigasquared31415-0/+63
2022-02-24Restrict query recursion in `needs_significant_drop`Jakob Degen-0/+14
Overly aggressive use of the query system to improve caching lead to query cycles and consequently ICEs. This patch fixes this by restricting the use of the query system as a cache to those cases where it is definitely correct.
2022-02-24restore spans for issue-50480Michael Goulet-18/+16
2022-02-24better ObligationCause for normalization errors in can_type_implement_copyMichael Goulet-16/+57
2022-02-24don't special case `DefKind::Ctor` in encodinglcnr-44/+44
2022-02-24update auto trait lintlcnr-7/+32
2022-02-24Rollup merge of #94270 - RalfJung:fn-ptrs, r=oli-obkMatthias Krüger-18/+92
Miri: relax fn ptr check As discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/72#issuecomment-1025407536, the function pointer check done by Miri is currently overeager: contrary to our usual principle of only checking rather uncontroversial validity invariants, we actually check that the pointer points to a real function. So, this relaxes the check to what the validity invariant probably will be (and what the reference already says it is): the function pointer must be non-null, and that's it. The check that CTFE does on the final value of a constant is unchanged -- CTFE recurses through references, so it makes some sense to also recurse through function pointers. We might still want to relax this in the future, but that would be a separate change. r? `@oli-obk`
2022-02-23Miri: relax fn ptr checkRalf Jung-18/+92
2022-02-23properly handle fat pointers to uninhabitable typesMichael Goulet-0/+29
2022-02-23Continue improvements on the --check-cfg implementationLoïc BRANSTETT-1/+138
- Test the combinations of --check-cfg with partial values() and --cfg - Test that we detect unexpected value when none are expected
2022-02-23Rollup merge of #94240 - compiler-errors:pathbuf-display, r=lcnrMatthias Krüger-2/+16
Suggest calling .display() on `PathBuf` too Fixes #94210
2022-02-23Rollup merge of #94213 - digama0:patch-4, r=Dylan-DPCMatthias Krüger-2/+2
fix names in feature(...) suggestion
2022-02-22Improve diagnostic of the unexpected_cfgs lintLoïc BRANSTETT-4/+9
2022-02-22Add test for well known names defined by rustcLoïc BRANSTETT-0/+49
2022-02-22Auto merge of #83706 - a1phyr:fix_vec_layout_calculation, r=JohnTitorbors-0/+3
Fix a layout possible miscalculation in `alloc::RawVec` A layout miscalculation could happen in `RawVec` when used with a type whose size isn't a multiple of its alignment. I don't know if such type can exist in Rust, but the Layout API provides ways to manipulate such types. Anyway, it is better to calculate memory size in a consistent way.
2022-02-22Rollup merge of #94237 - compiler-errors:dont-wrap-ambiguous-receivers, r=lcnrMatthias Krüger-26/+41
Do not suggest wrapping an item if it has ambiguous un-imported methods If the method is defined for the receiver we have, but is ambiguous during probe, then it probably comes from one of several traits that just weren't `use`d. Don't suggest wrapping the receiver in `Box`/etc., even if that makes the method probe unambiguous. Fixes #94218
2022-02-22Rollup merge of #94208 - est31:let_else, r=Mark-SimulacrumMatthias Krüger-4/+100
Add the let else tests found missing in the stabilization report In the stabilization report of `let else`, in #93628, I found various cases which weren't tested. This PR adds them.
2022-02-22Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisaMatthias Krüger-21/+77
Fix several asm! related issues This is a combination of several fixes, each split into a separate commit. Splitting these into PRs is not practical since they conflict with each other. Fixes #92378 Fixes #85247 r? ``@nagisa``
2022-02-21Suggest calling .display() on PathBuf tooMichael Goulet-2/+16