]> git.lizzy.rs Git - rust.git/commitdiff
use fmt::Result where applicable
authorAndre Bogus <bogusandre@gmail.com>
Tue, 8 May 2018 23:41:44 +0000 (01:41 +0200)
committerAndre Bogus <bogusandre@gmail.com>
Wed, 9 May 2018 00:01:37 +0000 (02:01 +0200)
13 files changed:
src/librustc/ich/fingerprint.rs
src/librustc_data_structures/control_flow_graph/dominators/mod.rs
src/librustc_data_structures/owning_ref/mod.rs
src/librustc_errors/lib.rs
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
src/librustc_mir/transform/elaborate_drops.rs
src/librustdoc/html/render.rs
src/libstd/path.rs
src/libstd/sys/redox/syscall/error.rs
src/libstd/sys_common/wtf8.rs
src/libsyntax_ext/format_foreign.rs
src/test/run-pass/atomic-print.rs
src/test/run-pass/union/union-trait-impl.rs

index a7adf28c481b95c3fa352aa6345254df6f6a15be..f56f4e12e7a02b9b16ffa34c2f9119ad0c492235 100644 (file)
@@ -67,7 +67,7 @@ pub fn decode_opaque<'a>(decoder: &mut Decoder<'a>) -> Result<Fingerprint, Strin
 }
 
 impl ::std::fmt::Display for Fingerprint {
-    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
+    fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         write!(formatter, "{:x}-{:x}", self.0, self.1)
     }
 }
index dc487f1162ca9d074b8735937e069b846a7dbc60..54407658e6ccc85f77e27682800529d98db3fba0 100644 (file)
@@ -175,7 +175,7 @@ pub fn children(&self, node: Node) -> &[Node] {
 }
 
 impl<Node: Idx> fmt::Debug for DominatorTree<Node> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         fmt::Debug::fmt(&DominatorTreeNode {
                             tree: self,
                             node: self.root,
@@ -190,7 +190,7 @@ struct DominatorTreeNode<'tree, Node: Idx> {
 }
 
 impl<'tree, Node: Idx> fmt::Debug for DominatorTreeNode<'tree, Node> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         let subtrees: Vec<_> = self.tree
             .children(self.node)
             .iter()
index c466b8f8ad1b5acb716db8b2720dd2cadb25c08f..aa113fac9fb7dff28baa92dfba7bfe5f0b80b50b 100644 (file)
@@ -1002,7 +1002,7 @@ impl<O, T: ?Sized> Debug for OwningRef<O, T>
     where O: Debug,
           T: Debug,
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f,
                "OwningRef {{ owner: {:?}, reference: {:?} }}",
                self.owner(),
@@ -1014,7 +1014,7 @@ impl<O, T: ?Sized> Debug for OwningRefMut<O, T>
     where O: Debug,
           T: Debug,
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f,
                "OwningRefMut {{ owner: {:?}, reference: {:?} }}",
                self.owner(),
@@ -1047,7 +1047,7 @@ unsafe impl<O, T: ?Sized> Sync for OwningRefMut<O, T>
     where O: Sync, for<'a> (&'a mut T): Sync {}
 
 impl Debug for Erased {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "<Erased>",)
     }
 }
index c2b442e949758a19c64f4b2aa73dc8d7264f6282..fd90e1cbe0866b16bdbfaefb2dfd20c4e6055a20 100644 (file)
@@ -232,7 +232,7 @@ pub fn raise(self) -> ! {
 }
 
 impl fmt::Display for FatalError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "parser fatal error")
     }
 }
@@ -249,7 +249,7 @@ fn description(&self) -> &str {
 pub struct ExplicitBug;
 
 impl fmt::Display for ExplicitBug {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "parser internal bug")
     }
 }
