mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2025-02-19 15:00:40 +00:00
Highlight a few remaining unhighlighted readme code blocks
This commit is contained in:
parent
c80b47159a
commit
dedbdd156b
@ -150,7 +150,7 @@ By tracking span information all the way through the expansion of a procedural
|
||||
macro as shown in the `heapsize` example, token-based macros in Syn are able to
|
||||
trigger errors that directly pinpoint the source of the problem.
|
||||
|
||||
```
|
||||
```console
|
||||
error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
|
||||
--> src/main.rs:7:5
|
||||
|
|
||||
@ -171,7 +171,7 @@ Syn's parsing API.
|
||||
The example reimplements the popular `lazy_static` crate from crates.io as a
|
||||
procedural macro.
|
||||
|
||||
```
|
||||
```rust
|
||||
lazy_static! {
|
||||
static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
|
||||
}
|
||||
@ -180,7 +180,7 @@ lazy_static! {
|
||||
The implementation shows how to trigger custom warnings and error messages on
|
||||
the macro input.
|
||||
|
||||
```
|
||||
```console
|
||||
warning: come on, pick a more creative name
|
||||
--> src/main.rs:10:16
|
||||
|
|
||||
|
Loading…
x
Reference in New Issue
Block a user