File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -698,7 +698,9 @@ impl<'a> CrateLoader<'a> {
698698 let has_global_allocator = match & * global_allocator_spans ( krate) {
699699 [ span1, span2, ..] => {
700700 self . sess . struct_span_err ( * span2, "cannot define multiple global allocators" )
701- . span_note ( * span1, "the previous global allocator is defined here" ) . emit ( ) ;
701+ . span_label ( * span2, "cannot define a new global allocator" )
702+ . span_label ( * span1, "previous global allocator is defined here" )
703+ . emit ( ) ;
702704 true
703705 }
704706 spans => !spans. is_empty ( )
Original file line number Diff line number Diff line change 11error: cannot define multiple global allocators
22 --> $DIR/two-allocators.rs:6:1
33 |
4- LL | static B: System = System;
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6- |
7- note: the previous global allocator is defined here
8- --> $DIR/two-allocators.rs:4:1
9- |
104LL | static A: System = System;
11- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
5+ | -------------------------- previous global allocator is defined here
6+ LL | #[global_allocator]
7+ LL | static B: System = System;
8+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator
129
1310error: aborting due to previous error
1411
You can’t perform that action at this time.
0 commit comments