summary refs log tree commit diff
path: root/tests/ui/rfcs
AgeCommit message (Collapse)AuthorLines
2023-09-22Auto merge of #116077 - matthiaskrgr:rollup-2y1buzg, r=matthiaskrgrbors-6/+6
Rollup of 6 pull requests Successful merges: - #115770 (Match on elem first while building move paths) - #115999 (Capture scrutinee of if let guards correctly) - #116056 (Make unsized casts illegal) - #116061 (Remove TaKO8Ki from review rotation) - #116062 (Change `start` to `#[start]` in some diagnosis) - #116067 (Open the FileEncoder file for reading and writing) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-22Auto merge of #116001 - fmease:validate-crate-name-extern-cli-opt, r=est31bors-15/+1
[breaking change] Validate crate name in `--extern` [MCP 650] Reject non-ASCII-identifier crate names passed to the CLI option `--extern` (`rustc`, `rustdoc`). Implements [MCP 650](https://github.com/rust-lang/compiler-team/issues/650) (except that we only allow ASCII identifiers not arbitrary Rust identifiers). Fixes #113035. [As mentioned on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Disallow.20non-identifier-valid.20--extern.20cr.E2.80.A6.20compiler-team.23650/near/376826988), doing a crater run probably doesn't make sense since it wouldn't yield anything. Most users don't interact with `rustc` directly but only ever through Cargo which always passes a valid crate name to `--extern` when it invokes `rustc` and `rustdoc`. In any case, the user wouldn't be able to use such a crate name in the source code anyway. Note that I'm not using [`rustc_session::output::validate_crate_name`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/output/fn.validate_crate_name.html) (used for `--crate-name` and `#![crate_name]`) since the latter doesn't reject non-ASCII crate names and ones that start with a digit. As an aside, I've also thought about getting rid of `validate_crate_name` entirely in a separate PR (with another MCP) in favor of `is_ascii_ident` to reject more weird `--crate-name`s, `#![crate_name]`s and file names but I think that would lead to a lot of actual breakage, namely because of file names starting with a digit. In `tests/ui` 9 tests would be impacted for example. CC `@estebank` r? `@est31`
2023-09-22Change `start` to `#[start]` in some diagnosisEduardo Sánchez Muñoz-6/+6
They refer to a function with the `start` attribute, but not necessarily named `start`.
2023-09-22Auto merge of #114776 - fee1-dead-contrib:enable-effects-in-libcore, r=oli-obkbors-54/+47
Enable effects for libcore ~~r? `@oli-obk~~` forgot you are on vacation, oops
2023-09-20Validate crate name in CLI option --externLeón Orell Valerian Liehr-15/+1
2023-09-20bless the known-bug testsDeadbeef-74/+59
2023-09-20Enable effects for libcoreDeadbeef-113/+121
2023-09-19Add more if let guard testsMatthew Jasper-0/+247
2023-09-15Auto merge of #115859 - compiler-errors:effect-fallback, r=fee1-deadbors-1/+8
Fallback effects even if types also fallback `||` is short circuiting, so if we do ty/int var fallback, we *don't* do effect fallback 😸 r? `@fee1-dead` or `@oli-obk` Fixes #115791 Fixes #115842
2023-09-14Fallback effects even if types also fall backMichael Goulet-1/+8
2023-09-14Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naberbors-1694/+1881
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
2023-09-13Address review commentsMatthew Jasper-0/+343
- Add doc comment to new type - Restore "only supported directly in conditions of `if` and `while` expressions" note - Rename variant with clearer name
2023-09-11Reduce double errors for invalid let expressionsMatthew Jasper-121/+1241
Previously some invalid let expressions would result in both a feature error and a parsing error. Avoid this and ensure that we only emit the parsing error when this happens.
2023-09-11Move let expression checking to parsingMatthew Jasper-1794/+476
There was an incomplete version of the check in parsing and a second version in AST validation. This meant that some, but not all, invalid uses were allowed inside macros/disabled cfgs. It also means that later passes have a hard time knowing when the let expression is in a valid location, sometimes causing ICEs. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress later errors and MIR construction for invalid let expressions.
2023-09-11Don't create drop scopes after item statementsMatthew Jasper-0/+42
These scopes would not exist in MIR and can cause ICEs with invalid uses of let expressions.
2023-09-10Implement fallback for effect paramDeadbeef-0/+9
2023-09-03Auto merge of #115270 - sebastiantoh:issue-105479, r=Nadrierilbors-2/+3
Add note on non-exhaustiveness when matching on str and nested non-exhaustive enums Fixes https://github.com/rust-lang/rust/issues/105479 r? `@Nadrieril`
2023-09-03Improve clarity of diagnostic message on non-exhaustive matchesSebastian Toh-1/+1
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