public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] libproc_macro: Implement Display for LexError
@ 2023-04-06 21:31 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-06 21:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b74ef5aca042ea3f89c5b5eedd027dac9a457425
commit b74ef5aca042ea3f89c5b5eedd027dac9a457425
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Mon Feb 20 13:40:03 2023 +0100
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>
Diff:
---
librust/proc_macro/rust/lib.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs
index 31676f15199..13f66f04fac 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")
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-06 21:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 21:31 [gcc/devel/rust/master] libproc_macro: Implement Display for LexError Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).