about summary refs log tree commit diff
path: root/tests/ui/rfcs
AgeCommit message (Collapse)AuthorLines
2023-09-01Auto merge of #111752 - dingxiangfei2009:lower-or-pattern, r=cjgillotbors-36/+2
Lower `Or` pattern without allocating place cc `@azizghuloum` `@cjgillot` Related to #111583 and #111644 While reviewing #111644, it occurs to me that while we directly lower conjunctive predicates, which are connected with `&&`, into the desirable control flow, today we don't directly lower the disjunctive predicates, which are connected with `||`, in the similar fashion. Instead, we allocate a place for the boolean temporary to hold the result of evaluating the `||` expression. Usually I would expect optimization at later stages to "inline" the evaluation of boolean predicates into simple CFG, but #111583 is an example where `&&` is failing to be optimized away and the assembly shows that both the expensive operands are evaluated. Therefore, I would like to make a small change to make the CFG a bit more straight-forward without invoking the `as_temp` machinery, and plus avoid allocating the place to hold the boolean result as well.
2023-08-30Test and note unsafe ctor to fn ptr coercionMichael Goulet-2/+0
Also remove a note that I don't consider to be very useful in context.
2023-08-30lower bare boolean expression with if-constructDing Xiang Fei-14/+2
2023-08-30lower ExprKind::Use, LogicalOp::Or and UnOp::NotDing Xiang Fei-24/+2
Co-authored-by: Abdulaziz Ghuloum <aghuloum@gmail.com>
2023-08-28Add note when matching on nested non-exhaustive enumsSebastian Toh-2/+3
2023-08-26Remove unnecessary `select_obligations_where_possible` and redundant errorsEsteban Küber-12/+1
2023-08-26On let binding type point to type parameter that introduced unmet boundEsteban Küber-1/+12
On the following example, point at `String` instead of the whole type: ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/own-bound-span.rs:14:24 | LL | let _: <S as D>::P<String>; | ^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `D::P` --> $DIR/own-bound-span.rs:4:15 | LL | type P<T: Copy>; | ^^^^ required by this bound in `D::P` ```
2023-08-25Handle Self in paths tooMichael Goulet-4/+4
2023-08-24Add more tests for if_let_guardMatthew Jasper-0/+298
2023-08-15Rollup merge of #114827 - compiler-errors:next-solver-dyn-safe-candidates, ↵Guillaume Gomez-0/+2
r=lcnr Only consider object candidates for object-safe dyn types in new solver We apparently allow this per RFC2027 :skull: r? lcnr
2023-08-15Only consider object candidates for object-safe dyn typesMichael Goulet-0/+2
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-143/+81
2023-08-07Fix ICEDeadbeef-24/+2
2023-08-06bless testsDeadbeef-217/+144
2023-08-06lower impl const to bind to host effect paramDeadbeef-1/+1
2023-08-02Remove constness from `TraitPredicate`Deadbeef-64/+286
2023-07-29Effects: don't print `host` param in diagnosticsDeadbeef-8/+7
2023-07-27update tests, adding known-bugDeadbeef-451/+207
2023-07-23add proc macro testDeadbeef-0/+30
2023-07-23reimplement C string literalsDeadbeef-88/+12
2023-07-23Auto merge of #111836 - calebzulawski:target-feature-closure, r=workingjubileebors-0/+18
Fix #[inline(always)] on closures with target feature 1.1 Fixes #108655. I think this is the most obvious solution that isn't overly complicated. The comment includes more justification, but I think this is likely better than demoting the `#[inline(always)]` to `#[inline]`, since existing code is unaffected.
2023-07-19Rollup merge of #113754 - cjgillot:simplify-foreign, r=petrochenkovDylan DPC-2/+2
Simplify native_libs query Drive-by cleanup I saw while implementing https://github.com/rust-lang/rust/pull/113734
2023-07-19Auto merge of #112591 - jfgoog:better-dlltool-diagnostics, r=WaffleLapkinbors-1/+6
Better diagnostics for dlltool errors. When dlltool fails, show the full command that was executed. In particular, llvm-dlltool is not very helpful, printing a generic usage message rather than what actually went wrong, so stdout and stderr aren't of much use when troubleshooting.
2023-07-18Bless ui tests.Camille GILLOT-2/+2
2023-07-17Better diagnostics for dlltool errors.James Farrell-1/+6
When dlltool fails, show the full command that was executed. In particular, llvm-dlltool is not very helpful, printing a generic usage message rather than what actually went wrong, so stdout and stderr aren't of much use when troubleshooting.
2023-07-12Auto merge of #112945 - compiler-errors:tighten-span-of-adjustment-error, ↵bors-1/+1
r=oli-obk (re-)tighten sourceinfo span of adjustments in MIR Diagnostics rely on the spans of MIR statements being (approximately) correct in order to give suggestions relative to that span (i.e. `shrink_to_hi` and `shrink_to_lo`). I discovered that we're *intentionally* lowering THIR exprs with their parent expr's span if they come from adjustments that are due to a parent expression. While I understand why that may be desirable to demonstrate the relationship of an adjustment and the expression that requires it, it leads to 1. very verbose borrowck output 2. incorrect spans for suggestions Some diagnostics get around that by giving suggestions relative to other spans we've collected during MIR lowering, such as the span of the method's identifier (e.g. `name` in `.name()`), but this doesn't work too well when things come from desugaring. I assume it also has lead to numerous tweaks and complications to diagnostics code down the road, which this PR doesn't necessarily aim to fix but may open the gates to fixing later... The last three commits are simplifications due to the fact that we can assume that the move span actually points to what is being moved (and a test). This regressed in #89110, which was debated somewhat in #90286. cc `@Aaron1011` who originally made this change. r? diagnostics Fixes #113547 Fixes #111016
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-1/+1
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-3/+15
2023-07-06Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errorsfee1-dead-16/+120
Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated
2023-07-05Add regression testLeón Orell Valerian Liehr-0/+24
2023-07-05Revert the lexing of c_str_literalsLeón Orell Valerian Liehr-16/+96
2023-07-04add testDeadbeef-0/+29
2023-06-20Auto merge of #112320 - compiler-errors:do-not-impl-via-obj, r=lcnrbors-0/+4
Add `implement_via_object` to `rustc_deny_explicit_impl` to control object candidate assembly Some built-in traits are special, since they are used to prove facts about the program that are important for later phases of compilation such as codegen and CTFE. For example, the `Unsize` trait is used to assert to the compiler that we are able to unsize a type into another type. It doesn't have any methods because it doesn't actually *instruct* the compiler how to do this unsizing, but this is later used (alongside an exhaustive match of combinations of unsizeable types) during codegen to generate unsize coercion code. Due to this, these built-in traits are incompatible with the type erasure provided by object types. For example, the existence of `dyn Unsize<T>` does not mean that the compiler is able to unsize `Box<dyn Unsize<T>>` into `Box<T>`, since `Unsize` is a *witness* to the fact that a type can be unsized, and it doesn't actually encode that unsizing operation in its vtable as mentioned above. The old trait solver gets around this fact by having complex control flow that never considers object bounds for certain built-in traits: https://github.com/rust-lang/rust/blob/2f896da247e0ee8f0bef7cd7c54cfbea255b9f68/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs#L61-L132 However, candidate assembly in the new solver is much more lovely, and I'd hate to add this list of opt-out cases into the new solver. Instead of maintaining this complex and hard-coded control flow, instead we can make this a property of the trait via a built-in attribute. We already have such a build attribute that's applied to every single trait that we care about: `rustc_deny_explicit_impl`. This PR adds `implement_via_object` as a meta-item to that attribute that allows us to opt a trait out of object-bound candidate assembly as well. r? `@lcnr`
2023-06-20Merge attrs, better validationMichael Goulet-0/+4
2023-06-18Better error for non const `PartialEq` call generated by `match`Deadbeef-0/+51
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-3/+3
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-06-05Better group RFC ui tests togetherMaybe Waffle-83/+16406
2023-05-22Fix #[inline(always)] on closures with target feature 1.1Caleb Zulawski-0/+18
2023-05-02fix tidyDeadbeef-0/+0
2023-05-02make it semantic errorDeadbeef-0/+0
2023-05-02try gating early, add non-ascii testDeadbeef-0/+10
2023-05-02fix TODO commentsDeadbeef-0/+6
2023-05-02update and add a few testsDeadbeef-0/+35
2023-03-12Forbid the use of `#[target_feature]` on `start`Léo Lanteri Thauvin-0/+20
2023-03-12Forbid the use of `#[target_feature]` on `main`Léo Lanteri Thauvin-0/+15
2023-03-10Forbid `#[target_feature]` on safe default implementationsLéo Lanteri Thauvin-1/+16
2023-03-02Revert "Stabilize `#![feature(target_feature_11)]`"Léo Lanteri Thauvin-35/+69
This reverts commit b379d216eefaba083a0627b1724d73f99d4bdf5c.
2023-02-01Stabilize `#![feature(target_feature_11)]`Léo Lanteri Thauvin-69/+35
2023-01-30Make structured suggestion for fn casting verboseEsteban Küber-8/+12
2023-01-30Mention fn coercion rules (needs to be expanded)Esteban Küber-0/+2