about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-10-25FileCheck asm_unwindRyan Mehri-1/+2
2023-10-25Rollup merge of #117175 - oli-obk:gen_fn_split, r=compiler-errorsMatthias Krüger-7/+7
Rename AsyncCoroutineKind to CoroutineSource pulled out of https://github.com/rust-lang/rust/pull/116447 Also refactors the printing infra of `CoroutineSource` to be ready for easily extending it with a `Gen` variant for `gen` blocks
2023-10-25Rollup merge of #117009 - fmease:diag-disambig-sugg-crate, r=b-naberMatthias Krüger-6/+115
On unresolved imports, suggest a disambiguated path if necessary to avoid collision with local items Fixes #116970.
2023-10-25Rollup merge of #116931 - ↵Matthias Krüger-44/+87
weiznich:improve_diagnostic_on_unimplemented_warnings, r=compiler-errors Improve the warning messages for the `#[diagnostic::on_unimplemented]` This commit improves warnings emitted for malformed on unimplemented attributes by: * Improving the span of the warnings * Adding a label message to them * Separating the messages for missing and unexpected options * Adding a help message that says which options are supported r? `@compiler-errors` I'm happy to work on further improvements, so feel free to make suggestions.
2023-10-25Rollup merge of #116553 - gurry:116464-assoc-type-invalid-suggestion, ↵Matthias Krüger-0/+152
r=compiler-errors Do not suggest 'Trait<Assoc=arg>' when in trait impl Fixes #116464 We now skip the suggestion if we're in an impl of the trait.
2023-10-25Rollup merge of #116401 - WaffleLapkin:vtablin''', r=oli-obkMatthias Krüger-2/+5
Return multiple object-safety violation errors and code improvements to the object-safety check See individual commits for more information. Split off of #114260, since it turned out that the main intent of that PR was wrong. r? oli-obk
2023-10-25Stop telling people to submit bugs for internal feature ICEsNilstrieb-0/+1
This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. See MCP 620.
2023-10-25Add a public API to get all body localsKirby Linvill-1/+1
This is particularly helpful for the ui tests, but also could be helpful for Stable MIR users who just want all the locals without needing to concatenate responses
2023-10-25Never consider raw pointer casts to be trivalNilstrieb-15/+49
HIR typeck tries to figure out which casts are trivial by doing them as coercions and seeing whether this works. Since HIR typeck is oblivious of lifetimes, this doesn't work for pointer casts that only change the lifetime of the pointee, which are, as borrowck will tell you, not trivial. This change makes it so that raw pointer casts are never considered trivial. This also incidentally fixes the "trivial cast" lint false positive on the same code. Unfortunately, "trivial cast" lints are now never emitted on raw pointer casts, even if they truly are trivial. This could be fixed by also doing the lint in borrowck for raw pointers specifically.
2023-10-25Return multiple object-safety violation errorsMaybe Waffle-2/+5
2023-10-25Auto merge of #117180 - matthiaskrgr:rollup-rxhl6ep, r=matthiaskrgrbors-307/+735
Rollup of 7 pull requests Successful merges: - #117111 (Remove support for alias `-Z instrument-coverage`) - #117141 (Require target features to match exactly during inlining) - #117152 (Fix unwrap suggestion for async fn) - #117154 (implement C ABI lowering for CSKY) - #117159 (Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed`) - #117163 (compiletest: Display compilation errors in mir-opt tests) - #117173 (Make `Iterator` a lang item) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-25Avoid unbounded O(n^2) when parsing nested type argsEsteban Küber-0/+30
When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix #117080.
2023-10-25Verify that the alloc_id is Memory.Camille GILLOT-0/+52
2023-10-25Rollup merge of #117159 - oli-obk:error_shenanigans, r=estebankMatthias Krüger-75/+638
Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed` Even if that error is only emitted by `check_mod_item_types`. fixes https://github.com/rust-lang/rust/issues/117153 A cleaner refactoring would merge/chain these queries in ways that ensure we only actually get an `ErrorGuaranteed` if there was an error emitted.
2023-10-25Rollup merge of #117152 - compiler-errors:no-ret-coercion, r=chenyukangMatthias Krüger-0/+47
Fix unwrap suggestion for async fn Use `body_fn_sig` to get the expected return type of the function instead of `ret_coercion` in `FnCtxt`. This avoids accessing the `ret_coercion` when it's already mutably borrowed (e.g. when checking `return` expressions). Fixes #117144 r? `@chenyukang`
2023-10-25Rollup merge of #117141 - tmiasko:inline-target-features, r=oli-obkMatthias Krüger-226/+42
Require target features to match exactly during inlining In general it is not correct to inline a callee with a target features that are subset of the callee. Require target features to match exactly during inlining. The exact match could be potentially relaxed, but this would require identifying specific feature that are allowed to differ, those that need to match, and those that can be present in caller but not in callee. This resolves MIR part of #116573. For other concerns with respect to the previous implementation also see areInlineCompatible in LLVM.
2023-10-25Rollup merge of #117111 - Zalathar:zinstrument, r=compiler-errorsMatthias Krüger-6/+8
Remove support for alias `-Z instrument-coverage` This flag was stabilized in rustc 1.60.0 (2022-04-07) as `-C instrument-coverage`, but the old unstable flag was kept around (with a warning) as an alias to ease migration. It should now be reasonable to remove the somewhat tricky code that implemented that alias. Fixes #116980.
2023-10-25Rename in preparation for moving the `async` printing out of `CoroutineSource`Oli Scherer-7/+7
2023-10-25Remove unnecessary CVarArgs name skipping logicDaniPopes-1/+1
2023-10-25Rollup merge of #117160 - cuishuang:master, r=lqdMatthias Krüger-1/+1
Fix typo in test comment
2023-10-25Rollup merge of #117158 - matthewjasper:thir-unused-unsafe, r=oli-obkMatthias Krüger-321/+1597
Update THIR unused_unsafe lint Updates THIR unsafeck behaviour to match the changes from #93678
2023-10-25Rollup merge of #117133 - compiler-errors:coherence-constrained, r=oli-obkMatthias Krüger-9/+84
Merge `impl_wf_inference` (`check_mod_impl_wf`) check into coherence checking Problem here is that we call `collect_impl_trait_in_trait_types` when checking `check_mod_impl_wf` which is performed before coherence. Due to the `tcx.sess.track_errors`, since we end up reporting an error, we never actually proceed to coherence checking, where we would be emitting a more useful impl overlap error. This change means that we may report more errors in some cases, but can at least proceed far enough to leave a useful message for overlapping traits with RPITITs in them. Fixes #116982 r? types
2023-10-25Rollup merge of #116801 - clubby789:issue-113326-test, r=compiler-errorsMatthias Krüger-0/+31
Add test for 113326 Closes #113326 Bisecting points to #113636 as the fix
2023-10-25Print variadic argument pattern in HIR pretty printerDaniPopes-0/+28
2023-10-25Auto merge of #117113 - celinval:smir-stable-ty, r=oli-obkbors-34/+12
Remove fold code and add `Const::internal()` to StableMIR We are not planning to support user generated constant in the foreseeable future, so we are cleaning up the fold logic and user created type for now. Users should use `Instance::resolve` in order to trigger monomorphization. The Instance::resolve was however incomplete, since we weren't handling internalizing constants yet. Thus, I added that. I decided to keep the `Const` fields private in case we decide to translate them lazily.
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-75/+638
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-25Fix problematic commentcui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-25Make THIR unused_unsafe lint consistent with MIRMatthew Jasper-321/+1597
Updates THIR behavior to match the changes from #93678
2023-10-25Auto merge of #117076 - oli-obk:privacy_visitor_types, r=petrochenkovbors-17/+17
Refactor type visitor walking r? `@petrochenkov` pulling out the uncontroversial parts of https://github.com/rust-lang/rust/pull/113671
2023-10-25Do not merge fn pointer casts.Camille GILLOT-0/+261
2023-10-25FileCheck gvn.Camille GILLOT-1699/+1526
2023-10-25Disambiguate non-deterministic constants.Camille GILLOT-9/+137
2023-10-25Transform large arrays into Repeat expressions when possible.Camille GILLOT-1/+137
2023-10-25Extract simplify_aggregate.Camille GILLOT-0/+142
2023-10-25Simplify repeat expressions.Camille GILLOT-8/+12
2023-10-25Simplify aggregate projections.Camille GILLOT-118/+152
2023-10-25Simplify projections in GVN.Camille GILLOT-77/+290
2023-10-25Evaluate computed values to constants.Camille GILLOT-164/+232
2023-10-25Do not remove unused definitions inside GVN.Camille GILLOT-1114/+1345
2023-10-25Do not suggest 'Trait<Assoc=arg>' when in trait implGurinder Singh-0/+152
because that would be illegal syntax
2023-10-25Fix unwrap suggestion for async fnMichael Goulet-0/+47
2023-10-25coverage: UI test for unstable value `-C instrument-coverage=branch`Zalathar-6/+8
2023-10-24Handle structured stable attribute 'since' version in rustdocDavid Tolnay-17/+17
2023-10-25Auto merge of #116482 - matthewjasper:thir-unsafeck-inline-constants, r=b-naberbors-23/+135
Fix inline const pattern unsafety checking in THIR Fix THIR unsafety checking of inline constants. - Steal THIR in THIR unsafety checking (if enabled) instead of MIR lowering. - Represent inline constants in THIR patterns.
2023-10-24Update stability attribute sanity UI test to delete superfluous errorsDavid Tolnay-19/+6
2023-10-24Remove fold code and add Const::internal()Celina G. Val-34/+12
We are not planning to support user generated constant in the foreseeable future, so we are removing the Fold logic for now in favor of the Instance::resolve logic. The Instance::resolve was however incomplete, since we weren't handling internalizing constants yet. Thus, I added that. I decided to keep the Const fields private in case we decide to translate them lazily.
2023-10-24Auto merge of #115796 - cjgillot:const-prop-rvalue, r=oli-obkbors-140/+613
Generate aggregate constants in DataflowConstProp.
2023-10-24mv testsEsteban Küber-0/+0
2023-10-24Require target features to match exactly during inliningTomasz Miąsko-1/+1
In general it is not correct to inline a callee with a target features that are subset of the callee. Require target features to match exactly during inlining. The exact match could be potentially relaxed, but this would require identifying specific feature that are allowed to differ, those that need to match, and those that can be present in caller but not in callee. This resolves MIR part of #116573. For other concerns with respect to the previous implementation also see areInlineCompatible in LLVM.
2023-10-24Precommit target features compatibility testTomasz Miąsko-0/+8