rust/tests/ui/rfcs
Esteban Küber 71b0755a98 Provide more context when mutably borrowing an imutable borrow
Point at statics and consts being mutable borrowed or written to:

```
error[E0594]: cannot assign to immutable static item `NUM`
  --> $DIR/E0594.rs:4:5
   |
LL | static NUM: i32 = 18;
   | --------------- this `static` cannot be written to
...
LL |     NUM = 20;
   |     ^^^^^^^^ cannot assign
```

Point at the expression that couldn't be mutably borrowed from a pattern:

```
error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/mut-pattern-of-immutable-borrow.rs:19:14
   |
LL |     match &arg.field {
   |           ---------- this cannot be borrowed as mutable
LL |         Some(ref mut s) => s.push('a'),
   |              ^^^^^^^^^ cannot borrow as mutable
```
2025-11-09 22:14:48 +00:00
..
impl-trait Remove some annotations that just specify the default 2024-02-22 16:56:26 +00:00
rfc-0000-never_patterns Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
rfc-0107-bind-by-move-pattern-guards Suggest .clone() in some move errors 2024-04-11 16:41:41 +00:00
rfc-1014-stdout-existential-crisis Remove libc from more tests 2024-04-17 08:36:49 -04:00
rfc-1445-restrict-constants-in-patterns Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
rfc-1623-static properly fill a promoted's required_consts 2024-04-23 23:02:54 +02:00
rfc-1717-dllimport compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
rfc-1789-as-cell Stabilize as_array_of_cells 2025-07-17 09:11:44 +02:00
rfc-1857-stabilize-drop-order [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-1937-termination-trait On E0277, point at type that doesn't implement bound 2025-08-22 17:55:15 +00:00
rfc-2005-default-binding-mode Provide more context when mutably borrowing an imutable borrow 2025-11-09 22:14:48 +00:00
rfc-2008-non-exhaustive refactor target checking, move out of context.rs and rename MaybeWarn to Policy 2025-08-21 13:15:30 +02:00
rfc-2091-track-caller Update uitests with new unused_attributes warnings 2025-10-18 21:17:48 +02:00
rfc-2093-infer-outlives Avoid looking at HIR for trait and impl items 2025-06-30 08:45:43 +00:00
rfc-2126-crate-paths Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2126-extern-absolute-paths Trim suggestion parts to the subset that is purely additive 2025-02-14 00:44:10 -08:00
rfc-2151-raw-identifiers [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2175-or-if-while-let [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2294-if-let-guard Update ui tests with new macro early erroring 2025-07-25 23:46:28 +02:00
rfc-2302-self-struct-ctor [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2306-convert-id [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2361-dbg-macro Stop dbg! macro yapping about format modifiers 2025-06-22 10:58:27 +02:00
rfc-2396-target_feature-11 future-incompat lints: don't link to the nightly edition-guide version 2025-07-16 01:44:02 -07:00
rfc-2421-unreserve-pure-offsetof-sizeof-alignof [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2457-non-ascii-idents Move more tests/ui tests 2025-05-12 16:35:09 +02:00
rfc-2497-if-let-chains bless tests with new lint messages 2025-08-19 21:27:10 +02:00
rfc-2528-type-changing-struct-update UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rfc-2565-param-attrs Update uitests with new unused_attributes warnings 2025-10-18 21:17:48 +02:00
rfc-3348-c-string-literals Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
rfc-3467-unsafe-pinned Initial UnsafePinned/UnsafeUnpin impl [Part 1: Libs] 2025-04-13 01:11:04 -04:00
type-alias-impl-trait handle opaque types before region inference 2025-08-20 11:04:38 +02:00
rfc-3391-result-ffi-guarantees.rs lang: Strengthen RFC 3391 guarantees to match T-lang consensus 2024-10-21 00:43:36 -07:00