Commit Graph

240419 Commits

Author SHA1 Message Date
Matthias Krüger
81b6263dd0
Rollup merge of #118598 - Nadrieril:remove_precise_pointer_size_matching, r=davidtwco
Remove the `precise_pointer_size_matching` feature gate

`usize` and `isize` are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive:
```rust
let x: usize = ...;
match x {
    0..=18446744073709551615 => {}
}
```
Because of how rust handles constants, this also unfortunately counts `0..=usize::MAX` as non-exhaustive. The [`precise_pointer_size_matching`](https://github.com/rust-lang/rust/issues/56354) feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above.

Since then, [half-open range patterns](https://github.com/rust-lang/rust/issues/67264) have been implemented, and since #116692 they correctly support `usize`/`isize`:
```rust
match 0usize { // exhaustive!
    0..5 => {}
    5.. => {}
}
```
I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate.

Closes https://github.com/rust-lang/rust/issues/56354
2023-12-05 16:08:35 +01:00
Matthias Krüger
fddda14ac0
Rollup merge of #118594 - hdost:patch-1, r=fmease
Remove mention of rust to make the error message generic.

The deprecation notice is used when in crates as well. This applies to versions Rust or Crates.

Relates #118148
2023-12-05 16:08:35 +01:00
Matthias Krüger
30b4cefe64
Rollup merge of #118471 - filenine:fix-typos, r=workingjubilee
Fix typos in README.md

The section formerly titled "Table of content" has been corrected and capitalized using title case. It's now "Table of Contents".
2023-12-05 16:08:34 +01:00
Matthias Krüger
2d01eeeeac
Rollup merge of #117922 - estebank:unclosed-generics, r=b-naber
Tweak unclosed generics errors

Remove unnecessary span label for parse errors that already have a suggestion.

Provide structured suggestion to close generics in more cases.
2023-12-05 16:08:34 +01:00
bors
154f645d76 Auto merge of #118362 - RalfJung:panic_nounwind, r=thomcc
make sure panic_nounwind_fmt can still be fully inlined (e.g. for panic_immediate_abort)

Follow-up to https://github.com/rust-lang/rust/pull/110303.
2023-12-05 12:05:22 +00:00
bors
f536185ed8 Auto merge of #118640 - RalfJung:miri, r=RalfJung
Miri subtree update

needed to fix some errors in miri-test-libstd
2023-12-05 08:32:36 +00:00
Harold Dost
1b503042b8 Remove mention of rust to make the error message generic.
The deprecation notice is used when in crates as well. This applies to versions Rust or Crates.

Fixes #118148

Signed-off-by: Harold Dost <h.dost@criteo.com>
2023-12-05 09:18:41 +01:00
bors
73db2e48d7 Auto merge of #3211 - RalfJung:promise, r=RalfJung
fix promising a very large alignment

Also make use of https://github.com/rust-lang/rust/pull/118565 to simplify some SIMD intrinsics, while we are at it
2023-12-05 07:12:28 +00:00
Ralf Jung
1fa8fd800f simd numeric intrinsics: share code with scalar intrinsic 2023-12-05 07:42:13 +01:00
Ralf Jung
ff95f8b872 fix miri_promise_symbolic_alignment for huge alignments 2023-12-05 07:39:52 +01:00
bors
f67523d0b3 Auto merge of #118076 - estebank:issue-109429, r=davidtwco
Tweak `.clone()` suggestion to work in more cases

When going through auto-deref, the `<T as Clone>` impl sometimes needs to be specified for rustc to actually clone the value and not the reference.

```
error[E0507]: cannot move out of dereference of `S`
  --> $DIR/needs-clone-through-deref.rs:15:18
   |
LL |         for _ in self.clone().into_iter() {}
   |                  ^^^^^^^^^^^^ ----------- value moved due to this method call
   |                  |
   |                  move occurs because value has type `Vec<usize>`, which does not implement the `Copy` trait
   |
note: `into_iter` takes ownership of the receiver `self`, which moves value
  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |         for _ in <Vec<usize> as Clone>::clone(&self.clone()).into_iter() {}
   |                  ++++++++++++++++++++++++++++++            +
```

When encountering a move error, look for implementations of `Clone` for the moved type. If there is one, check if all its obligations are met. If they are, we suggest cloning without caveats. If they aren't, we suggest cloning while mentioning the unmet obligations, potentially suggesting `#[derive(Clone)]` when appropriate.

```
error[E0507]: cannot move out of a shared reference
  --> $DIR/suggest-clone-when-some-obligation-is-unmet.rs:20:28
   |
LL |     let mut copy: Vec<U> = map.clone().into_values().collect();
   |                            ^^^^^^^^^^^ ------------- value moved due to this method call
   |                            |
   |                            move occurs because value has type `HashMap<T, U, Hash128_1>`, which does not implement the `Copy` trait
   |
note: `HashMap::<K, V, S>::into_values` takes ownership of the receiver `self`, which moves value
  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied
   |
LL |     let mut copy: Vec<U> = <HashMap<T, U, Hash128_1> as Clone>::clone(&map.clone()).into_values().collect();
   |                            ++++++++++++++++++++++++++++++++++++++++++++           +
help: consider annotating `Hash128_1` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | pub struct Hash128_1;
   |
```

Fix #109429.

When encountering multiple mutable borrows, suggest cloning and adding
derive annotations as needed.

```
error[E0596]: cannot borrow `sm.x` as mutable, as it is behind a `&` reference
  --> $DIR/accidentally-cloning-ref-borrow-error.rs:32:9
   |
LL |     foo(&mut sm.x);
   |         ^^^^^^^^^ `sm` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: `Str` doesn't implement `Clone`, so this call clones the reference `&Str`
  --> $DIR/accidentally-cloning-ref-borrow-error.rs:31:21
   |
LL |     let mut sm = sr.clone();
   |                     ^^^^^^^
help: consider annotating `Str` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | struct Str {
   |
help: consider specifying this binding's type
   |
LL |     let mut sm: &mut Str = sr.clone();
   |               ++++++++++
```

Fix #34629. Fix #76643. Fix #91532.
2023-12-05 06:34:44 +00:00
Ralf Jung
6237f2381d fix typo in comment 2023-12-05 07:32:49 +01:00
bors
88d905cb3a Auto merge of #3210 - rust-lang:rustup-2023-12-05, r=RalfJung
Automatic Rustup
2023-12-05 06:19:41 +00:00
The Miri Conjob Bot
0d5fdcca6c fmt 2023-12-05 05:17:10 +00:00
The Miri Conjob Bot
cf1ef1300e Merge from rustc 2023-12-05 05:15:52 +00:00
The Miri Conjob Bot
d651eb9e23 Preparing for merge from rustc 2023-12-05 05:09:34 +00:00
bors
9358642e3b Auto merge of #118066 - estebank:structured-use-suggestion, r=b-naber
Structured `use` suggestion on privacy error

When encoutering a privacy error on an item through a re-export that is accessible in an alternative path, provide a structured suggestion with that path.

```
error[E0603]: module import `mem` is private
  --> $DIR/private-std-reexport-suggest-public.rs:4:14
   |
LL |     use foo::mem;
   |              ^^^ private module import
   |
note: the module import `mem` is defined here...
  --> $DIR/private-std-reexport-suggest-public.rs:8:9
   |
LL |     use std::mem;
   |         ^^^^^^^^
note: ...and refers to the module `mem` which is defined here
  --> $SRC_DIR/std/src/lib.rs:LL:COL
   |
   = note: you could import this
help: import `mem` through the re-export
   |
LL |     use std::mem;
   |         ~~~~~~~~
```

Fix #42909.
2023-12-05 04:34:57 +00:00
bors
317d14a56c Auto merge of #118230 - nnethercote:streamline-dataflow-cursors, r=cjgillot
Streamline MIR dataflow cursors

`rustc_mir_dataflow` has two kinds of results (`Results` and `ResultsCloned`) and three kinds of results cursor (`ResultsCursor`, `ResultsClonedCursor`, `ResultsRefCursor`). I found this quite confusing.

This PR removes `ResultsCloned`, `ResultsClonedCursor`, and `ResultsRefCursor`, leaving just `Results` and `ResultsCursor`. This makes the relevant code shorter and easier to read, and there is no performance penalty.

r? `@cjgillot`
2023-12-05 02:36:50 +00:00
bors
25dca40751 Auto merge of #117088 - lcnr:generalize-alias, r=compiler-errors
generalize: handle occurs check failure in aliases

mostly fixes #105787, except for the `for<'a> fn(<<?x as OtherTrait>::Assoc as Trait<'a>>::Assoc) eq ?x` case in https://github.com/rust-lang/trait-system-refactor-initiative/issues/8.

r? `@compiler-errors`
2023-12-05 00:37:58 +00:00
bors
da1da3f1a0 Auto merge of #118618 - GuillaumeGomez:rollup-24ur21r, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #118508 (rustdoc: do not escape quotes in body text)
 - #118565 (interpret: make numeric_intrinsic accessible from Miri)
 - #118591 (portable-simd: fix test suite build)
 - #118600 ([rustdoc] Don't generate the "Fields" heading if there is no field displayed)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-04 22:26:41 +00:00
Esteban Küber
beaf31581a Structured use suggestion on privacy error
When encoutering a privacy error on an item through a re-export that is
accessible in an alternative path, provide a structured suggestion with
that path.

```
error[E0603]: module import `mem` is private
  --> $DIR/private-std-reexport-suggest-public.rs:4:14
   |
LL |     use foo::mem;
   |              ^^^ private module import
   |
note: the module import `mem` is defined here...
  --> $DIR/private-std-reexport-suggest-public.rs:8:9
   |
LL |     use std::mem;
   |         ^^^^^^^^
note: ...and refers to the module `mem` which is defined here
  --> $SRC_DIR/std/src/lib.rs:LL:COL
   |
   = note: you could import this
help: import `mem` through the re-export
   |
LL |     use std::mem;
   |         ~~~~~~~~
```

Fix #42909.
2023-12-04 22:26:08 +00:00
Esteban Küber
a8faa8288c Fix rebase 2023-12-04 22:00:34 +00:00
Esteban Küber
cc80106cb5 Provide more suggestions for cloning immutable bindings
When encountering multiple mutable borrows, suggest cloning and adding
derive annotations as needed.

```
error[E0596]: cannot borrow `sm.x` as mutable, as it is behind a `&` reference
  --> $DIR/accidentally-cloning-ref-borrow-error.rs:32:9
   |
LL |     foo(&mut sm.x);
   |         ^^^^^^^^^ `sm` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: `Str` doesn't implement `Clone`, so this call clones the reference `&Str`
  --> $DIR/accidentally-cloning-ref-borrow-error.rs:31:21
   |
LL |     let mut sm = sr.clone();
   |                     ^^^^^^^
help: consider annotating `Str` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | struct Str {
   |
help: consider specifying this binding's type
   |
LL |     let mut sm: &mut Str = sr.clone();
   |               ++++++++++
```

```
error[E0596]: cannot borrow `*inner` as mutable, as it is behind a `&` reference
  --> $DIR/issue-91206.rs:14:5
   |
LL |     inner.clear();
   |     ^^^^^ `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: you can `clone` the `Vec<usize>` value and consume it, but this might not be your desired behavior
  --> $DIR/issue-91206.rs:11:17
   |
LL |     let inner = client.get_inner_ref();
   |                 ^^^^^^^^^^^^^^^^^^^^^^
help: consider specifying this binding's type
   |
LL |     let inner: &mut Vec<usize> = client.get_inner_ref();
   |              +++++++++++++++++
```
2023-12-04 21:54:34 +00:00
Esteban Küber
210a672005 Deduplicate some logic 2023-12-04 21:54:33 +00:00
Esteban Küber
a754fcaa43 On "this .clone() is on the reference", provide more info
When encountering a case where `let x: T = (val: &T).clone();` and
`T: !Clone`, already mention that the reference is being cloned. We now
also suggest `#[derive(Clone)]` not only on `T` but also on type
parameters to satisfy blanket implementations.

```
error[E0308]: mismatched types
  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:17:39
   |
LL |             let mut x: HashSet<Day> = v.clone();
   |                        ------------   ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
   |                        |
   |                        expected due to this
   |
   = note: expected struct `HashSet<Day>`
           found reference `&HashSet<Day>`
note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:17:39
   |
LL |             let mut x: HashSet<Day> = v.clone();
   |                                       ^
   = help: `Clone` is not implemented because the trait bound `Day: Clone` is not satisfied
help: consider annotating `Day` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | enum Day {
   |
```

Case taken from # #41825.
2023-12-04 21:54:33 +00:00
Esteban Küber
1c69c6ab08 Mark more tests as run-rustfix 2023-12-04 21:54:32 +00:00
Esteban Küber
90db536741 Tweak output on specific case 2023-12-04 21:54:32 +00:00
Esteban Küber
98cfed7b97 Suggest cloning and point out obligation errors on move error
When encountering a move error, look for implementations of `Clone` for
the moved type. If there is one, check if all its obligations are met.
If they are, we suggest cloning without caveats. If they aren't, we
suggest cloning while mentioning the unmet obligations, potentially
suggesting `#[derive(Clone)]` when appropriate.

```
error[E0507]: cannot move out of a shared reference
  --> $DIR/suggest-clone-when-some-obligation-is-unmet.rs:20:28
   |
LL |     let mut copy: Vec<U> = map.clone().into_values().collect();
   |                            ^^^^^^^^^^^ ------------- value moved due to this method call
   |                            |
   |                            move occurs because value has type `HashMap<T, U, Hash128_1>`, which does not implement the `Copy` trait
   |
note: `HashMap::<K, V, S>::into_values` takes ownership of the receiver `self`, which moves value
  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied
   |
LL |     let mut copy: Vec<U> = <HashMap<T, U, Hash128_1> as Clone>::clone(&map.clone()).into_values().collect();
   |                            ++++++++++++++++++++++++++++++++++++++++++++           +
help: consider annotating `Hash128_1` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | pub struct Hash128_1;
   |
```

Fix #109429.
2023-12-04 21:54:32 +00:00
Esteban Küber
03c88aaf21 Tweak .clone() suggestion to work in more cases
When going through auto-deref, the `<T as Clone>` impl sometimes needs
to be specified for rustc to actually clone the value and not the
reference.

```
error[E0507]: cannot move out of dereference of `S`
  --> $DIR/needs-clone-through-deref.rs:15:18
   |
LL |         for _ in self.clone().into_iter() {}
   |                  ^^^^^^^^^^^^ ----------- value moved due to this method call
   |                  |
   |                  move occurs because value has type `Vec<usize>`, which does not implement the `Copy` trait
   |
note: `into_iter` takes ownership of the receiver `self`, which moves value
  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |         for _ in <Vec<usize> as Clone>::clone(&self.clone()).into_iter() {}
   |                  ++++++++++++++++++++++++++++++            +
```

CC #109429.
2023-12-04 21:54:32 +00:00
Guillaume Gomez
baa3f96b42
Rollup merge of #118600 - GuillaumeGomez:fields-heading, r=notriddle
[rustdoc] Don't generate the "Fields" heading if there is no field displayed

Fixes https://github.com/rust-lang/rust/issues/118195.

If no field is displayed, we should not generate the `Fields` heading in enum struct variants.

r? ``@notriddle``
2023-12-04 20:46:10 +01:00
Guillaume Gomez
89ed7fc040
Rollup merge of #118591 - RalfJung:portable-simd-build-fix, r=workingjubilee,calebzulawski
portable-simd: fix test suite build

``@workingjubilee`` ``@calebzulawski`` don't we run these portable-simd tests on rustc CI? Currently they don't even build here.
2023-12-04 20:46:10 +01:00
Guillaume Gomez
4128809726
Rollup merge of #118565 - RalfJung:numeric_intrinsic, r=davidtwco
interpret: make numeric_intrinsic accessible from Miri

This will let us share the code of the cttz and simd_cttz intrinsics (and same for ctlz).
2023-12-04 20:46:09 +01:00
Guillaume Gomez
963e8e8bd8
Rollup merge of #118508 - notriddle:notriddle/fmt-newline, r=GuillaumeGomez
rustdoc: do not escape quotes in body text

Escaping quote marks is only needed in attributes, not text.

```console
$ du -hs doc-old/ doc-new/
670M    doc-old/
669M    doc-new/
```
2023-12-04 20:46:09 +01:00
bors
0e2dac8375 Auto merge of #118592 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2023-12-04 17:18:56 +00:00
bors
e281163dc8 Auto merge of #118602 - TaKO8Ki:rollup-njcouns, r=TaKO8Ki
Rollup of 5 pull requests

Successful merges:

 - #118495 (Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` format strings)
 - #118540 (codegen, miri: fix computing the offset of an unsized field in a packed struct)
 - #118551 (more targeted errors when extern types end up in places they should not)
 - #118573 (rustc: Harmonize `DefKind` and `DefPathData`)
 - #118586 (Improve example in `slice::windows()` doc)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-04 14:46:49 +00:00
bors
0a83e43f28 Auto merge of #118597 - lnicola:cargotest-no-branch, r=Mark-Simulacrum
Don't ask for a specific branch in cargotest

Tentative fix for https://github.com/rust-lang/rust/pull/118592#issuecomment-1838180918.

`servo` [just renamed](https://github.com/servo/servo/pull/30788) their `master` branch to `main`, but `cargotest` does a `git fetch $URL master; git reset --hard $SHA`. Let's try to change that to `git fetch $URL $SHA; git reset --hard $SHA`, which appears to work, but I can't confirm for sure because I'm having some trouble with `x.py`:

```
 --> library/rustc-std-workspace-core/lib.rs:4:9
  |
4 | pub use core::*;
  |         ^^^^
  |
  = note: the following crate versions were found:
          crate `core` compiled by rustc 1.76.0-nightly (85a4bd8f5 2023-12-04): ./build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-70719e8645e6f000.rmeta
  = help: please recompile that crate using this compiler (rustc 1.76.0-nightly (5808b7248 2023-12-04)) (consider running `cargo clean` first)
```
2023-12-04 12:26:55 +00:00
Takayuki Maeda
f1397e6ff2
Rollup merge of #118586 - gurry:118571-improve-slice-doc-example, r=thomcc
Improve example in `slice::windows()` doc

Fixes #118571

Now using a window of 3 instead 2 because it removes any confusion about exactly how consecutive windows overlap
2023-12-04 21:19:45 +09:00
Takayuki Maeda
30a4215532
Rollup merge of #118573 - petrochenkov:pathdatakind, r=TaKO8Ki
rustc: Harmonize `DefKind` and `DefPathData`

Follow up to https://github.com/rust-lang/rust/pull/118188.

`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`.

`DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`.
It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` instead could be a better solution, but that would be a much more invasive change.

Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values.

`DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
2023-12-04 21:19:45 +09:00
Takayuki Maeda
da2fb8109e
Rollup merge of #118551 - RalfJung:extern-types-bugs, r=compiler-errors
more targeted errors when extern types end up in places they should not

Cc https://github.com/rust-lang/rust/issues/115709 -- this does not fix that bug but it makes the panics less obscure and makes it more clear that this is a deeper issue than just a little codegen oversight. (In https://github.com/rust-lang/rust/pull/116115 we decided we'd stick to causing ICEs here for now, rather than nicer errors. We can't currently show any errors pre-mono and probably we don't want post-mono checks when this gets stabilized anyway.)
2023-12-04 21:19:44 +09:00
Takayuki Maeda
87625dbf2b
Rollup merge of #118540 - RalfJung:unsized-packed-offset, r=TaKO8Ki
codegen, miri: fix computing the offset of an unsized field in a packed struct

`#[repr(packed)]`  strikes again.

Fixes https://github.com/rust-lang/rust/issues/118537
Fixes https://github.com/rust-lang/miri/issues/3200

`@bjorn3` I assume cranelift needs the same fix.
2023-12-04 21:19:44 +09:00
Takayuki Maeda
da30882eb3
Rollup merge of #118495 - weiznich:more_tests_for_on_unimplemented, r=compiler-errors
Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` format strings

This commit restricts what symbols can be used in a format string for any option of the `diagnostic::on_unimplemented` attribute. We previously allowed all the ad-hoc options supported by the internal `#[rustc_on_unimplemented]` attribute. For the stable attribute we only want to support generic parameter names and `{Self}` as parameters.  For any other parameter an warning is emitted and the parameter is replaced by the literal parameter string, so for example `{integer}` turns into `{integer}`. This follows the general design of attributes in the `#[diagnostic]` attribute namespace, that any syntax "error" is treated as warning and subsequently ignored.

r? `@compiler-errors`
2023-12-04 21:19:43 +09:00
Guillaume Gomez
8e53edb2ec Add regression test for #118195 2023-12-04 12:13:24 +01:00
Guillaume Gomez
1c556bbed4 Don't generate the "Fields" heading if there is no field displayed 2023-12-04 12:12:13 +01:00
Nadrieril
5e470db05c Remove the precise_pointer_size_matching feature gate 2023-12-04 11:56:21 +01:00
Laurențiu Nicola
5808b72484 Don't ask for a specific branch in cargotest 2023-12-04 12:11:44 +02:00
lcnr
cf8a2bdd81 rebase 2023-12-04 10:48:00 +01:00
lcnr
407c117e88 cleanup and comments 2023-12-04 10:40:36 +01:00
lcnr
f69d67221e generalize: handle occurs check failure in aliases 2023-12-04 10:39:00 +01:00
lcnr
2d0ec174e4 do not fetch variance info during generalization 2023-12-04 10:38:43 +01:00
Georg Semmler
1a1cd6e6db
Restrict what symbols can be used in #[diagnostic::on_unimplemented] format strings
This commit restricts what symbols can be used in a format string for
any option of the `diagnostic::on_unimplemented` attribute. We
previously allowed all the ad-hoc options supported by the internal
`#[rustc_on_unimplemented]` attribute. For the stable attribute we only
want to support generic parameter names and `{Self}` as parameters.  For
any other parameter an warning is emitted and the parameter is replaced
by the literal parameter string, so for example `{integer}` turns into
`{integer}`. This follows the general design of attributes in the
`#[diagnostic]` attribute namespace, that any syntax "error" is treated
as warning and subsequently ignored.
2023-12-04 10:00:33 +01:00