about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-22Deduplicate check_expr in builtin calls with errorMichael Goulet-0/+52
2022-12-22Mark `proc_macro_decls_static` as always usedJoshua Nelson-0/+1
This would have avoided a bug in https://github.com/rust-lang/rust/pull/104860. In practice this shouldn't matter since nothing uses the query other than the `dead_code` lint, but this isn't documented as an internal-only query so it seems nice for it to be accurate. I think for `dead_code` it doesn't matter because the relevant code is generated by `rustc_builtin_macros` and isn't linted.
2022-12-22Use separate files instead of revisionsMichael Goulet-24/+37
2022-12-22Auto merge of #103957 - JakobDegen:drop-retag, r=RalfJungbors-2/+5
Retag as FnEntry on `drop_in_place` This commit changes the mir drop shim to always retag its argument as if it were a `&mut`. cc rust-lang/unsafe-code-guidelines#373
2022-12-22abort immediately on bad mem::zeroed/uninitRalf Jung-18/+36
2022-12-22Add regression test for #94293Yuki Okushi-0/+31
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Auto merge of #106034 - matthiaskrgr:rollup-2zpql33, r=matthiaskrgrbors-79/+177
Rollup of 8 pull requests Successful merges: - #104741 (Switch `#[track_caller]` back to a no-op unless feature gate is enabled) - #105769 (add function to tell the identical errors for ambiguity_errors) - #105843 (Suggest associated const on possible capitalization mistake) - #105966 (Re-enable `Fn` trait call notation error for non-tuple argument) - #106002 (codegen tests: adapt patterns to also work with v0 symbol mangling) - #106010 (Give opaque types a better coherence error) - #106016 (rustdoc: simplify link anchor to section expand JS) - #106024 (Fix ICE due to `todo!()` in `rustdoc` for `Term`s) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Extend search GUI test to include search tab title color checkGuillaume Gomez-0/+15
2022-12-22Rollup merge of #106024 - JulianKnodt:add_term_html_docs, r=notriddleMatthias Krüger-0/+14
Fix ICE due to `todo!()` in `rustdoc` for `Term`s Left a todo awhile ago (I think), so fill it in to print a const for `Term`s. Fixes #105952. Should I add some annotations to the rustdoc test?
2022-12-22Rollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errorsMatthias Krüger-1/+1
Give opaque types a better coherence error
2022-12-22Rollup merge of #106002 - krasimirgg:v0sym, r=tmiaskoMatthias Krüger-2/+4
codegen tests: adapt patterns to also work with v0 symbol mangling No functional changes intended. These tests were failing under `new-symbol-mangling = true`, cf. https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/a.20few.20panic-abort.20tests.20fail.20under.20.60new-symbol-mangling.60. This adapts the patterns to work in this case.
2022-12-22Rollup merge of #105966 - compiler-errors:issue-105936, r=eholkMatthias Krüger-0/+26
Re-enable `Fn` trait call notation error for non-tuple argument I have no idea why I delayed this bug... but also there doesn't seem to be a UI test that actually shows a change, so maybe that's why. Fixes #105936
2022-12-22Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnrMatthias Krüger-0/+72
Suggest associated const on possible capitalization mistake Suggest `i32::MAX` if we typed `i32::max` without making a function call. Fixes #93844
2022-12-22Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholkMatthias Krüger-54/+8
add function to tell the identical errors for ambiguity_errors if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-22Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, ↵Matthias Krüger-22/+52
r=compiler-errors Switch `#[track_caller]` back to a no-op unless feature gate is enabled This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate. Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not. Fixes #104588
2022-12-22Auto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddlebors-7/+77
Fix impl block in const expr Fixes #83026. The problem was that we didn't visit block expressions. Considering how big the [walk_expr](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_hir/intravisit.rs.html#678) function is, I decided to instead implement the `hir` visitor on the struct. It also answers the question which was in a comment for `RustdocVisitor`: we should have used a visitor instead of our ad-hoc implementation. Adding this visitor also added some extra checks that weren't present before (check changes in `rustdoc-ui` tests). r? `@notriddle`
2022-12-22fix #105494, Suggest remove last method call when type coerce with expectedyukang-0/+76
2022-12-22Move z-crate-attr test to the attributes dirYuki Okushi-0/+0
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Add regression test for #99647Yuki Okushi-0/+15
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-22Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgrbors-14/+99
Rollup of 6 pull requests Successful merges: - #105837 (Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity) - #105932 (Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15) - #105960 (Various cleanups) - #105985 (Method chain nitpicks) - #105996 (Test that async blocks are `UnwindSafe`) - #106012 (Clarify that raw retags are not permitted in Mir) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Suggest associated const on capitalization errorMichael Goulet-0/+72
2022-12-22Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitorbors-0/+30
Rollup of 8 pull requests Successful merges: - #105584 (add assert messages if chunks/windows are length 0) - #105602 (interpret: add read_machine_[ui]size convenience methods) - #105824 (str.lines() docstring: clarify that line endings are not returned) - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - #105986 (Fix typo in reading_half_a_pointer.rs) - #105995 (Add regression test for #96530) - #106008 (Sort lint_groups in no_lint_suggestion) - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Fix ICEkadmin-0/+14
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
2022-12-21rustdoc: simplify CSS and DOM for more-scraped-examplesMichael Howell-5/+5
This gets rid of the more-scraped-examples-inner wrapper, instead nesting the children directly and using absolute positioning for the toggle line.
2022-12-22Rollup merge of #106012 - JakobDegen:retag-raw, r=RalfJungMatthias Krüger-10/+6
Clarify that raw retags are not permitted in Mir Not sure when this changed, but documentation and the validator needed to be updated. This also removes raw retags from custom mir. cc rust-lang/miri#2735 r? `@RalfJung`
2022-12-22Rollup merge of #105996 - Swatinem:async-is-unwindsafe, r=petrochenkovMatthias Krüger-0/+68
Test that async blocks are `UnwindSafe` This was a regression from the reverted #105250 which is now covered by a test.
2022-12-22Rollup merge of #105985 - compiler-errors:method-chain-nitpicks, r=estebankMatthias Krüger-4/+4
Method chain nitpicks Just fixing some little things I didn't see in review from that method chain PR. r? `@estebank`
2022-12-22Rollup merge of #105837 - compiler-errors:issue-105728, r=estebankMatthias Krüger-0/+21
Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity These expressions are just used for their spans, so make it best-effort here. Fixes #105728
2022-12-22Rollup merge of #106014 - ↵Yuki Okushi-0/+1
GuillaumeGomez:add-gui-explanations-scrape-examples-toggle, r=notriddle Add comment explaining what the scrape-examples-toggle.goml GUI test is about r? `@notriddle`
2022-12-22Rollup merge of #105995 - JohnTitor:issue-96530, r=compiler-errorsYuki Okushi-0/+29
Add regression test for #96530 Closes #96530 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-21Update track_caller tests; run fmtBryan Garza-15/+7
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-3/+3
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-21Retag as FnEntry on `drop_in_place`Jakob Degen-2/+5
2022-12-21Auto merge of #105979 - matthiaskrgr:rollup-2luw3mx, r=matthiaskrgrbors-2/+119
Rollup of 8 pull requests Successful merges: - #105791 (docs: add long error explanation for error E0472) - #105897 (Fix an opaque type ICE) - #105904 (Fix arch flag on i686-apple-darwin) - #105949 (Bump `cfg-if` to `1.0` in rustc crates) - #105964 (rustdoc: prevent CSS layout of line numbers shrinking into nothing) - #105972 (rustdoc: simplify section anchor CSS) - #105973 (Avoid going through the happy path in case of non-fn builtin calls) - #105976 (Remove unused `check-stage2-T-arm-linux-androideabi-H-x86_64-unknown-linux-gnu` make rule) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-21Add comment explaining what the scrape-examples-toggle.goml GUI test is aboutGuillaume Gomez-0/+1
2022-12-21Clarify that raw retags are not permitted in MirJakob Degen-10/+6
2022-12-21Test the borrowck behavior of if-let guardsLéo Lanteri Thauvin-62/+645
2022-12-21Give opaque types a better coherence errorOli Scherer-1/+1
2022-12-21Auto merge of #105812 - ojeda:no-jump-tables, r=nikicbors-0/+57
Add `-Zno-jump-tables` This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
2022-12-21codegen tests: adapt patterns to also work with v0 symbol manglingKrasimir Georgiev-2/+4
No functional changes intended. These tests were failing under `new-symbol-mangling = true`. This adapts the patterns to work in this case.
2022-12-21Test that async blocks are UnwindSafeArpad Borsos-0/+68
This was a regression from the reverted #105250 which is now covered by a test.
2022-12-21Add regression test for #96530Yuki Okushi-0/+29
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-21Substitute things correctlyMichael Goulet-4/+4
2022-12-21forgot a return in drop tracking handle_uninhabited_returnMichael Goulet-11/+91
2022-12-21Improve code based on feedback.Bryan Garza-23/+7
This patch improves the readability of some of the code by using if-let-chains. Also, make use of the `add_feature_diagnostics` function.
2022-12-21Update track_caller logic/lint after rebaseBryan Garza-7/+12
2022-12-21update wording of lintBryan Garza-2/+2
2022-12-21Update code based on PR commentsBryan Garza-102/+40
This patch does the following: - Refactor some repeated lines into a single one - Split the `ungated_async_fn_caller` lint into multiple lines, and make one of those lines only print out on nightly - Use test revisions instead of copying an existing test
2022-12-21Switch `#[track_caller]` back to a no-op unless feature gate is enabledBryan Garza-0/+111
This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate. Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not. Fixes #104588
2022-12-20Rollup merge of #105964 - notriddle:notriddle/scraped-example-length, ↵Matthias Krüger-2/+107
r=GuillaumeGomez rustdoc: prevent CSS layout of line numbers shrinking into nothing Before: ![image](https://user-images.githubusercontent.com/1593513/208730117-039442b4-01ee-4eee-8001-26429f9d54c3.png) After: ![image](https://user-images.githubusercontent.com/1593513/208730167-ab2f95a9-1eea-48f9-a9c9-3a69d9db484a.png)