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
This commit is contained in:
commit
6805906fba
5 changed files with 11 additions and 24 deletions
|
@ -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
|
||||
|
|
|
@ -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 `+=`.
|
||||
///
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue