Skip to content

Commit 6805906

Browse files
committed
Auto merge of rust-lang#71125 - Dylan-DPC:rollup-3b8prjh, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#71112 (Remove the last remnant of unsigned Neg) - rust-lang#71120 (Clean up E0517 explanation) - rust-lang#71121 (Fix broken link in documentation for String::from_utf8) - rust-lang#71122 (update `FnCtxt::lookup_method` docs) - rust-lang#71124 (Add missing comma) Failed merges: r? @ghost
2 parents ba72b15 + 816443e commit 6805906

File tree

5 files changed

+11
-24
lines changed

5 files changed

+11
-24
lines changed

src/liballoc/string.rs

+1
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ impl String {
482482
/// [`String`]: struct.String.html
483483
/// [`u8`]: ../../std/primitive.u8.html
484484
/// [`Vec<u8>`]: ../../std/vec/struct.Vec.html
485+
/// [`&str`]: ../../std/primitive.str.html
485486
/// [`str::from_utf8`]: ../../std/str/fn.from_utf8.html
486487
/// [`into_bytes`]: struct.String.html#method.into_bytes
487488
/// [`FromUtf8Error`]: struct.FromUtf8Error.html

src/libcore/ops/arith.rs

+4-17
Original file line numberDiff line numberDiff line change
@@ -617,35 +617,22 @@ pub trait Neg {
617617
fn neg(self) -> Self::Output;
618618
}
619619

620-
macro_rules! neg_impl_core {
621-
($id:ident => $body:expr, $($t:ty)*) => ($(
620+
macro_rules! neg_impl {
621+
($($t:ty)*) => ($(
622622
#[stable(feature = "rust1", since = "1.0.0")]
623623
impl Neg for $t {
624624
type Output = $t;
625625

626626
#[inline]
627627
#[rustc_inherit_overflow_checks]
628-
fn neg(self) -> $t { let $id = self; $body }
628+
fn neg(self) -> $t { -self }
629629
}
630630

631631
forward_ref_unop! { impl Neg, neg for $t }
632632
)*)
633633
}
634634

635-
macro_rules! neg_impl_numeric {
636-
($($t:ty)*) => { neg_impl_core!{ x => -x, $($t)*} }
637-
}
638-
639-
#[allow(unused_macros)]
640-
macro_rules! neg_impl_unsigned {
641-
($($t:ty)*) => {
642-
neg_impl_core!{ x => {
643-
!x.wrapping_add(1)
644-
}, $($t)*} }
645-
}
646-
647-
// neg_impl_unsigned! { usize u8 u16 u32 u64 }
648-
neg_impl_numeric! { isize i8 i16 i32 i64 i128 f32 f64 }
635+
neg_impl! { isize i8 i16 i32 i64 i128 f32 f64 }
649636

650637
/// The addition assignment operator `+=`.
651638
///

src/librustc_error_codes/error_codes/E0517.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
This error indicates that a `#[repr(..)]` attribute was placed on an
2-
unsupported item.
1+
A `#[repr(..)]` attribute was placed on an unsupported item.
32

43
Examples of erroneous code:
54

src/librustc_typeck/check/method/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
171171
///
172172
/// Given a method call like `foo.bar::<T1,...Tn>(...)`:
173173
///
174-
/// * `fcx`: the surrounding `FnCtxt` (!)
175-
/// * `span`: the span for the method call
176-
/// * `method_name`: the name of the method being called (`bar`)
174+
/// * `self`: the surrounding `FnCtxt` (!)
177175
/// * `self_ty`: the (unadjusted) type of the self expression (`foo`)
178-
/// * `supplied_method_types`: the explicit method type parameters, if any (`T1..Tn`)
176+
/// * `segment`: the name and generic arguments of the method (`bar::<T1, ...Tn>`)
177+
/// * `span`: the span for the method call
178+
/// * `call_expr`: the complete method call: (`foo.bar::<T1,...Tn>(...)`)
179179
/// * `self_expr`: the self expression (`foo`)
180180
pub fn lookup_method(
181181
&self,

src/libstd/sys/windows/ext/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub trait OpenOptionsExt {
224224
/// opening a named pipe, to control to which degree a server process can
225225
/// act on behalf of a client process (security impersonation level).
226226
///
227-
/// When `security_qos_flags` is not set a malicious program can gain the
227+
/// When `security_qos_flags` is not set, a malicious program can gain the
228228
/// elevated privileges of a privileged Rust process when it allows opening
229229
/// user-specified paths, by tricking it into opening a named pipe. So
230230
/// arguably `security_qos_flags` should also be set when opening arbitrary

0 commit comments

Comments
 (0)