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> {
698
698
let has_global_allocator = match & * global_allocator_spans ( krate) {
699
699
[ span1, span2, ..] => {
700
700
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 ( ) ;
702
704
true
703
705
}
704
706
spans => !spans. is_empty ( )
Original file line number Diff line number Diff line change 1
1
error: cannot define multiple global allocators
2
2
--> $DIR/two-allocators.rs:6:1
3
3
|
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
- |
10
4
LL | 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
12
9
13
10
error: aborting due to previous error
14
11
You can’t perform that action at this time.
0 commit comments