diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index e41b3f5f53b2..6c1991457433 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 6fd21d850e96..11e0085d1ce2 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