Auto merge of #15052 - lnicola:fmt-arguments, r=Veykril
minor: Rename minicore ArgumentV1 to match libcore
This commit is contained in:
commit
51939db8d3
@ -474,7 +474,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9333..9341,
|
||||
range: 9286..9294,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
@ -487,7 +487,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9365..9369,
|
||||
range: 9318..9322,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
@ -511,7 +511,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9333..9341,
|
||||
range: 9286..9294,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
@ -524,7 +524,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9365..9369,
|
||||
range: 9318..9322,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
@ -548,7 +548,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9333..9341,
|
||||
range: 9286..9294,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
@ -561,7 +561,7 @@ fn main() {
|
||||
file_id: FileId(
|
||||
1,
|
||||
),
|
||||
range: 9365..9369,
|
||||
range: 9318..9322,
|
||||
},
|
||||
),
|
||||
tooltip: "",
|
||||
|
@ -867,29 +867,26 @@ pub trait Display {
|
||||
}
|
||||
|
||||
#[lang = "format_argument"]
|
||||
pub struct ArgumentV1<'a> {
|
||||
pub struct Argument<'a> {
|
||||
value: &'a Opaque,
|
||||
formatter: fn(&Opaque, &mut Formatter<'_>) -> Result,
|
||||
}
|
||||
|
||||
impl<'a> ArgumentV1<'a> {
|
||||
pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> {
|
||||
impl<'a> Argument<'a> {
|
||||
pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> Argument<'b> {
|
||||
use crate::mem::transmute;
|
||||
unsafe { ArgumentV1 { formatter: transmute(f), value: transmute(x) } }
|
||||
unsafe { Argument { formatter: transmute(f), value: transmute(x) } }
|
||||
}
|
||||
}
|
||||
|
||||
#[lang = "format_arguments"]
|
||||
pub struct Arguments<'a> {
|
||||
pieces: &'a [&'static str],
|
||||
args: &'a [ArgumentV1<'a>],
|
||||
args: &'a [Argument<'a>],
|
||||
}
|
||||
|
||||
impl<'a> Arguments<'a> {
|
||||
pub const fn new_v1(
|
||||
pieces: &'a [&'static str],
|
||||
args: &'a [ArgumentV1<'a>],
|
||||
) -> Arguments<'a> {
|
||||
pub const fn new_v1(pieces: &'a [&'static str], args: &'a [Argument<'a>]) -> Arguments<'a> {
|
||||
Arguments { pieces, args }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user