@@ -169,59 +169,3 @@ impl Argument<'_> {
169169 }
170170 }
171171}
172- <<<<<<< HEAD
173-
174- /// Used by the format_args!() macro to create a fmt::Arguments object.
175- #[ doc ( hidden ) ]
176- #[ unstable ( feature = "fmt_internals" , issue = "none" ) ]
177- #[ rustc_diagnostic_item = "FmtArgumentsNew "]
178- impl <' a > Arguments < ' a > {
179- #[ inline ]
180- pub const fn new_const < const N : usize > ( pieces : & ' a [ & ' static str ; N ] ) -> Self {
181- const { assert ! ( N <= 1 ) } ;
182- Arguments { pieces , fmt : None , args : & [ ] }
183- }
184-
185- /// When using the format_args!() macro, this function is used to generate the
186- /// Arguments structure.
187- ///
188- /// This function should _not_ be const, to make sure we don't accept
189- /// format_args!() and panic!() with arguments in const, even when not evaluated:
190- ///
191- /// ```compile_fail,E0015
192- /// const _: () = if false { panic!("a {}", "a") };
193- /// ```
194- #[ inline ]
195- pub fn new_v1 < const P : usize , const A : usize > (
196- pieces : & ' a [ & ' static str ; P ] ,
197- args : & ' a [ rt:: Argument < ' a > ; A ] ,
198- ) -> Arguments < ' a > {
199- const { assert ! ( P >= A && P <= A + 1 , "invalid args" ) }
200- Arguments { pieces , fmt : None , args }
201- }
202-
203- /// Specifies nonstandard formatting parameters.
204- ///
205- /// SAFETY: the following invariants must be held:
206- /// 1. The `pieces` slice must be at least as long as `fmt`.
207- /// 2. Every `rt::Placeholder::position` value within `fmt` must be a valid index of `args`.
208- /// 3. Every `rt::Count::Param` within `fmt` must contain a valid index of `args`.
209- ///
210- /// This function should _not_ be const, to make sure we don't accept
211- /// format_args!() and panic!() with arguments in const, even when not evaluated:
212- ///
213- /// ```compile_fail,E0015
214- /// const _: () = if false { panic!("a {:1}", "a") };
215- /// ```
216- #[ inline ]
217- #[ requires( pieces. len( ) >= fmt. len( ) ) ]
218- pub unsafe fn new_v1_formatted (
219- pieces : & ' a [ & ' static str ] ,
220- args : & ' a [ rt:: Argument < ' a > ] ,
221- fmt : & ' a [ rt:: Placeholder ] ,
222- ) -> Arguments < ' a > {
223- Arguments { pieces, fmt : Some ( fmt) , args }
224- }
225- }
226- =======
227- >>>>>>> subtree/library
0 commit comments