]> git.lizzy.rs Git - rust.git/commitdiff
core: rm unused lifetime.
authorHuon Wilson <dbau.pp+github@gmail.com>
Fri, 9 Jan 2015 23:31:56 +0000 (10:31 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sat, 10 Jan 2015 00:31:53 +0000 (11:31 +1100)
src/libcore/fmt/mod.rs
src/libcore/fmt/rt.rs
src/libsyntax/ext/format.rs

index 67d5482898ee5f87f9bbfdf08fc4c01e49cdd4aa..a0ec9e5f151c2c2eaf28a2e357b646413e1a0ab2 100644 (file)
@@ -180,6 +180,7 @@ pub fn new(pieces: &'a [&'a str],
     /// unsafety, but will ignore invalid .
     #[doc(hidden)] #[inline]
     #[unstable = "implementation detail of the `format_args!` macro"]
+    #[cfg(stage0)] // SNAP 9e4e524
     pub fn with_placeholders(pieces: &'a [&'a str],
                              fmt: &'a [rt::Argument<'a>],
                              args: &'a [Argument<'a>]) -> Arguments<'a> {
@@ -189,6 +190,24 @@ pub fn with_placeholders(pieces: &'a [&'a str],
             args: args
         }
     }
+    /// This function is used to specify nonstandard formatting parameters.
+    /// The `pieces` array must be at least as long as `fmt` to construct
+    /// a valid Arguments structure. Also, any `Count` within `fmt` that is
+    /// `CountIsParam` or `CountIsNextParam` has to point to an argument
+    /// created with `argumentuint`. However, failing to do so doesn't cause
+    /// unsafety, but will ignore invalid .
+    #[doc(hidden)] #[inline]
+    #[unstable = "implementation detail of the `format_args!` macro"]
+    #[cfg(not(stage0))]
+    pub fn with_placeholders(pieces: &'a [&'a str],
+                             fmt: &'a [rt::Argument],
+                             args: &'a [Argument<'a>]) -> Arguments<'a> {
+        Arguments {
+            pieces: pieces,
+            fmt: Some(fmt),
+            args: args
+        }
+    }
 }
 
 /// This structure represents a safely precompiled version of a format string
@@ -207,7 +226,11 @@ pub struct Arguments<'a> {
     pieces: &'a [&'a str],
 
     // Placeholder specs, or `None` if all specs are default (as in "{}{}").
+    // SNAP 9e4e524
+    #[cfg(stage0)]
     fmt: Option<&'a [rt::Argument<'a>]>,
+    #[cfg(not(stage0))]
+    fmt: Option<&'a [rt::Argument]>,
 
     // Dynamic arguments for interpolation, to be interleaved with string
     // pieces. (Every argument is preceded by a string piece.)
index 8d8e8c4b703032b34e0d607ac1ee2580ef11b526..2abf921eaf2c1007b0c45289d27763af8c4b42fb 100644 (file)
 pub use self::Position::*;
 pub use self::Flag::*;
 
+// SNAP 9e4e524
 #[doc(hidden)]
 #[derive(Copy)]
+#[cfg(not(stage0))]
+pub struct Argument {
+    pub position: Position,
+    pub format: FormatSpec,
+}
+#[doc(hidden)]
+#[derive(Copy)]
+#[cfg(stage0)]
 pub struct Argument<'a> {
     pub position: Position,
     pub format: FormatSpec,
index 637b6d4649d209a9c45a9a71eb3bbe1b131506b8..f512b33f02440e736c96925f1acb18af8b2ea0ab 100644 (file)
@@ -579,13 +579,9 @@ fn into_expr(mut self) -> P<ast::Expr> {
         } else {
             // Build up the static array which will store our precompiled
             // nonstandard placeholders, if there are any.
-            let piece_ty = self.ecx.ty_path(self.ecx.path_all(
+            let piece_ty = self.ecx.ty_path(self.ecx.path_global(
                     self.fmtsp,
-                    true, Context::rtpath(self.ecx, "Argument"),
-                    vec![static_lifetime],
-                    vec![],
-                    vec![]
-                ));
+                    Context::rtpath(self.ecx, "Argument")));
             let fmt = Context::static_array(self.ecx,
                                             "__STATIC_FMTARGS",
                                             piece_ty,