diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-11-25 12:27:50 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-11-25 13:30:48 -0800 |
| commit | 9a595417a2d5fdff62fb2a570756c5ce6f8eb0d2 (patch) | |
| tree | 21336c9ea4ccf8e10dcf0797fdfe053a18125235 /src | |
| parent | 00fe97ad0e440d78a3dbf8df77ac5192ca6d6403 (diff) | |
| download | rust-9a595417a2d5fdff62fb2a570756c5ce6f8eb0d2.tar.gz rust-9a595417a2d5fdff62fb2a570756c5ce6f8eb0d2.zip | |
Tweak multiple allocators error
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_metadata/creader.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/allocator/two-allocators.stderr | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index a721e381b4e..7b54b98cbc1 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -698,7 +698,9 @@ impl<'a> CrateLoader<'a> { let has_global_allocator = match &*global_allocator_spans(krate) { [span1, span2, ..] => { self.sess.struct_span_err(*span2, "cannot define multiple global allocators") - .span_note(*span1, "the previous global allocator is defined here").emit(); + .span_label(*span2, "cannot define a new global allocator") + .span_label(*span1, "previous global allocator is defined here") + .emit(); true } spans => !spans.is_empty() diff --git a/src/test/ui/allocator/two-allocators.stderr b/src/test/ui/allocator/two-allocators.stderr index ed0aa13eb80..35d9f0f42f0 100644 --- a/src/test/ui/allocator/two-allocators.stderr +++ b/src/test/ui/allocator/two-allocators.stderr @@ -1,14 +1,11 @@ error: cannot define multiple global allocators --> $DIR/two-allocators.rs:6:1 | -LL | static B: System = System; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the previous global allocator is defined here - --> $DIR/two-allocators.rs:4:1 - | LL | static A: System = System; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | -------------------------- previous global allocator is defined here +LL | #[global_allocator] +LL | static B: System = System; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator error: aborting due to previous error |
