about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_metadata/creader.rs6
-rw-r--r--src/test/ui/missing-allocator.stderr2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index e41b3f5f53b..6c199145743 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -986,8 +986,10 @@ impl<'a> CrateLoader<'a> {
             },
             None => {
                 if !attr::contains_name(&krate.attrs, "default_lib_allocator") {
-                    self.sess.err("no #[default_lib_allocator] found but one is \
-                                   required; is libstd not linked?");
+                    self.sess.err("no global memory allocator found but one is \
+                                   required; link to std or \
+                                   add #[global_allocator] to a static item \
+                                   that implements the GlobalAlloc trait.");
                     return;
                 }
                 self.sess.allocator_kind.set(Some(AllocatorKind::DefaultLib));
diff --git a/src/test/ui/missing-allocator.stderr b/src/test/ui/missing-allocator.stderr
index 6fd21d850e9..11e0085d1ce 100644
--- a/src/test/ui/missing-allocator.stderr
+++ b/src/test/ui/missing-allocator.stderr
@@ -1,4 +1,4 @@
-error: no #[default_lib_allocator] found but one is required; is libstd not linked?
+error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
 
 error: aborting due to previous error