about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
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-25Test legacy type manglingTomasz Miąsko-0/+640
2022-02-25Test legacy mangling of bool, char and integer constantsTomasz Miąsko-96/+194
The existing v0 tests have been slightly adjusted for compatibility with legacy mangler, which requires an item to have an ancestor in a value namespace or a type namespace to produce a symbol for it. In v0 mangling this results in an extra `Nv` component.
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-24Try out caching the stable hash of Ty within itselfOli Scherer-4/+4
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-23Always evaluate all cfg predicate in all() and any()Loïc BRANSTETT-0/+45
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-22Stabilize Termination and ExitCodeJane Lusby-2/+0
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-21rename compiler-flags to compile-flagsMichael Goulet-3/+3
2022-02-21Suggest calling .display() on PathBuf tooMichael Goulet-2/+16
2022-02-21Do not suggest wrapping an item if it has ambiguous un-imported methodsMichael Goulet-26/+41
2022-02-22chalk: add known-bug test that was previously ICEing.Dario Nieuwenhuis-0/+48
2022-02-21Rollup merge of #94211 - est31:let_else_destructuring_error, r=matthewjasperMatthias Krüger-0/+35
Better error if the user tries to do assignment ... else If the user tries to do assignment ... else, we now issue a more comprehensible error in the parser. closes #93995
2022-02-21Rollup merge of #94156 - tmiasko:pp-str, r=petrochenkovMatthias Krüger-16/+0
Gracefully handle non-UTF-8 string slices when pretty printing Fixes #78520.
2022-02-21Add testsAmanieu d'Antras-0/+64
2022-02-21Take CodegenFnAttrs into account when validating asm! register operandsAmanieu d'Antras-21/+13
Checking of asm! register operands now properly takes function attributes such as #[target_feature] and #[instruction_set] into account.
2022-02-21fix testMario Carneiro-2/+2
2022-02-21Auto merge of #94108 - compiler-errors:just-confirmation-normalization, ↵bors-48/+6
r=jackh726 Normalize obligation and expected trait_refs in confirm_poly_trait_refs Consolidate normalization the obligation and expected trait refs in `confirm_poly_trait_refs`. Also, _always_ normalize these trait refs -- we were already normalizing the obligation trait ref when confirming closure and generator candidates, but this does it for fn pointer confirmation as well. This presumably does more work in the case that the obligation's trait ref is already normalized, but we can see from the perf runs in #94070, it actually (paradoxically, perhaps) improves performance when paired with logic that normalizes projections in fulfillment loop.
2022-02-21Better error if the user tries to do assignment ... elseest31-0/+35
2022-02-21Add regression test for #92069est31-0/+20
2022-02-21Expand let-else allow testsest31-4/+80
The #[allow(...)] directive was tested for the body and the pattern, but non-presence of it wasn't tested. Furthermore, it wasn't tested for the expression. We add expression tests as well as ones checking the non-presence of the directive.