about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-14 14:14:47 +0000
committerbors <bors@rust-lang.org>2020-04-14 14:14:47 +0000
commit6805906fba0bca2bc77da9ad09cc9f91c3cea3eb (patch)
tree387ee6e30eec34b94999b8b49bd2770a5313c07c /src
parentba72b15666b2491415aec703a02c2364fe5e2790 (diff)
parent816443e6cfbd07443ec9c26f9b83fdd9ffa5715c (diff)
downloadrust-6805906fba0bca2bc77da9ad09cc9f91c3cea3eb.tar.gz
rust-6805906fba0bca2bc77da9ad09cc9f91c3cea3eb.zip
Auto merge of #71125 - Dylan-DPC:rollup-3b8prjh, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #71112 (Remove the last remnant of unsigned Neg)
 - #71120 (Clean up E0517 explanation)
 - #71121 (Fix broken link in documentation for String::from_utf8)
 - #71122 (update `FnCtxt::lookup_method` docs)
 - #71124 (Add missing comma)

Failed merges:

r? @ghost
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/string.rs1
-rw-r--r--src/libcore/ops/arith.rs21
-rw-r--r--src/librustc_error_codes/error_codes/E0517.md3
-rw-r--r--src/librustc_typeck/check/method/mod.rs8
-rw-r--r--src/libstd/sys/windows/ext/fs.rs2
5 files changed, 11 insertions, 24 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index 86e09b7be2d..80fa8139915 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -482,6 +482,7 @@ impl String {
     /// [`String`]: struct.String.html
     /// [`u8`]: ../../std/primitive.u8.html
     /// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
+    /// [`&str`]: ../../std/primitive.str.html
     /// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
     /// [`into_bytes`]: struct.String.html#method.into_bytes
     /// [`FromUtf8Error`]: struct.FromUtf8Error.html
diff --git a/src/libcore/ops/arith.rs b/src/libcore/ops/arith.rs
index e9ec81394e3..622a138abe9 100644
--- a/src/libcore/ops/arith.rs
+++ b/src/libcore/ops/arith.rs
@@ -617,35 +617,22 @@ pub trait Neg {
     fn neg(self) -> Self::Output;
 }
 
-macro_rules! neg_impl_core {
-    ($id:ident => $body:expr, $($t:ty)*) => ($(
+macro_rules! neg_impl {
+    ($($t:ty)*) => ($(
         #[stable(feature = "rust1", since = "1.0.0")]
         impl Neg for $t {
             type Output = $t;
 
             #[inline]
             #[rustc_inherit_overflow_checks]
-            fn neg(self) -> $t { let $id = self; $body }
+            fn neg(self) -> $t { -self }
         }
 
         forward_ref_unop! { impl Neg, neg for $t }
     )*)
 }
 
-macro_rules! neg_impl_numeric {
-    ($($t:ty)*) => { neg_impl_core!{ x => -x, $($t)*} }
-}
-
-#[allow(unused_macros)]
-macro_rules! neg_impl_unsigned {
-    ($($t:ty)*) => {
-        neg_impl_core!{ x => {
-            !x.wrapping_add(1)
-        }, $($t)*} }
-}
-
-// neg_impl_unsigned! { usize u8 u16 u32 u64 }
-neg_impl_numeric! { isize i8 i16 i32 i64 i128 f32 f64 }
+neg_impl! { isize i8 i16 i32 i64 i128 f32 f64 }
 
 /// The addition assignment operator `+=`.
 ///
diff --git a/src/librustc_error_codes/error_codes/E0517.md b/src/librustc_error_codes/error_codes/E0517.md
index f738d33560a..ae802245bd1 100644
--- a/src/librustc_error_codes/error_codes/E0517.md
+++ b/src/librustc_error_codes/error_codes/E0517.md
@@ -1,5 +1,4 @@
-This error indicates that a `#[repr(..)]` attribute was placed on an
-unsupported item.
+A `#[repr(..)]` attribute was placed on an unsupported item.
 
 Examples of erroneous code:
 
diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs
index 13fc3900e48..c4f53332cb6 100644
--- a/src/librustc_typeck/check/method/mod.rs
+++ b/src/librustc_typeck/check/method/mod.rs
@@ -171,11 +171,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     ///
     /// Given a method call like `foo.bar::<T1,...Tn>(...)`:
     ///
-    /// * `fcx`:                   the surrounding `FnCtxt` (!)
-    /// * `span`:                  the span for the method call
-    /// * `method_name`:           the name of the method being called (`bar`)
+    /// * `self`:                  the surrounding `FnCtxt` (!)
     /// * `self_ty`:               the (unadjusted) type of the self expression (`foo`)
-    /// * `supplied_method_types`: the explicit method type parameters, if any (`T1..Tn`)
+    /// * `segment`:               the name and generic arguments of the method (`bar::<T1, ...Tn>`)
+    /// * `span`:                  the span for the method call
+    /// * `call_expr`:             the complete method call: (`foo.bar::<T1,...Tn>(...)`)
     /// * `self_expr`:             the self expression (`foo`)
     pub fn lookup_method(
         &self,
diff --git a/src/libstd/sys/windows/ext/fs.rs b/src/libstd/sys/windows/ext/fs.rs
index d508a333484..f85120d170f 100644
--- a/src/libstd/sys/windows/ext/fs.rs
+++ b/src/libstd/sys/windows/ext/fs.rs
@@ -224,7 +224,7 @@ pub trait OpenOptionsExt {
     /// opening a named pipe, to control to which degree a server process can
     /// act on behalf of a client process (security impersonation level).
     ///
-    /// When `security_qos_flags` is not set a malicious program can gain the
+    /// When `security_qos_flags` is not set, a malicious program can gain the
     /// elevated privileges of a privileged Rust process when it allows opening
     /// user-specified paths, by tricking it into opening a named pipe. So
     /// arguably `security_qos_flags` should also be set when opening arbitrary