about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-07-31Auto merge of #114266 - calebzulawski:simd-bswap, r=compiler-errorsbors-0/+22
Fix simd_bswap for i8/u8 #114156 missed this test case ☹️ cc `@workingjubilee`
2023-07-30Rollup merge of #113741 - compiler-errors:rpitit-projects-to-missing-opaque, ↵Jubilee-0/+26
r=spastorino Don't install default projection bound for return-position `impl Trait` in trait methods with no body This ensures that we never try to project to an opaque type in a trait method that has no body to infer its hidden type, which means we never later call `type_of` on that opaque. This is because opaque types try to reveal their hidden type when proving auto traits. I thought about this a lot, and I think this is a fix that's less likely to introduce other strange downstream ICEs than #113461. Fixes #113434 r? `@spastorino`
2023-07-30Auto merge of #112843 - chenyukang:yukang-more-on-backtrace, r=workingjubileebors-7/+15
Print omitted frames count for short backtrace mode Fixes #111730
2023-07-30Don't install default projection bound for RPITITsMichael Goulet-0/+26
2023-07-30Fix simd_bswap for i8/u8Caleb Zulawski-0/+22
2023-07-30Rollup merge of #114256 - Urgau:fix-issue-114180, r=WaffleLapkinMatthias Krüger-28/+76
Fix invalid suggestion for mismatched types in closure arguments This PR fixes the invalid suggestion for mismatched types in closure arguments. The invalid suggestion came from a wrongly created span in the parser for closure arguments that don't have a type specified. Specifically, the span in this case was the last token span, but in the case of tuples, the span represented the last parenthesis instead of the whole tuple, which is fixed by taking the more accurate span of the pattern. There is one unfortunate downside of this fix, it worsens even more the diagnostic for mismatched types in closure args without an explicit type. This happens because there is no correct span for implied inferred type. I tried also fixing this but it's a rabbit hole. Fixes https://github.com/rust-lang/rust/issues/114180
2023-07-30Rollup merge of #114246 - Bryanskiy:type-privacy-lints-fixes, r=petrochenkovMatthias Krüger-15/+3
Weaken unnameable_types lint `unnameable_types` lint is no longer emitted for - associated types - internal types r? ``@petrochenkov``
2023-07-30Rollup merge of #102198 - lukas-code:nonnull_as_ref, r=AmanieuMatthias Krüger-0/+30
`const`-stablilize `NonNull::as_ref` A bunch of pointer to reference methods have been made unstably const some time ago in #91823 under the feature gate `const_ptr_as_ref`. Out of these, `NonNull::as_ref` can be implemented as a `const fn` in stable rust today, so i hereby propose to const stabilize this function only. Tracking issue: #91822 ``@rustbot`` label +T-libs-api -T-libs
2023-07-31normalize backtrace error messagesyukang-8/+9
2023-07-30Fix invalid suggestion for mismatched types in closure argumentsUrgau-28/+76
The invalid suggestion came from a wrongly created span in `rustc_parse' for closure arguments that didn't have a type specified. Specifically, the span in this case was the last token span, but in the case of tuples, the span represented the last parenthesis instead of the whole tuple, which is fixed by taking the more accurate span of the pattern.
2023-07-30Rollup merge of #114018 - Enselic:multi-annotation, r=b-naberMatthias Krüger-0/+25
Make `--error-format human-annotate-rs` handle multiple files Closes #64205 which is E-help-wanted
2023-07-30Weaken unnameable_types lintBryanskiy-15/+3
2023-07-30Rollup merge of #114203 - fee1-dead-contrib:effects/pp-no-host, r=oli-obkfee1-dead-8/+7
Effects: don't print `host` param in diagnostics r? ``@oli-obk``
2023-07-30Auto merge of #114226 - matthiaskrgr:rollup-wxdudsm, r=matthiaskrgrbors-0/+14
Rollup of 3 pull requests Successful merges: - #114129 (Rustdoc small cleanups) - #114152 ([rustc][data_structures] Simplify binary_search_slice.) - #114222 (Mark `lazy_type_alias` as incomplete) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-30Rollup merge of #114222 - compiler-errors:lazy-type-alias-is-incomplete, ↵Matthias Krüger-0/+14
r=oli-obk Mark `lazy_type_alias` as incomplete This feature is very not complete: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-lazy_type_alias r? types
2023-07-29some nits, bless testMichael Goulet-16/+2
2023-07-29Implement assumed_wf_types for RPITITs' implementationsMichael Goulet-0/+29
2023-07-29Take RPITITs inherit the assumed_wf_types of their parent fnMichael Goulet-12/+8
2023-07-29Mark lazy_type_alias as incompleteMichael Goulet-0/+14
2023-07-29Auto merge of #114156 - calebzulawski:simd-bswap, r=compiler-errorsbors-25/+118
Add simd_bswap, simd_bitreverse, simd_ctlz, and simd_cttz intrinsics cc `@workingjubilee`
2023-07-29Auto merge of #114028 - Centri3:ternary-operator, r=compiler-errorsbors-0/+184
Gracefully handle ternary operator Fixes #112578 ~~May not be the best way to do this as it doesn't check for a single `:`, so it could perhaps appear even when the actual issue is just a missing semicolon. May not be the biggest deal, though?~~ Nevermind, got it working properly now ^^
2023-07-29Auto merge of #114148 - cuviper:drop-llvm-14, r=nikicbors-287/+253
Update the minimum external LLVM to 15 With this change, we'll have stable support for LLVM 15 through 17 (pending release). For reference, the previous increase to LLVM 14 was #107573.
2023-07-29Effects: don't print `host` param in diagnosticsDeadbeef-8/+7
2023-07-29Auto merge of #114150 - clubby789:improve-option-ref-suggestion, r=WaffleLapkinbors-5/+59
Refactor + improve diagnostics for `&mut T`/`T` mismatch inside Option/Result Follow up to #114052. This also makes the diagnostics structured + translatable. r? `@WaffleLapkin`
2023-07-29print omitted frames count for short backtrace modeyukang-3/+10
2023-07-29Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstriebbors-22/+18
Rename and allow `cast_ref_to_mut` lint This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`). BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged. r? `@Nilstrieb`
2023-07-29Auto merge of #113099 - bvanjoi:fix-112713-2, r=petrochenkovbors-11/+1277
fix(resolve): update the ambiguity glob binding as warning recursively Fixes #47525 Fixes #56593, but `issue-56593-2.rs` is not fixed to ensure backward compatibility. Fixes #98467 Fixes #105235 Fixes #112713 This PR had added a field called `warn_ambiguous` in `NameBinding` which is only for back compatibly reason and used for lint. More details: https://github.com/rust-lang/rust/pull/112743 r? `@petrochenkov`
2023-07-29Auto merge of #114197 - matthiaskrgr:rollup-iluf7u4, r=matthiaskrgrbors-8/+25
Rollup of 7 pull requests Successful merges: - #113773 (Don't attempt to compute layout of type referencing error) - #114107 (Prevent people from assigning me as a PR reviewer) - #114124 (tests/ui/proc-macro/*: Migrate FIXMEs to check-pass) - #114171 (Fix switch-stdout test for none unix/windows platforms) - #114172 (Fix issue_15149 test for the SGX target) - #114173 (btree/map.rs: remove "Basic usage" text) - #114174 (doc: replace wrong punctuation mark) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-29Rollup merge of #114124 - Enselic:proc-fixme, r=cjgillotMatthias Krüger-8/+8
tests/ui/proc-macro/*: Migrate FIXMEs to check-pass proc-macros are processed early in the compiler pipeline. There is no need to involve codegen. So change to check-pass. I have also looked through each changed test and to me it is sufficiently clear that codegen is not needed for the purpose of the test. I skipped changing `tests/ui/proc-macro/no-missing-docs.rs` in this commit because it was not clear to me that it can be changed to check-pass. Part of #62277
2023-07-29Rollup merge of #113773 - compiler-errors:err-layout-bail, r=cjgillotMatthias Krüger-0/+17
Don't attempt to compute layout of type referencing error Leads to more ICEs and strange diagnostics than are worth it. Fixes #113760
2023-07-29Auto merge of #111916 - fee1-dead-contrib:noop-method-call-warn, ↵bors-78/+132
r=compiler-errors make `noop_method_call` warn by default r? `@compiler-errors`
2023-07-28Auto merge of #114181 - matthiaskrgr:rollup-14m8s7f, r=matthiaskrgrbors-0/+350
Rollup of 7 pull requests Successful merges: - #114099 (privacy: no nominal visibility for assoc fns ) - #114128 (When flushing delayed span bugs, write to the ICE dump file even if it doesn't exist) - #114138 (Adjust spans correctly for fn -> method suggestion) - #114146 (Skip reporting item name when checking RPITIT GAT's associated type bounds hold) - #114147 (Insert RPITITs that were shadowed by missing ADTs that resolve to [type error]) - #114155 (Replace a lazy `RefCell<Option<T>>` with `OnceCell<T>`) - #114164 (Add regression test for `--cap-lints allow` and trait bounds warning) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-28Add rustdoc tests for generic const itemsLeón Orell Valerian Liehr-0/+86
2023-07-28Update existing UI testsLeón Orell Valerian Liehr-38/+69
2023-07-28Add UI tests for generic const itemsLeón Orell Valerian Liehr-0/+825
2023-07-28Rollup merge of #114164 - Enselic:lint-cap-trait-bounds, r=compiler-errorsMatthias Krüger-0/+8
Add regression test for `--cap-lints allow` and trait bounds warning Closes #43134 I have verified that the test fails if stderr begins to contain output by making sure the test fails when I add eprintln!("some output on stderr"); to the compiler (I added it to `fn build_session()`).
2023-07-28Rollup merge of #114147 - compiler-errors:missing-rpitits, r=spastorinoMatthias Krüger-0/+27
Insert RPITITs that were shadowed by missing ADTs that resolve to [type error] Comment inline explains how this can happen. Fixes #113903
2023-07-28Rollup merge of #114146 - compiler-errors:dont-report-rpitit-name, r=spastorinoMatthias Krüger-0/+99
Skip reporting item name when checking RPITIT GAT's associated type bounds hold Doesn't really make sense to label an item that has a name that users can't really mention. Fixes #114145. Also fixes #113794. r? `@spastorino`
2023-07-28Rollup merge of #114138 - compiler-errors:bad-rcvr-span-on-method-sugg, ↵Matthias Krüger-0/+21
r=estebank Adjust spans correctly for fn -> method suggestion Fixes #114131
2023-07-28Rollup merge of #114099 - ↵Matthias Krüger-0/+195
davidtwco:issue-113860-staged-api-effective-vis-gt-nominal-vis-when-trait-method-vis, r=petrochenkov privacy: no nominal visibility for assoc fns Fixes #113860. When `staged_api` is enabled, effective visibilities are computed earlier and this can trigger an ICE in some cases. In particular, if a impl of a trait method has a visibility then an error will be reported for that, but when privacy invariants are being checked, the effective visibility will still be greater than the nominal visbility and that will trigger a `span_bug!`. However, this invariant - that effective visibilites are limited to nominal visibility - doesn't make sense for associated functions.
2023-07-29fix(resolve): update the ambiguity glob binding as warning recursivelybohan-11/+1277
2023-07-28Auto merge of #111780 - weiznich:diagnostic_namespace, r=petrochenkovbors-0/+143
Diagnostic namespace This PR implements the basic infrastructure for accepting the `#[diagnostic]` attribute tool namespace as specified in https://github.com/rust-lang/rfcs/pull/3368. Note: This RFC is not merged yet, but it seems like it will be accepted soon. I open this PR early on to get feedback on the actual implementation as soon as possible. This hopefully enables getting at least the diagnostic namespace to stable rust "soon", so that crates do not need to bump their MSRV if we stabilize actual attributes in this namespace. This PR only adds infrastructure accept attributes from this namespace, it does not add any specific attribute. Therefore the compiler will emit a lint warning for each attribute that's actually used. This namespace is added behind a feature flag, so it will be only available on a nightly compiler for now. cc `@estebank` as they've supported me in planing, specifying and implementing this feature.
2023-07-28privacy: no nominal visibility for assoc fnsDavid Wood-0/+195
When `staged_api` is enabled, effective visibilities are computed earlier and this can trigger an ICE in some cases. In particular, if a impl of a trait method has a visibility then an error will be reported for that, but when privacy invariants are being checked, the effective visibility will still be greater than the nominal visbility and that will trigger a `span_bug!`. However, this invariant - that effective visibilites are limited to nominal visibility - doesn't make sense for associated functions. Signed-off-by: David Wood <david@davidtw.co>
2023-07-28Introduce the `#[diagnostic]` attribute namespaceGeorg Semmler-0/+143
Co-authored-by: est31 <est31@users.noreply.github.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-07-28Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnrbors-3/+66
discard default auto trait impls if explicit ones exist (rebase of #85048) Rebase of #85048
2023-07-28Add regression test for `--cap-lints allow` and trait bounds warningMartin Nordholts-0/+8
I have verified that the test fails if stderr begins to contain output by making sure the test fails when I add eprintln!("some output on stderr"); to the compiler (I added it to `fn build_session()`).
2023-07-28Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obkbors-660/+288
Remove `constness` from `ParamEnv` This should be replaced by keyword generics/effects. cc #110395 r? `@oli-obk`
2023-07-28Auto merge of #112390 - MoskalykA:move-two-tests-from-library-to-tests, ↵bors-109/+0
r=workingjubilee Move two tests from `tests/ui/std` to `library/std/tests` Hi, there, This pull request comes from this issue (#99417), sorry I made some mistakes creating the pull request, it's my first one.
2023-07-28Format testCaleb Zulawski-10/+12
2023-07-27Add SIMD bitreverse, ctlz, cttz intrinsicsCaleb Zulawski-18/+86