about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-03-22remove [async output] from impl FutureMichael Goulet-18/+18
2022-03-22bless 32bitRalf Jung-1/+1
2022-03-23Rollup merge of #91608 - workingjubilee:fold-neon-fp, r=nagisa,AmanieuDylan DPC-1/+146
Fold aarch64 feature +fp into +neon Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64: The Neon unit, which handles both floating point and SIMD instructions. Moreover, a configuration for AArch64 must include both or neither. Arm says "entirely proprietary" toolchains may omit floating point: https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point In the Programmer's Guide for Armv8-A, Arm says AArch64 can have both FP and Neon or neither in custom implementations: https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON In "Bare metal boot code for Armv8-A", enabling Neon and FP is just disabling the same trap flag: https://developer.arm.com/documentation/dai0527/a In an unlikely future where "Neon and FP" become unrelated, we can add "[+-]fp" as its own feature flag. Until then, we can simplify programming with Rust on AArch64 by folding both into "[+-]neon", which is valid as it supersets both. "[+-]neon" is retained for niche uses such as firmware, kernels, "I just hate floats", and so on. I am... pretty sure no one is relying on this. An argument could be made that, as we are not an "entirely proprietary" toolchain, we should not support AArch64 without floats at all. I think that's a bit excessive. However, I want to recognize the intent: programming for AArch64 should be simplified where possible. For x86-64, programmers regularly set up illegal feature configurations because it's hard to understand them, see https://github.com/rust-lang/rust/issues/89586. And per the above notes, plus the discussion in https://github.com/rust-lang/rust/issues/86941, there should be no real use cases for leaving these features split: the two should in fact always go together. - Fixes rust-lang/rust#95002. - Fixes rust-lang/rust#95064. - Fixes rust-lang/rust#95122.
2022-03-22Fixup aarch64 smoke testJubilee Young-5/+4
2022-03-22better errors when a Copy impl is not coherentMichael Goulet-0/+64
2022-03-22interpret/memory: simplify check_and_deref_ptrRalf Jung-8/+8
2022-03-22Test SVE2 includes NEON and not vice versaJubilee Young-0/+58
Required by https://github.com/rust-lang/rust/issues/95122
2022-03-22diagnostics: do not suggest `fn foo({ <body> }`Michael Howell-3/+1
Instead of suggesting that the body always replace the last character on the line, presuming it must be a semicolon, the parser should instead check what the last character is, and append the body if it is anything else. Fixes #83104
2022-03-22Test NEON compilesJubilee Young-0/+24
Required by https://github.com/rust-lang/rust/issues/95002
2022-03-22Filter for all features instead of anyJubilee Young-0/+64
Adds regression tests for feature logic Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com> Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me>
2022-03-22Fold aarch64 feature +fp into +neonJubilee Young-1/+1
Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64: The Neon unit, which handles both floating point and SIMD instructions. Moreover, a configuration for AArch64 must include both or neither. Arm says "entirely proprietary" toolchains may omit floating point: https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point In the Programmer's Guide for Armv8-A, Arm says AArch64 can have both FP and Neon or neither in custom implementations: https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON In "Bare metal boot code for Armv8-A", enabling Neon and FP is just disabling the same trap flag: https://developer.arm.com/documentation/dai0527/a In an unlikely future where "Neon and FP" become unrelated, we can add "[+-]fp" as its own feature flag. Until then, we can simplify programming with Rust on AArch64 by folding both into "[+-]neon", which is valid as it supersets both. "[+-]neon" is retained for niche uses such as firmware, kernels, "I just hate floats", and so on.
2022-03-22Rollup merge of #95200 - ↵Dylan DPC-0/+13
TaKO8Ki:cancel-not-emitted-error-when-parsing-generic-arg, r=oli-obk Cancel a not emitted error after parsing const generic args closes #95163
2022-03-22Rollup merge of #95197 - frank-king:feat/unary_op_type_constrain, r=petrochenkovDylan DPC-2/+36
Suggest constraining param for unary ops when missing trait impl This PR adds a suggestion of constraining param for unary ops `-` and `!` when the corresponding trait implementation is missing. Fixs #94543. BTW, this is my first time to touch rustc, please correct me if I did anything wrong.
2022-03-22fix previous failures and address reviewb-naber-58/+70
2022-03-22cancel a not emitted error after parsing const generic argsTakayuki Maeda-0/+13
2022-03-22suggest constraining param for unary ops when missing trait implFrank King-2/+36
2022-03-22Auto merge of #95127 - ↵bors-0/+24
notriddle:notriddle/option-content-move-from-tuple-match, r=estebank diagnostics: do not give Option::as_ref suggestion for complex match Fixes #82528
2022-03-21Rollup merge of #95175 - lcnr:adt_const_params-tracking-issue, r=Dylan-DPCMatthias Krüger-41/+3
move `adt_const_params` to its own tracking issue the new tracking issue is #95174 r? ``@rust-lang/project-const-generics``
2022-03-21Rollup merge of #95116 - bjorn3:cg_clif_test_fixes, r=Dylan-DPCMatthias Krüger-88/+107
Add needs-* directives to many tests These are necessary to ignore tests that need features unsupported by cg_clif.
2022-03-21Rollup merge of #95085 - ouz-a:master5, r=jackh726Matthias Krüger-0/+49
Return err instead of ICE Having `escaping_bound_vars` results in ICE when trying to create `ty::Binder::dummy`, to avoid it we return err like the line above. I think this requires a more sophisticated fix, I would love to investigate if mentorship is available 🤓 Fixes #95023 and #85350
2022-03-21Add needs-asm-support directive to tests where necessarybjorn3-68/+80
2022-03-21add/update testsb-naber-137/+50
2022-03-21Return err instead of ICEouz-a-0/+49
2022-03-21move `adt_const_params` to its own tracking issuelcnr-41/+3
2022-03-21Auto merge of #95169 - Smittyvb:union-test-ub, r=bjorn3bors-54/+107
Don't run UB in test suite This splits `ui/unsafe/union.rs` to make it so only the non-UB parts are run. It also means we can do more testing of the location of error messages (which are a bit different with the THIR unsafety checker). `union-modification.rs` has no UB (according to Miri), and `union.rs` has errors (but would have UB if not for those errors). Closes #95075. r? `@bjorn3`
2022-03-21Don't run UB in test suiteSmitty-54/+107
This splits ui/unsafe/union.rs to make it so only the non-UB parts are run. It also means we can do more testing of the location of error messages.
2022-03-21Tidy upDeadbeef-1/+5
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-68/+65
2022-03-21Auto merge of #95104 - compiler-errors:remove-ascription, r=davidtwcobors-0/+80
suggest removing type ascription in bad parsing position Not sure how to test this with the non-nightly suggestion. Didn't add a new UI test because it already manifests in an existing UI test. Fixes #95014
2022-03-20Rollup merge of #95135 - ↵Matthias Krüger-0/+17
TaKO8Ki:fix-not-emitted-unmatched-angle-bracket-error, r=Dylan-DPC Fix a not emitted unmatched angle bracket error closes #95128
2022-03-20Filter OnceNote in diagnostic infra.Camille GILLOT-67/+51
2022-03-20fix a not emitted unmatched angle bracket errorTakayuki Maeda-0/+17
2022-03-20Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPCMatthias Krüger-1/+1
Fix diagnostics for `#![feature(deprecated_suggestion)]` Follow up from #94635, where I missed a couple things.
2022-03-19diagnostics: do not give Option::as_ref suggestion for complex matchMichael Howell-0/+24
Fixes #82528
2022-03-19Add needs-unwind directive to tests where necessarybjorn3-20/+27
2022-03-19Extend --check-cfg tests to all predicate inside all/anyLoïc BRANSTETT-1/+117
2022-03-18suggest removing type ascription in bad positionMichael Goulet-0/+80
2022-03-18Rollup merge of #94295 - Urgau:cfg-always-eval-all-predicate, r=petrochenkovMatthias Krüger-0/+45
Always evaluate all cfg predicate in all() and any() This pull-request adjust the handling of the `all()` and `any()` to always evaluate every cfg predicate because not doing so result in accepting incorrect `cfg`: ```rust #[cfg(any(unix, foo::bar))] // Should error on foo::bar, but does not on unix platform (but does on non unix platform) fn foo1() {} #[cfg(all(foo, foo::bar))] // Should error on foo::bar, but does not fn foo2() {} #[cfg(all(foo::bar, foo))] // Correctly error on foo::bar fn foo3() {} #[cfg(any(foo::bar, foo))] // Correctly error on foo::bar fn foo4() {} ``` This pull-request take the side to directly turn it into a hard error instead of having a future incompatibility lint because the combination to get this incorrect behavior is unusual and highly probable that some code have this without noticing. A [search](https://cs.github.com/?scopeName=All+repos&scope=&q=lang%3Arust+%2Fany%5C%28%5Ba-zA-Z%5D%2C+%5Ba-zA-Z%5D%2B%3A%3A%5Ba-zA-Z%5D%2B%2F) on Github reveal no such instance nevertheless a Crater run should probably be done before merging this. This was discover in https://github.com/rust-lang/rust/pull/94175 when trying to lint on the second predicate. Also note that this seems to have being introduce with Rust 1.27.0: https://rust.godbolt.org/z/KnfqKv15f. r? `@petrochenkov`
2022-03-18Fix inherent impls on negative coherenceSantiago Pastorino-0/+22
2022-03-18Auto merge of #95065 - matthiaskrgr:rollup-75i6oz5, r=matthiaskrgrbors-13/+32
Rollup of 4 pull requests Successful merges: - #95013 (Update browser-ui-test version to 0.8.2) - #95039 (Make negative coherence work when there's impl negative on super predicates) - #95047 (Refactor: remove an unnecessary pattern for ignoring all parts) - #95048 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-18Rollup merge of #95039 - spastorino:overlap-super-predicates, r=nikomatsakisMatthias Krüger-13/+32
Make negative coherence work when there's impl negative on super predicates r? `@nikomatsakis`
2022-03-18Auto merge of #88098 - Amanieu:oom_panic, r=nagisabors-0/+23
Implement -Z oom=panic This PR removes the `#[rustc_allocator_nounwind]` attribute on `alloc_error_handler` which allows it to unwind with a panic instead of always aborting. This is then used to implement `-Z oom=panic` as per RFC 2116 (tracking issue #43596). Perf and binary size tests show negligible impact.
2022-03-18Auto merge of #95056 - Dylan-DPC:rollup-swtuw2n, r=Dylan-DPCbors-3/+177
Rollup of 10 pull requests Successful merges: - #91133 (Improve `unsafe` diagnostic) - #93222 (Make ErrorReported impossible to construct outside `rustc_errors`) - #93745 (Stabilize ADX target feature) - #94309 ([generator_interior] Be more precise with scopes of borrowed places) - #94698 (Remove redundant code from copy-suggestions) - #94731 (Suggest adding `{ .. }` around a const function call with arguments) - #94960 (Fix many spelling mistakes) - #94982 (Add deprecated_safe feature gate and attribute, cc #94978) - #94997 (debuginfo: Fix ICE when generating name for type that produces a layout error.) - #95000 (Fixed wrong type name in comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-17Rollup merge of #94997 - michaelwoerister:fix-enum-type-name-layout-error, ↵Dylan DPC-0/+44
r=wesleywiser debuginfo: Fix ICE when generating name for type that produces a layout error. Fixes https://github.com/rust-lang/rust/issues/94961.
2022-03-17Rollup merge of #94982 - skippy10110:deprecated_safe, r=Dylan-DPCDylan DPC-0/+28
Add deprecated_safe feature gate and attribute, cc #94978
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-2/+2
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-17Rollup merge of #94731 - TaKO8Ki:const-generic-expr-recovery, ↵Dylan DPC-0/+75
r=davidtwco,oli-obk Suggest adding `{ .. }` around a const function call with arguments closes #91020
2022-03-17Rollup merge of #94309 - eholk:issue-57017, r=tmandryDylan DPC-0/+22
[generator_interior] Be more precise with scopes of borrowed places Previously the generator interior type checking analysis would use the nearest temporary scope as the scope of a borrowed value. This ends up being overly broad for cases such as: ```rust fn status(_client_status: &Client) -> i16 { 200 } fn main() { let client = Client; let g = move || match status(&client) { _status => yield, }; assert_send(g); } ``` In this case, the borrow `&client` could be considered in scope for the entirety of the `match` expression, meaning it would be viewed as live across the `yield`, therefore making the generator not `Send`. In most cases, we want to use the enclosing expression as the scope for a borrowed value which will be less than or equal to the nearest temporary scope. This PR changes the analysis to use the enclosing expression as the scope for most borrows, with the exception of borrowed RValues which are true temporary values that should have the temporary scope. There's one further exception where borrows of a copy such as happens in autoref cases also should be ignored despite being RValues. Joint work with `@nikomatsakis` Fixes #57017 r? `@tmandry`
2022-03-17Rollup merge of #91133 - terrarier2111:unsafe-diagnostic, r=jackh726Dylan DPC-1/+6
Improve `unsafe` diagnostic This fixes: https://github.com/rust-lang/rust/issues/90880 I didn't use the exact proposed messages though.
2022-03-17This test now worksSantiago Pastorino-13/+2