aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-20 13:40:03 +0100
committerPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-03-30 13:52:30 +0200
commitb74ef5aca042ea3f89c5b5eedd027dac9a457425 (patch)
treeeae733e5545edcfae4f465b4e3b9033e4bcd8275
parent09c75e3750858577efe09a51416546b1e5cc0f5c (diff)
downloadgcc-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.rs4
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")
}
}