diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-02-20 13:40:03 +0100 |
---|---|---|
committer | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-03-30 13:52:30 +0200 |
commit | b74ef5aca042ea3f89c5b5eedd027dac9a457425 (patch) | |
tree | eae733e5545edcfae4f465b4e3b9033e4bcd8275 | |
parent | 09c75e3750858577efe09a51416546b1e5cc0f5c (diff) | |
download | gcc-b74ef5aca042ea3f89c5b5eedd027dac9a457425.zip gcc-b74ef5aca042ea3f89c5b5eedd027dac9a457425.tar.gz gcc-b74ef5aca042ea3f89c5b5eedd027dac9a457425.tar.bz2 |
libproc_macro: Implement Display for LexError
Implement the Display trait for LexError by writing an error string to
the the output formatter.
ChangeLog:
* librust/proc_macro/rust/lib.rs: Implement Display for
LexError.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r-- | librust/proc_macro/rust/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs index 31676f1..13f66f0 100644 --- a/librust/proc_macro/rust/lib.rs +++ b/librust/proc_macro/rust/lib.rs @@ -124,8 +124,8 @@ impl From<Literal> for TokenTree { pub struct LexError; impl fmt::Display for LexError { - fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { - todo!("Implement this function") + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("cannot parse string into token stream") } } |