index 4d1f3e2b4300ab30a8ed6927cfe0029b6f78bca9..57b8824191f7b86ab50e1e02148e1eb35c129fcc 100644 (file)
@@ -1185,7 +1185,7 @@ fn new(origin: RegionVariableOrigin) -> Self {
 }
 
 impl fmt::Debug for Constraint {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         write!(
             formatter,
             "({:?}: {:?} @ {:?}) due to {:?}",
index 5397d18cdd720be1b0d185fe4359e88d10bb07d3..79252e7654bfa17a8fad3b4031ce740e05ec95bf 100644 (file)
@@ -174,7 +174,7 @@ struct Elaborator<'a, 'b: 'a, 'tcx: 'b> {
 }
 
 impl<'a, 'b, 'tcx> fmt::Debug for Elaborator<'a, 'b, 'tcx> {
-    fn fmt(&self, _f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
         Ok(())
     }
 }
index 21de2db1dfe74fd7bf1930e06b38b3e20589b31b..fe9fc3ddd680ee5626cc42d67ae4b53daaf18c35 100644 (file)
@@ -2579,7 +2579,7 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
 }
 
 fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter,
-                      implementor_dups: &FxHashMap<&str, (DefId, bool)>) -> Result<(), fmt::Error> {
+                      implementor_dups: &FxHashMap<&str, (DefId, bool)>) -> fmt::Result {
     write!(w, "<li><table class='table-display'><tbody><tr><td><code>")?;
     // If there's already another implementor that has the same abbridged name, use the
     // full path, for example in `std::iter::ExactSizeIterator`
@@ -2612,7 +2612,7 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter,
 
 fn render_impls(cx: &Context, w: &mut fmt::Formatter,
                 traits: &[&&Impl],
-                containing_item: &clean::Item) -> Result<(), fmt::Error> {
+                containing_item: &clean::Item) -> fmt::Result {
     for i in traits {
         let did = i.trait_did().unwrap();
         let assoc_link = AssocItemLink::GotoSource(did, &i.inner_impl().provided_trait_methods);
index 696711a70d4f6408cc773abf87d04ed932e64b02..5d35a7861736ae18097d05b32150e59c447cee8d 100644 (file)
@@ -1460,7 +1460,7 @@ fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl fmt::Debug for PathBuf {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         fmt::Debug::fmt(&**self, formatter)
     }
 }
index d8d78d550162ae3ef0f6750b8b82d39b3095bec1..1ef79547431f8ac0a23d9e3a85d92c288da346fa 100644 (file)
@@ -48,13 +48,13 @@ pub fn text(&self) -> &str {
 }
 
 impl fmt::Debug for Error {
-    fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.write_str(self.text())
     }
 }
 
 impl fmt::Display for Error {
-    fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.write_str(self.text())
     }
 }
index fe7e058091ed5fe1c6cf871817f879892f5ead2d..14a2555adf9baa109e7d7afe08bbea07e685826a 100644 (file)
@@ -56,7 +56,7 @@ pub struct CodePoint {
 /// Example: `U+1F4A9`
 impl fmt::Debug for CodePoint {
     #[inline]
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         write!(formatter, "U+{:04X}", self.value)
     }
 }
@@ -144,7 +144,7 @@ fn deref_mut(&mut self) -> &mut Wtf8 {
 /// Example: `"a\u{D800}"` for a string with code points [U+0061, U+D800]
 impl fmt::Debug for Wtf8Buf {
     #[inline]
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         fmt::Debug::fmt(&**self, formatter)
     }
 }
index e95c6f2e1243fe7f5a2556d64d243eb3c30e12b4..2b8603c75a57b50733b0ac0ec611b8fd438b93d4 100644 (file)
@@ -989,7 +989,7 @@ fn clone(&self) -> StrCursor<'a> {
     }
 
     impl<'a> std::fmt::Debug for StrCursor<'a> {
-        fn fmt(&self, fmt: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
+        fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
             write!(fmt, "StrCursor({:?} | {:?})", self.slice_before(), self.slice_after())
         }
     }
index 914b89dfb4dc030ae81190b79d525f51eaed8b7e..2d478e954e7cb7cb493e98b9da4e2ad124f80b33 100644 (file)
@@ -15,7 +15,7 @@
 
 struct SlowFmt(u32);
 impl fmt::Debug for SlowFmt {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         thread::sleep_ms(3);
         self.0.fmt(f)
     }
index 1cdaff2cab7c8c7e25efe55464f7744d03fdf8d3..c1e408cc02ac6764aa95fc848f28fe26ddcf4549 100644 (file)
@@ -15,7 +15,7 @@ union U {
 }
 
 impl fmt::Display for U {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         unsafe { write!(f, "Oh hai {}", self.a) }
     }
 }