mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-04 05:57:36 +00:00
normalize use of backticks in compiler messages for librustc_allocator
https://github.com/rust-lang/rust/issues/60532
This commit is contained in:
parent
e649e90344
commit
1a7127bbc4
@ -79,7 +79,7 @@ impl MutVisitor for ExpandAllocatorDirectives<'_> {
|
|||||||
|
|
||||||
if self.found {
|
if self.found {
|
||||||
self.handler
|
self.handler
|
||||||
.span_err(item.span, "cannot define more than one #[global_allocator]");
|
.span_err(item.span, "cannot define more than one `#[global_allocator]`");
|
||||||
return smallvec![item];
|
return smallvec![item];
|
||||||
}
|
}
|
||||||
self.found = true;
|
self.found = true;
|
||||||
@ -280,7 +280,7 @@ impl AllocFnFactory<'_> {
|
|||||||
AllocatorTy::Unit => (self.cx.ty(self.span, TyKind::Tup(Vec::new())), expr),
|
AllocatorTy::Unit => (self.cx.ty(self.span, TyKind::Tup(Vec::new())), expr),
|
||||||
|
|
||||||
AllocatorTy::Layout | AllocatorTy::Usize | AllocatorTy::Ptr => {
|
AllocatorTy::Layout | AllocatorTy::Usize | AllocatorTy::Ptr => {
|
||||||
panic!("can't convert AllocatorTy to an output")
|
panic!("can't convert `AllocatorTy` to an output")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,6 @@ use std::alloc::System;
|
|||||||
static A: System = System;
|
static A: System = System;
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static B: System = System;
|
static B: System = System;
|
||||||
//~^ ERROR: cannot define more than one #[global_allocator]
|
//~^ ERROR: cannot define more than one `#[global_allocator]`
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error: cannot define more than one #[global_allocator]
|
error: cannot define more than one `#[global_allocator]`
|
||||||
--> $DIR/two-allocators.rs:6:1
|
--> $DIR/two-allocators.rs:6:1
|
||||||
|
|
|
|
||||||
LL | static B: System = System;
|
LL | static B: System = System;
|
||||||
|
Loading…
Reference in New Issue
Block a user