diff options
| author | klensy <klensy@users.noreply.github.com> | 2023-12-30 18:11:41 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2024-01-07 16:53:32 +0300 |
| commit | 5b153b52a25dfe4c9592dd6c9f47582018b4fa61 (patch) | |
| tree | c61d0026529c6fed906e80493e3269e23030f082 /compiler/rustc_fluent_macro | |
| parent | 5cb2e7dfc362662b0036faad3bab88d73027fd05 (diff) | |
| download | rust-5b153b52a25dfe4c9592dd6c9f47582018b4fa61.tar.gz rust-5b153b52a25dfe4c9592dd6c9f47582018b4fa61.zip | |
annotate-snippets: update to 0.10
Diffstat (limited to 'compiler/rustc_fluent_macro')
| -rw-r--r-- | compiler/rustc_fluent_macro/Cargo.toml | 2 | ||||
| -rw-r--r-- | compiler/rustc_fluent_macro/src/fluent.rs | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_fluent_macro/Cargo.toml b/compiler/rustc_fluent_macro/Cargo.toml index 872dd29a7a8..c5a53ae8313 100644 --- a/compiler/rustc_fluent_macro/Cargo.toml +++ b/compiler/rustc_fluent_macro/Cargo.toml @@ -8,7 +8,7 @@ proc-macro = true [dependencies] # tidy-alphabetical-start -annotate-snippets = "0.9" +annotate-snippets = "0.10" fluent-bundle = "0.15.2" fluent-syntax = "0.11" proc-macro2 = "1" diff --git a/compiler/rustc_fluent_macro/src/fluent.rs b/compiler/rustc_fluent_macro/src/fluent.rs index 3b1b63455ed..520a64aaf5e 100644 --- a/compiler/rustc_fluent_macro/src/fluent.rs +++ b/compiler/rustc_fluent_macro/src/fluent.rs @@ -1,7 +1,4 @@ -use annotate_snippets::{ - display_list::DisplayList, - snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation}, -}; +use annotate_snippets::{Annotation, AnnotationType, Renderer, Slice, Snippet, SourceAnnotation}; use fluent_bundle::{FluentBundle, FluentError, FluentResource}; use fluent_syntax::{ ast::{ @@ -179,10 +176,9 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok range: (pos.start, pos.end - 1), }], }], - opt: Default::default(), }; - let dl = DisplayList::from(snippet); - eprintln!("{dl}\n"); + let renderer = Renderer::plain(); + eprintln!("{}\n", renderer.render(snippet)); } return failed(&crate_name); |
