fix various typos
This commit is contained in:
parent
865b44a3e3
commit
136ad015b6
122 changed files with 153 additions and 153 deletions
|
@ -315,7 +315,7 @@
|
||||||
# `0` - no debug info
|
# `0` - no debug info
|
||||||
# `1` - line tables only
|
# `1` - line tables only
|
||||||
# `2` - full debug info with variable and type information
|
# `2` - full debug info with variable and type information
|
||||||
# Can be overriden for specific subsets of Rust code (rustc, std or tools).
|
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
|
||||||
# Debuginfo for tests run with compiletest is not controlled by this option
|
# Debuginfo for tests run with compiletest is not controlled by this option
|
||||||
# and needs to be enabled separately with `debuginfo-level-tests`.
|
# and needs to be enabled separately with `debuginfo-level-tests`.
|
||||||
#debuginfo-level = if debug { 2 } else { 0 }
|
#debuginfo-level = if debug { 2 } else { 0 }
|
||||||
|
|
|
@ -141,7 +141,7 @@ fn copy_third_party_objects(
|
||||||
copy_and_stamp(&srcdir, "crt1.o");
|
copy_and_stamp(&srcdir, "crt1.o");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
|
// Copies libunwind.a compiled to be linked with x86_64-fortanix-unknown-sgx.
|
||||||
//
|
//
|
||||||
// This target needs to be linked to Fortanix's port of llvm's libunwind.
|
// This target needs to be linked to Fortanix's port of llvm's libunwind.
|
||||||
// libunwind requires support for rwlock and printing to stderr,
|
// libunwind requires support for rwlock and printing to stderr,
|
||||||
|
|
|
@ -33,7 +33,7 @@ pub struct Flags {
|
||||||
pub rustc_error_format: Option<String>,
|
pub rustc_error_format: Option<String>,
|
||||||
pub dry_run: bool,
|
pub dry_run: bool,
|
||||||
|
|
||||||
// This overrides the deny-warnings configuation option,
|
// This overrides the deny-warnings configuration option,
|
||||||
// which passes -Dwarnings to the compiler invocations.
|
// which passes -Dwarnings to the compiler invocations.
|
||||||
//
|
//
|
||||||
// true => deny, false => warn
|
// true => deny, false => warn
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
|
|
||||||
# The macOS and Windows builds here are currently disabled due to them not being
|
# The macOS and Windows builds here are currently disabled due to them not being
|
||||||
# overly necessary on `try` builds. We also don't actually have anything that
|
# overly necessary on `try` builds. We also don't actually have anything that
|
||||||
# consumes the artifacts currently. Perhaps one day we can reenable, but for now
|
# consumes the artifacts currently. Perhaps one day we can re-enable, but for now
|
||||||
# it helps free up capacity on Azure.
|
# it helps free up capacity on Azure.
|
||||||
# - job: macOS
|
# - job: macOS
|
||||||
# timeoutInMinutes: 600
|
# timeoutInMinutes: 600
|
||||||
|
|
|
@ -453,7 +453,7 @@ override `ignore`.
|
||||||
|
|
||||||
### `--runtool`, `--runtool-arg`: program to run tests with; args to pass to it
|
### `--runtool`, `--runtool-arg`: program to run tests with; args to pass to it
|
||||||
|
|
||||||
Using thses options looks like this:
|
Using these options looks like this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
|
$ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
|
||||||
|
|
|
@ -21,7 +21,7 @@ when they'd need to do the same thing for every type anyway).
|
||||||
|
|
||||||
impl<T: Copy> CheapToClone for T {}
|
impl<T: Copy> CheapToClone for T {}
|
||||||
|
|
||||||
// These could potentally overlap with the blanket implementation above,
|
// These could potentially overlap with the blanket implementation above,
|
||||||
// so are only allowed because CheapToClone is a marker trait.
|
// so are only allowed because CheapToClone is a marker trait.
|
||||||
impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
|
impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
|
||||||
impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}
|
impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}
|
||||||
|
|
|
@ -306,7 +306,7 @@ impl<K, V> Root<K, V> {
|
||||||
/// `NodeRef` could be pointing to either type of node.
|
/// `NodeRef` could be pointing to either type of node.
|
||||||
/// Note that in case of a leaf node, this might still be the shared root!
|
/// Note that in case of a leaf node, this might still be the shared root!
|
||||||
/// Only turn this into a `LeafNode` reference if you know it is not the shared root!
|
/// Only turn this into a `LeafNode` reference if you know it is not the shared root!
|
||||||
/// Shared references must be dereferencable *for the entire size of their pointee*,
|
/// Shared references must be dereferenceable *for the entire size of their pointee*,
|
||||||
/// so '&LeafNode` or `&InternalNode` pointing to the shared root is undefined behavior.
|
/// so '&LeafNode` or `&InternalNode` pointing to the shared root is undefined behavior.
|
||||||
/// Turning this into a `NodeHeader` reference is always safe.
|
/// Turning this into a `NodeHeader` reference is always safe.
|
||||||
pub struct NodeRef<BorrowType, K, V, Type> {
|
pub struct NodeRef<BorrowType, K, V, Type> {
|
||||||
|
|
|
@ -841,10 +841,10 @@ impl<T> LinkedList<T> {
|
||||||
/// d.push_front(2);
|
/// d.push_front(2);
|
||||||
/// d.push_front(3);
|
/// d.push_front(3);
|
||||||
///
|
///
|
||||||
/// let mut splitted = d.split_off(2);
|
/// let mut split = d.split_off(2);
|
||||||
///
|
///
|
||||||
/// assert_eq!(splitted.pop_front(), Some(1));
|
/// assert_eq!(split.pop_front(), Some(1));
|
||||||
/// assert_eq!(splitted.pop_front(), None);
|
/// assert_eq!(split.pop_front(), None);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
|
pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
|
||||||
|
|
|
@ -2132,7 +2132,7 @@ impl<T> VecDeque<T> {
|
||||||
// Safety: the following two methods require that the rotation amount
|
// Safety: the following two methods require that the rotation amount
|
||||||
// be less than half the length of the deque.
|
// be less than half the length of the deque.
|
||||||
//
|
//
|
||||||
// `wrap_copy` requres that `min(x, cap() - x) + copy_len <= cap()`,
|
// `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,
|
||||||
// but than `min` is never more than half the capacity, regardless of x,
|
// but than `min` is never more than half the capacity, regardless of x,
|
||||||
// so it's sound to call here because we're calling with something
|
// so it's sound to call here because we're calling with something
|
||||||
// less than half the length, which is never above half the capacity.
|
// less than half the length, which is never above half the capacity.
|
||||||
|
|
|
@ -2894,7 +2894,7 @@ where
|
||||||
/// The filter test predicate.
|
/// The filter test predicate.
|
||||||
pred: F,
|
pred: F,
|
||||||
/// A flag that indicates a panic has occurred in the filter test prodicate.
|
/// A flag that indicates a panic has occurred in the filter test prodicate.
|
||||||
/// This is used as a hint in the drop implmentation to prevent consumption
|
/// This is used as a hint in the drop implementation to prevent consumption
|
||||||
/// of the remainder of the `DrainFilter`. Any unprocessed items will be
|
/// of the remainder of the `DrainFilter`. Any unprocessed items will be
|
||||||
/// backshifted in the `vec`, but no further items will be dropped or
|
/// backshifted in the `vec`, but no further items will be dropped or
|
||||||
/// tested by the filter predicate.
|
/// tested by the filter predicate.
|
||||||
|
|
|
@ -255,7 +255,7 @@ pub struct ArgumentV1<'a> {
|
||||||
formatter: fn(&Opaque, &mut Formatter<'_>) -> Result,
|
formatter: fn(&Opaque, &mut Formatter<'_>) -> Result,
|
||||||
}
|
}
|
||||||
|
|
||||||
// This gurantees a single stable value for the function pointer associated with
|
// This guarantees a single stable value for the function pointer associated with
|
||||||
// indices/counts in the formatting infrastructure.
|
// indices/counts in the formatting infrastructure.
|
||||||
//
|
//
|
||||||
// Note that a function defined as such would not be correct as functions are
|
// Note that a function defined as such would not be correct as functions are
|
||||||
|
|
|
@ -93,7 +93,7 @@ impl<T> ManuallyDrop<T> {
|
||||||
/// Instead of using [`ManuallyDrop::drop`] to manually drop the value,
|
/// Instead of using [`ManuallyDrop::drop`] to manually drop the value,
|
||||||
/// you can use this method to take the value and use it however desired.
|
/// you can use this method to take the value and use it however desired.
|
||||||
///
|
///
|
||||||
/// Whenever possible, it is preferrable to use [`into_inner`][`ManuallyDrop::into_inner`]
|
/// Whenever possible, it is preferable to use [`into_inner`][`ManuallyDrop::into_inner`]
|
||||||
/// instead, which prevents duplicating the content of the `ManuallyDrop<T>`.
|
/// instead, which prevents duplicating the content of the `ManuallyDrop<T>`.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
|
|
|
@ -91,7 +91,7 @@ pub use crate::intrinsics::transmute;
|
||||||
/// Using `ManuallyDrop` here has two advantages:
|
/// Using `ManuallyDrop` here has two advantages:
|
||||||
///
|
///
|
||||||
/// * We do not "touch" `v` after disassembling it. For some types, operations
|
/// * We do not "touch" `v` after disassembling it. For some types, operations
|
||||||
/// such as passing ownership (to a funcion like `mem::forget`) requires them to actually
|
/// such as passing ownership (to a function like `mem::forget`) requires them to actually
|
||||||
/// be fully owned right now; that is a promise we do not want to make here as we are
|
/// be fully owned right now; that is a promise we do not want to make here as we are
|
||||||
/// in the process of transferring ownership to the new `String` we are building.
|
/// in the process of transferring ownership to the new `String` we are building.
|
||||||
/// * In case of an unexpected panic, `ManuallyDrop` is not dropped, but if the panic
|
/// * In case of an unexpected panic, `ManuallyDrop` is not dropped, but if the panic
|
||||||
|
|
|
@ -312,7 +312,7 @@
|
||||||
//!
|
//!
|
||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
//! For a type like [`Vec<T>`], both possibilites (structural pinning or not) make sense.
|
//! For a type like [`Vec<T>`], both possibilities (structural pinning or not) make sense.
|
||||||
//! A [`Vec<T>`] with structural pinning could have `get_pin`/`get_pin_mut` methods to get
|
//! A [`Vec<T>`] with structural pinning could have `get_pin`/`get_pin_mut` methods to get
|
||||||
//! pinned references to elements. However, it could *not* allow calling
|
//! pinned references to elements. However, it could *not* allow calling
|
||||||
//! [`pop`][Vec::pop] on a pinned [`Vec<T>`] because that would move the (structurally pinned)
|
//! [`pop`][Vec::pop] on a pinned [`Vec<T>`] because that would move the (structurally pinned)
|
||||||
|
@ -539,7 +539,7 @@ impl<P: Deref> Pin<P> {
|
||||||
/// ```
|
/// ```
|
||||||
/// A value, once pinned, must remain pinned forever (unless its type implements `Unpin`).
|
/// A value, once pinned, must remain pinned forever (unless its type implements `Unpin`).
|
||||||
///
|
///
|
||||||
/// Similarily, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
|
/// Similarly, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
|
||||||
/// aliases to the same data that are not subject to the pinning restrictions:
|
/// aliases to the same data that are not subject to the pinning restrictions:
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::rc::Rc;
|
/// use std::rc::Rc;
|
||||||
|
|
|
@ -53,7 +53,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// all of the following is true:
|
/// all of the following is true:
|
||||||
/// - it is properly aligned
|
/// - it is properly aligned
|
||||||
/// - it must point to an initialized instance of T; in particular, the pointer must be
|
/// - it must point to an initialized instance of T; in particular, the pointer must be
|
||||||
/// "dereferencable" in the sense defined [here].
|
/// "dereferenceable" in the sense defined [here].
|
||||||
///
|
///
|
||||||
/// This applies even if the result of this method is unused!
|
/// This applies even if the result of this method is unused!
|
||||||
/// (The part about being initialized is not yet fully decided, but until
|
/// (The part about being initialized is not yet fully decided, but until
|
||||||
|
@ -183,7 +183,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
@ -480,7 +480,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
@ -535,7 +535,7 @@ impl<T: ?Sized> *const T {
|
||||||
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
//! * All pointers (except for the null pointer) are valid for all operations of
|
//! * All pointers (except for the null pointer) are valid for all operations of
|
||||||
//! [size zero][zst].
|
//! [size zero][zst].
|
||||||
//! * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer
|
//! * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer
|
||||||
//! be *dereferencable*: the memory range of the given size starting at the pointer must all be
|
//! be *dereferenceable*: the memory range of the given size starting at the pointer must all be
|
||||||
//! within the bounds of a single allocated object. Note that in Rust,
|
//! within the bounds of a single allocated object. Note that in Rust,
|
||||||
//! every (stack-allocated) variable is considered a separate allocated object.
|
//! every (stack-allocated) variable is considered a separate allocated object.
|
||||||
//! * All accesses performed by functions in this module are *non-atomic* in the sense
|
//! * All accesses performed by functions in this module are *non-atomic* in the sense
|
||||||
|
|
|
@ -49,7 +49,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// memory.
|
/// memory.
|
||||||
///
|
///
|
||||||
/// When calling this method, you have to ensure that if the pointer is
|
/// When calling this method, you have to ensure that if the pointer is
|
||||||
/// non-NULL, then it is properly aligned, dereferencable (for the whole
|
/// non-NULL, then it is properly aligned, dereferenceable (for the whole
|
||||||
/// size of `T`) and points to an initialized instance of `T`. This applies
|
/// size of `T`) and points to an initialized instance of `T`. This applies
|
||||||
/// even if the result of this method is unused!
|
/// even if the result of this method is unused!
|
||||||
/// (The part about being initialized is not yet fully decided, but until
|
/// (The part about being initialized is not yet fully decided, but until
|
||||||
|
@ -176,7 +176,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`offset`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
@ -224,7 +224,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// all of the following is true:
|
/// all of the following is true:
|
||||||
/// - it is properly aligned
|
/// - it is properly aligned
|
||||||
/// - it must point to an initialized instance of T; in particular, the pointer must be
|
/// - it must point to an initialized instance of T; in particular, the pointer must be
|
||||||
/// "dereferencable" in the sense defined [here].
|
/// "dereferenceable" in the sense defined [here].
|
||||||
///
|
///
|
||||||
/// This applies even if the result of this method is unused!
|
/// This applies even if the result of this method is unused!
|
||||||
/// (The part about being initialized is not yet fully decided, but until
|
/// (The part about being initialized is not yet fully decided, but until
|
||||||
|
@ -526,7 +526,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`add`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_add` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
@ -581,7 +581,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
|
/// within the same allocated object: [`sub`] is immediate Undefined Behavior when
|
||||||
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
|
/// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
|
||||||
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
|
/// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
|
||||||
/// better and is thus preferrable in performance-sensitive code.
|
/// better and is thus preferable in performance-sensitive code.
|
||||||
///
|
///
|
||||||
/// If you need to cross object boundaries, cast the pointer to an integer and
|
/// If you need to cross object boundaries, cast the pointer to an integer and
|
||||||
/// do the arithmetic there.
|
/// do the arithmetic there.
|
||||||
|
|
|
@ -44,7 +44,7 @@ fn ordinary() {
|
||||||
#[test]
|
#[test]
|
||||||
fn special_code_paths() {
|
fn special_code_paths() {
|
||||||
test_literal!(36893488147419103229.0); // 2^65 - 3, triggers half-to-even with even significand
|
test_literal!(36893488147419103229.0); // 2^65 - 3, triggers half-to-even with even significand
|
||||||
test_literal!(101e-33); // Triggers the tricky underflow case in AlgorithmM (for f32)
|
test_literal!(101e-33); // Triggers the tricky underflow case in algorithm (for f32)
|
||||||
test_literal!(1e23); // Triggers AlgorithmR
|
test_literal!(1e23); // Triggers AlgorithmR
|
||||||
test_literal!(2075e23); // Triggers another path through AlgorithmR
|
test_literal!(2075e23); // Triggers another path through AlgorithmR
|
||||||
test_literal!(8713e-23); // ... and yet another.
|
test_literal!(8713e-23); // ... and yet another.
|
||||||
|
|
|
@ -176,7 +176,7 @@ pub struct Parser<'a> {
|
||||||
skips: Vec<usize>,
|
skips: Vec<usize>,
|
||||||
/// Span of the last opening brace seen, used for error reporting
|
/// Span of the last opening brace seen, used for error reporting
|
||||||
last_opening_brace: Option<InnerSpan>,
|
last_opening_brace: Option<InnerSpan>,
|
||||||
/// Wether the source string is comes from `println!` as opposed to `format!` or `print!`
|
/// Whether the source string is comes from `println!` as opposed to `format!` or `print!`
|
||||||
append_newline: bool,
|
append_newline: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ macro_rules! define_handles {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HandleCounters {
|
impl HandleCounters {
|
||||||
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
|
// FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
|
||||||
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
|
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
|
||||||
extern "C" fn get() -> &'static Self {
|
extern "C" fn get() -> &'static Self {
|
||||||
static COUNTERS: HandleCounters = HandleCounters {
|
static COUNTERS: HandleCounters = HandleCounters {
|
||||||
|
@ -334,7 +334,7 @@ impl Bridge<'_> {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Client<F> {
|
pub struct Client<F> {
|
||||||
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
|
// FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
|
||||||
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
|
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
|
||||||
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
|
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
|
||||||
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
|
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
|
||||||
|
|
|
@ -653,7 +653,7 @@ impl<'hir> Map<'hir> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Wether `hir_id` corresponds to a `mod` or a crate.
|
/// Whether `hir_id` corresponds to a `mod` or a crate.
|
||||||
pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
|
pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
|
||||||
match self.lookup(hir_id) {
|
match self.lookup(hir_id) {
|
||||||
Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })
|
Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })
|
||||||
|
|
|
@ -610,7 +610,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
|
||||||
// a naive undef mask copying algorithm would repeatedly have to read the undef mask from
|
// a naive undef mask copying algorithm would repeatedly have to read the undef mask from
|
||||||
// the source and write it to the destination. Even if we optimized the memory accesses,
|
// the source and write it to the destination. Even if we optimized the memory accesses,
|
||||||
// we'd be doing all of this `repeat` times.
|
// we'd be doing all of this `repeat` times.
|
||||||
// Therefor we precompute a compressed version of the undef mask of the source value and
|
// Therefore we precompute a compressed version of the undef mask of the source value and
|
||||||
// then write it back `repeat` times without computing any more information from the source.
|
// then write it back `repeat` times without computing any more information from the source.
|
||||||
|
|
||||||
// A precomputed cache for ranges of defined/undefined bits
|
// A precomputed cache for ranges of defined/undefined bits
|
||||||
|
|
|
@ -2579,7 +2579,7 @@ where
|
||||||
if let Some(kind) = pointee.safe {
|
if let Some(kind) = pointee.safe {
|
||||||
attrs.pointee_align = Some(pointee.align);
|
attrs.pointee_align = Some(pointee.align);
|
||||||
|
|
||||||
// `Box` (`UniqueBorrowed`) are not necessarily dereferencable
|
// `Box` (`UniqueBorrowed`) are not necessarily dereferenceable
|
||||||
// for the entire duration of the function as they can be deallocated
|
// for the entire duration of the function as they can be deallocated
|
||||||
// any time. Set their valid size to 0.
|
// any time. Set their valid size to 0.
|
||||||
attrs.pointee_size = match kind {
|
attrs.pointee_size = match kind {
|
||||||
|
|
|
@ -97,7 +97,7 @@ pub trait Printer<'tcx>: Sized {
|
||||||
args: &[GenericArg<'tcx>],
|
args: &[GenericArg<'tcx>],
|
||||||
) -> Result<Self::Path, Self::Error>;
|
) -> Result<Self::Path, Self::Error>;
|
||||||
|
|
||||||
// Defaults (should not be overriden):
|
// Defaults (should not be overridden):
|
||||||
|
|
||||||
fn default_print_def_path(
|
fn default_print_def_path(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -221,7 +221,7 @@ pub trait PrettyPrinter<'tcx>:
|
||||||
/// This is typically the case for all non-`'_` regions.
|
/// This is typically the case for all non-`'_` regions.
|
||||||
fn region_should_not_be_omitted(&self, region: ty::Region<'_>) -> bool;
|
fn region_should_not_be_omitted(&self, region: ty::Region<'_>) -> bool;
|
||||||
|
|
||||||
// Defaults (should not be overriden):
|
// Defaults (should not be overridden):
|
||||||
|
|
||||||
/// If possible, this returns a global path resolving to `def_id` that is visible
|
/// If possible, this returns a global path resolving to `def_id` that is visible
|
||||||
/// from at least one local module, and returns `true`. If the crate defining `def_id` is
|
/// from at least one local module, and returns `true`. If the crate defining `def_id` is
|
||||||
|
@ -236,7 +236,7 @@ pub trait PrettyPrinter<'tcx>:
|
||||||
/// post-process it into the valid and visible version that
|
/// post-process it into the valid and visible version that
|
||||||
/// accounts for re-exports.
|
/// accounts for re-exports.
|
||||||
///
|
///
|
||||||
/// This method should only be callled by itself or
|
/// This method should only be called by itself or
|
||||||
/// `try_print_visible_def_path`.
|
/// `try_print_visible_def_path`.
|
||||||
///
|
///
|
||||||
/// `callers` is a chain of visible_parent's leading to `def_id`,
|
/// `callers` is a chain of visible_parent's leading to `def_id`,
|
||||||
|
@ -685,7 +685,7 @@ pub trait PrettyPrinter<'tcx>:
|
||||||
if self.tcx().sess.verbose() {
|
if self.tcx().sess.verbose() {
|
||||||
p!(write("{:?}", sz));
|
p!(write("{:?}", sz));
|
||||||
} else if let ty::ConstKind::Unevaluated(..) = sz.val {
|
} else if let ty::ConstKind::Unevaluated(..) = sz.val {
|
||||||
// do not try to evalute unevaluated constants. If we are const evaluating an
|
// do not try to evaluate unevaluated constants. If we are const evaluating an
|
||||||
// array length anon const, rustc will (with debug assertions) print the
|
// array length anon const, rustc will (with debug assertions) print the
|
||||||
// constant's path. Which will end up here again.
|
// constant's path. Which will end up here again.
|
||||||
p!(write("_"));
|
p!(write("_"));
|
||||||
|
|
|
@ -425,7 +425,7 @@ impl<'sess> OnDiskCache<'sess> {
|
||||||
|
|
||||||
//- DECODING -------------------------------------------------------------------
|
//- DECODING -------------------------------------------------------------------
|
||||||
|
|
||||||
/// A decoder that can read fro the incr. comp. cache. It is similar to the one
|
/// A decoder that can read from the incr. comp. cache. It is similar to the one
|
||||||
/// we use for crate metadata decoding in that it can rebase spans and eventually
|
/// we use for crate metadata decoding in that it can rebase spans and eventually
|
||||||
/// will also handle things that contain `Ty` instances.
|
/// will also handle things that contain `Ty` instances.
|
||||||
struct CacheDecoder<'a, 'tcx> {
|
struct CacheDecoder<'a, 'tcx> {
|
||||||
|
|
|
@ -1053,7 +1053,7 @@ macro_rules! define_queries_inner {
|
||||||
|
|
||||||
impl TyCtxt<$tcx> {
|
impl TyCtxt<$tcx> {
|
||||||
/// Returns a transparent wrapper for `TyCtxt`, which ensures queries
|
/// Returns a transparent wrapper for `TyCtxt`, which ensures queries
|
||||||
/// are executed instead of just returing their results.
|
/// are executed instead of just returning their results.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn ensure(self) -> TyCtxtEnsure<$tcx> {
|
pub fn ensure(self) -> TyCtxtEnsure<$tcx> {
|
||||||
TyCtxtEnsure {
|
TyCtxtEnsure {
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub trait TypeRelation<'tcx>: Sized {
|
||||||
b: &T,
|
b: &T,
|
||||||
) -> RelateResult<'tcx, T>;
|
) -> RelateResult<'tcx, T>;
|
||||||
|
|
||||||
// Overrideable relations. You shouldn't typically call these
|
// Overridable relations. You shouldn't typically call these
|
||||||
// directly, instead call `relate()`, which in turn calls
|
// directly, instead call `relate()`, which in turn calls
|
||||||
// these. This is both more uniform but also allows us to add
|
// these. This is both more uniform but also allows us to add
|
||||||
// additional hooks for other types in the future if needed
|
// additional hooks for other types in the future if needed
|
||||||
|
|
|
@ -1078,7 +1078,7 @@ impl Expr {
|
||||||
|
|
||||||
// If binary operator is `Add` and both `lhs` and `rhs` are trait bounds,
|
// If binary operator is `Add` and both `lhs` and `rhs` are trait bounds,
|
||||||
// then type of result is trait object.
|
// then type of result is trait object.
|
||||||
// Othewise we don't assume the result type.
|
// Otherwise we don't assume the result type.
|
||||||
ExprKind::Binary(binop, lhs, rhs) if binop.node == BinOpKind::Add => {
|
ExprKind::Binary(binop, lhs, rhs) if binop.node == BinOpKind::Add => {
|
||||||
if let (Some(lhs), Some(rhs)) = (lhs.to_bound(), rhs.to_bound()) {
|
if let (Some(lhs), Some(rhs)) = (lhs.to_bound(), rhs.to_bound()) {
|
||||||
TyKind::TraitObject(vec![lhs, rhs], TraitObjectSyntax::None)
|
TyKind::TraitObject(vec![lhs, rhs], TraitObjectSyntax::None)
|
||||||
|
@ -2089,7 +2089,7 @@ impl Async {
|
||||||
if let Async::Yes { .. } = self { true } else { false }
|
if let Async::Yes { .. } = self { true } else { false }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// In ths case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
|
/// In this case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
|
||||||
pub fn opt_return_id(self) -> Option<NodeId> {
|
pub fn opt_return_id(self) -> Option<NodeId> {
|
||||||
match self {
|
match self {
|
||||||
Async::Yes { return_impl_trait_id, .. } => Some(return_impl_trait_id),
|
Async::Yes { return_impl_trait_id, .. } => Some(return_impl_trait_id),
|
||||||
|
|
|
@ -1096,7 +1096,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||||
match arg {
|
match arg {
|
||||||
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(<)),
|
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(<)),
|
||||||
ast::GenericArg::Type(ty) => {
|
ast::GenericArg::Type(ty) => {
|
||||||
// We parse const arguments as path types as we cannot distiguish them durring
|
// We parse const arguments as path types as we cannot distinguish them during
|
||||||
// parsing. We try to resolve that ambiguity by attempting resolution in both the
|
// parsing. We try to resolve that ambiguity by attempting resolution in both the
|
||||||
// type and value namespaces. If we resolved the path in the value namespace, we
|
// type and value namespaces. If we resolved the path in the value namespace, we
|
||||||
// transform it into a generic const argument.
|
// transform it into a generic const argument.
|
||||||
|
|
|
@ -904,7 +904,7 @@ pub fn expand_preparsed_format_args(
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Finds the indices of all characters that have been processed and differ between the actual
|
/// Finds the indices of all characters that have been processed and differ between the actual
|
||||||
/// written code (code snippet) and the `InternedString` that get's processed in the `Parser`
|
/// written code (code snippet) and the `InternedString` that gets processed in the `Parser`
|
||||||
/// in order to properly synthethise the intra-string `Span`s for error diagnostics.
|
/// in order to properly synthethise the intra-string `Span`s for error diagnostics.
|
||||||
fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
|
fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
|
||||||
let mut eat_ws = false;
|
let mut eat_ws = false;
|
||||||
|
|
|
@ -504,7 +504,7 @@ fn thin_lto(
|
||||||
//
|
//
|
||||||
// This strategy means we can always save the computed imports as
|
// This strategy means we can always save the computed imports as
|
||||||
// canon: when we reuse the post-ThinLTO version, condition (3.)
|
// canon: when we reuse the post-ThinLTO version, condition (3.)
|
||||||
// ensures that the curent import set is the same as the previous
|
// ensures that the current import set is the same as the previous
|
||||||
// one. (And of course, when we don't reuse the post-ThinLTO
|
// one. (And of course, when we don't reuse the post-ThinLTO
|
||||||
// version, the current import set *is* the correct one, since we
|
// version, the current import set *is* the correct one, since we
|
||||||
// are doing the ThinLTO in this current compilation cycle.)
|
// are doing the ThinLTO in this current compilation cycle.)
|
||||||
|
@ -538,7 +538,7 @@ fn thin_lto(
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the curent ThinLTO import information for the next compilation
|
// Save the current ThinLTO import information for the next compilation
|
||||||
// session, overwriting the previous serialized imports (if any).
|
// session, overwriting the previous serialized imports (if any).
|
||||||
if let Some(path) = import_map_path {
|
if let Some(path) = import_map_path {
|
||||||
if let Err(err) = curr_import_map.save_to_file(&path) {
|
if let Err(err) = curr_import_map.save_to_file(&path) {
|
||||||
|
|
|
@ -9,8 +9,8 @@ fn llvm_args_to_string_id(profiler: &SelfProfiler, pass_name: &str, ir_name: &st
|
||||||
let mut components = vec![StringComponent::Ref(pass_name)];
|
let mut components = vec![StringComponent::Ref(pass_name)];
|
||||||
// handle that LazyCallGraph::SCC is a comma separated list within parentheses
|
// handle that LazyCallGraph::SCC is a comma separated list within parentheses
|
||||||
let parentheses: &[_] = &['(', ')'];
|
let parentheses: &[_] = &['(', ')'];
|
||||||
let trimed = ir_name.trim_matches(parentheses);
|
let trimmed = ir_name.trim_matches(parentheses);
|
||||||
for part in trimed.split(", ") {
|
for part in trimmed.split(", ") {
|
||||||
let demangled_ir_name = rustc_demangle::demangle(part).to_string();
|
let demangled_ir_name = rustc_demangle::demangle(part).to_string();
|
||||||
let ir_name = profiler.get_or_alloc_cached_string(demangled_ir_name);
|
let ir_name = profiler.get_or_alloc_cached_string(demangled_ir_name);
|
||||||
components.push(StringComponent::Value(SEPARATOR_BYTE));
|
components.push(StringComponent::Value(SEPARATOR_BYTE));
|
||||||
|
|
|
@ -637,7 +637,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
|
||||||
unsafe {
|
unsafe {
|
||||||
// The choice of type here is pretty arbitrary -
|
// The choice of type here is pretty arbitrary -
|
||||||
// anything reading the debuginfo for a recursive
|
// anything reading the debuginfo for a recursive
|
||||||
// type is going to see *somthing* weird - the only
|
// type is going to see *something* weird - the only
|
||||||
// question is what exactly it will see.
|
// question is what exactly it will see.
|
||||||
let (size, align) = cx.size_and_align_of(t);
|
let (size, align) = cx.size_and_align_of(t);
|
||||||
llvm::LLVMRustDIBuilderCreateBasicType(
|
llvm::LLVMRustDIBuilderCreateBasicType(
|
||||||
|
|
|
@ -736,7 +736,7 @@ fn execute_work_item<B: ExtraBackendMethods>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actual LTO type we end up chosing based on multiple factors.
|
// Actual LTO type we end up choosing based on multiple factors.
|
||||||
enum ComputedLtoType {
|
enum ComputedLtoType {
|
||||||
No,
|
No,
|
||||||
Thin,
|
Thin,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//! actual codegen, while the builder stores the information about the function during codegen and
|
//! actual codegen, while the builder stores the information about the function during codegen and
|
||||||
//! is used to produce the instructions of the backend IR.
|
//! is used to produce the instructions of the backend IR.
|
||||||
//!
|
//!
|
||||||
//! Finaly, a third `Backend` structure has to implement methods related to how codegen information
|
//! Finally, a third `Backend` structure has to implement methods related to how codegen information
|
||||||
//! is passed to the backend, especially for asynchronous compilation.
|
//! is passed to the backend, especially for asynchronous compilation.
|
||||||
//!
|
//!
|
||||||
//! The traits contain associated types that are backend-specific, such as the backend's value or
|
//! The traits contain associated types that are backend-specific, such as the backend's value or
|
||||||
|
|
|
@ -185,7 +185,7 @@ fn compute_symbol_name(
|
||||||
//
|
//
|
||||||
// * On the wasm32 targets there is a bug (or feature) in LLD [1] where the
|
// * On the wasm32 targets there is a bug (or feature) in LLD [1] where the
|
||||||
// same-named symbol when imported from different wasm modules will get
|
// same-named symbol when imported from different wasm modules will get
|
||||||
// hooked up incorectly. As a result foreign symbols, on the wasm target,
|
// hooked up incorrectly. As a result foreign symbols, on the wasm target,
|
||||||
// with a wasm import module, get mangled. Additionally our codegen will
|
// with a wasm import module, get mangled. Additionally our codegen will
|
||||||
// deduplicate symbols based purely on the symbol name, but for wasm this
|
// deduplicate symbols based purely on the symbol name, but for wasm this
|
||||||
// isn't quite right because the same-named symbol on wasm can come from
|
// isn't quite right because the same-named symbol on wasm can come from
|
||||||
|
|
|
@ -23,7 +23,7 @@ fn num_nodes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn succesors() {
|
fn successors() {
|
||||||
let graph = create_graph();
|
let graph = create_graph();
|
||||||
assert_eq!(graph.successors(0), &[1]);
|
assert_eq!(graph.successors(0), &[1]);
|
||||||
assert_eq!(graph.successors(1), &[2, 3]);
|
assert_eq!(graph.successors(1), &[2, 3]);
|
||||||
|
|
|
@ -13,7 +13,7 @@ struct CacheAligned<T>(T);
|
||||||
#[cfg(parallel_compiler)]
|
#[cfg(parallel_compiler)]
|
||||||
// 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700,
|
// 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700,
|
||||||
// but this should be tested on higher core count CPUs. How the `Sharded` type gets used
|
// but this should be tested on higher core count CPUs. How the `Sharded` type gets used
|
||||||
// may also affect the ideal nunber of shards.
|
// may also affect the ideal number of shards.
|
||||||
const SHARD_BITS: usize = 5;
|
const SHARD_BITS: usize = 5;
|
||||||
|
|
||||||
#[cfg(not(parallel_compiler))]
|
#[cfg(not(parallel_compiler))]
|
||||||
|
@ -41,7 +41,7 @@ impl<T> Sharded<T> {
|
||||||
let mut values: SmallVec<[_; SHARDS]> =
|
let mut values: SmallVec<[_; SHARDS]> =
|
||||||
(0..SHARDS).map(|_| CacheAligned(Lock::new(value()))).collect();
|
(0..SHARDS).map(|_| CacheAligned(Lock::new(value()))).collect();
|
||||||
|
|
||||||
// Create an unintialized array
|
// Create an uninitialized array
|
||||||
let mut shards: mem::MaybeUninit<[CacheAligned<Lock<T>>; SHARDS]> =
|
let mut shards: mem::MaybeUninit<[CacheAligned<Lock<T>>; SHARDS]> =
|
||||||
mem::MaybeUninit::uninit();
|
mem::MaybeUninit::uninit();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
An implementation of a trait doesn't match the type contraint.
|
An implementation of a trait doesn't match the type constraint.
|
||||||
|
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ This pattern should be rewritten. There are a few possible ways to do this:
|
||||||
|
|
||||||
- change the original fn declaration to match the expected signature,
|
- change the original fn declaration to match the expected signature,
|
||||||
and do the cast in the fn body (the preferred option)
|
and do the cast in the fn body (the preferred option)
|
||||||
- cast the fn item fo a fn pointer before calling transmute, as shown here:
|
- cast the fn item of a fn pointer before calling transmute, as shown here:
|
||||||
|
|
||||||
```
|
```
|
||||||
# extern "C" fn foo(_: Box<i32>) {}
|
# extern "C" fn foo(_: Box<i32>) {}
|
||||||
|
|
|
@ -991,7 +991,7 @@ fn token_can_be_followed_by_any(tok: &mbe::TokenTree) -> bool {
|
||||||
if let mbe::TokenTree::MetaVarDecl(_, _, frag_spec) = *tok {
|
if let mbe::TokenTree::MetaVarDecl(_, _, frag_spec) = *tok {
|
||||||
frag_can_be_followed_by_any(frag_spec.name)
|
frag_can_be_followed_by_any(frag_spec.name)
|
||||||
} else {
|
} else {
|
||||||
// (Non NT's can always be followed by anthing in matchers.)
|
// (Non NT's can always be followed by anything in matchers.)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ impl MultiItemModifier for ProcMacroDerive {
|
||||||
};
|
};
|
||||||
|
|
||||||
let error_count_before = ecx.parse_sess.span_diagnostic.err_count();
|
let error_count_before = ecx.parse_sess.span_diagnostic.err_count();
|
||||||
let msg = "proc-macro derive produced unparseable tokens";
|
let msg = "proc-macro derive produced unparsable tokens";
|
||||||
|
|
||||||
let mut parser =
|
let mut parser =
|
||||||
rustc_parse::stream_to_parser(ecx.parse_sess, stream, Some("proc-macro derive"));
|
rustc_parse::stream_to_parser(ecx.parse_sess, stream, Some("proc-macro derive"));
|
||||||
|
|
|
@ -387,7 +387,7 @@ declare_features! (
|
||||||
/// Allows defining `trait X = A + B;` alias items.
|
/// Allows defining `trait X = A + B;` alias items.
|
||||||
(active, trait_alias, "1.24.0", Some(41517), None),
|
(active, trait_alias, "1.24.0", Some(41517), None),
|
||||||
|
|
||||||
/// Allows infering `'static` outlives requirements (RFC 2093).
|
/// Allows inferring `'static` outlives requirements (RFC 2093).
|
||||||
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),
|
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),
|
||||||
|
|
||||||
/// Allows accessing fields of unions inside `const` functions.
|
/// Allows accessing fields of unions inside `const` functions.
|
||||||
|
|
|
@ -175,7 +175,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// Stable attributes:
|
// Stable attributes:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Condtional compilation:
|
// Conditional compilation:
|
||||||
ungated!(cfg, Normal, template!(List: "predicate")),
|
ungated!(cfg, Normal, template!(List: "predicate")),
|
||||||
ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ...")),
|
ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ...")),
|
||||||
|
|
||||||
|
|
|
@ -1819,7 +1819,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
"{} may not live long enough",
|
"{} may not live long enough",
|
||||||
labeled_user_string
|
labeled_user_string
|
||||||
);
|
);
|
||||||
// Explicitely use the name instead of `sub`'s `Display` impl. The `Display` impl
|
// Explicitly use the name instead of `sub`'s `Display` impl. The `Display` impl
|
||||||
// for the bound is not suitable for suggestions when `-Zverbose` is set because it
|
// for the bound is not suitable for suggestions when `-Zverbose` is set because it
|
||||||
// uses `Debug` output, so we handle it specially here so that suggestions are
|
// uses `Debug` output, so we handle it specially here so that suggestions are
|
||||||
// always correct.
|
// always correct.
|
||||||
|
|
|
@ -391,7 +391,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
err.span_label(pattern.span, msg);
|
err.span_label(pattern.span, msg);
|
||||||
} else if let Some(e) = local_visitor.found_method_call {
|
} else if let Some(e) = local_visitor.found_method_call {
|
||||||
if let ExprKind::MethodCall(segment, ..) = &e.kind {
|
if let ExprKind::MethodCall(segment, ..) = &e.kind {
|
||||||
// Suggest specifiying type params or point out the return type of the call:
|
// Suggest specifying type params or point out the return type of the call:
|
||||||
//
|
//
|
||||||
// error[E0282]: type annotations needed
|
// error[E0282]: type annotations needed
|
||||||
// --> $DIR/type-annotations-needed-expr.rs:2:39
|
// --> $DIR/type-annotations-needed-expr.rs:2:39
|
||||||
|
|
|
@ -1667,14 +1667,14 @@ impl<'a, 'tcx> ShallowResolver<'a, 'tcx> {
|
||||||
|
|
||||||
ty::IntVar(v) => {
|
ty::IntVar(v) => {
|
||||||
// If inlined_probe_value returns a value it's always a
|
// If inlined_probe_value returns a value it's always a
|
||||||
// `ty::Int(_)` or `ty::UInt(_)`, which nevers matches a
|
// `ty::Int(_)` or `ty::UInt(_)`, which never matches a
|
||||||
// `ty::Infer(_)`.
|
// `ty::Infer(_)`.
|
||||||
self.infcx.inner.borrow_mut().int_unification_table.inlined_probe_value(v).is_some()
|
self.infcx.inner.borrow_mut().int_unification_table.inlined_probe_value(v).is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::FloatVar(v) => {
|
ty::FloatVar(v) => {
|
||||||
// If inlined_probe_value returns a value it's always a
|
// If inlined_probe_value returns a value it's always a
|
||||||
// `ty::Float(_)`, which nevers matches a `ty::Infer(_)`.
|
// `ty::Float(_)`, which never matches a `ty::Infer(_)`.
|
||||||
//
|
//
|
||||||
// Not `inlined_probe_value(v)` because this call site is colder.
|
// Not `inlined_probe_value(v)` because this call site is colder.
|
||||||
self.infcx.inner.borrow_mut().float_unification_table.probe_value(v).is_some()
|
self.infcx.inner.borrow_mut().float_unification_table.probe_value(v).is_some()
|
||||||
|
|
|
@ -264,7 +264,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Here we would report a more complex "in constraint", like `'r
|
/// Here we would report a more complex "in constraint", like `'r
|
||||||
/// in ['a, 'b, 'static]` (where `'r` is some regon appearing in
|
/// in ['a, 'b, 'static]` (where `'r` is some region appearing in
|
||||||
/// the hidden type).
|
/// the hidden type).
|
||||||
///
|
///
|
||||||
/// # Constrain regions, not the hidden concrete type
|
/// # Constrain regions, not the hidden concrete type
|
||||||
|
|
|
@ -169,7 +169,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
// N.B. This type is not public because the protocol around checking the
|
// N.B. This type is not public because the protocol around checking the
|
||||||
// `err` field is not enforcable otherwise.
|
// `err` field is not enforceable otherwise.
|
||||||
struct FullTypeResolver<'a, 'tcx> {
|
struct FullTypeResolver<'a, 'tcx> {
|
||||||
infcx: &'a InferCtxt<'a, 'tcx>,
|
infcx: &'a InferCtxt<'a, 'tcx>,
|
||||||
err: Option<FixupError<'tcx>>,
|
err: Option<FixupError<'tcx>>,
|
||||||
|
|
|
@ -455,7 +455,7 @@ impl AutoTraitFinder<'tcx> {
|
||||||
// predicate has some other kind of region. An region
|
// predicate has some other kind of region. An region
|
||||||
// variable isn't something we can actually display to a user,
|
// variable isn't something we can actually display to a user,
|
||||||
// so we choose their new predicate (which doesn't have a region
|
// so we choose their new predicate (which doesn't have a region
|
||||||
// varaible).
|
// variable).
|
||||||
//
|
//
|
||||||
// In both cases, we want to remove the old predicate,
|
// In both cases, we want to remove the old predicate,
|
||||||
// from `user_computed_preds`, and replace it with the new
|
// from `user_computed_preds`, and replace it with the new
|
||||||
|
@ -701,7 +701,7 @@ impl AutoTraitFinder<'tcx> {
|
||||||
// some subobligations. We then process these subobligations
|
// some subobligations. We then process these subobligations
|
||||||
// like any other generated sub-obligations.
|
// like any other generated sub-obligations.
|
||||||
//
|
//
|
||||||
// 3. We receieve an 'ambiguous' result (Ok(None))
|
// 3. We receive an 'ambiguous' result (Ok(None))
|
||||||
// If we were actually trying to compile a crate,
|
// If we were actually trying to compile a crate,
|
||||||
// we would need to re-process this obligation later.
|
// we would need to re-process this obligation later.
|
||||||
// However, all we care about is finding out what bounds
|
// However, all we care about is finding out what bounds
|
||||||
|
|
|
@ -505,7 +505,7 @@ fn ty_is_non_local_constructor<'tcx>(ty: Ty<'tcx>, in_crate: InCrate) -> Option<
|
||||||
//
|
//
|
||||||
// We choose to treat all opaque types as non-local, even
|
// We choose to treat all opaque types as non-local, even
|
||||||
// those that appear within the same crate. This seems
|
// those that appear within the same crate. This seems
|
||||||
// somewhat suprising at first, but makes sense when
|
// somewhat surprising at first, but makes sense when
|
||||||
// you consider that opaque types are supposed to hide
|
// you consider that opaque types are supposed to hide
|
||||||
// the underlying type *within the same crate*. When an
|
// the underlying type *within the same crate*. When an
|
||||||
// opaque type is used from outside the module
|
// opaque type is used from outside the module
|
||||||
|
|
|
@ -1142,7 +1142,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
// we're only talking about builtin traits, which are known to be
|
// we're only talking about builtin traits, which are known to be
|
||||||
// inhabited. We used to check for `self.tcx.sess.has_errors()` to
|
// inhabited. We used to check for `self.tcx.sess.has_errors()` to
|
||||||
// avoid inundating the user with unnecessary errors, but we now
|
// avoid inundating the user with unnecessary errors, but we now
|
||||||
// check upstream for type errors and dont add the obligations to
|
// check upstream for type errors and don't add the obligations to
|
||||||
// begin with in those cases.
|
// begin with in those cases.
|
||||||
if self
|
if self
|
||||||
.tcx
|
.tcx
|
||||||
|
|
|
@ -612,7 +612,7 @@ fn receiver_is_dispatchable<'tcx>(
|
||||||
};
|
};
|
||||||
|
|
||||||
// the type `U` in the query
|
// the type `U` in the query
|
||||||
// use a bogus type parameter to mimick a forall(U) query using u32::MAX for now.
|
// use a bogus type parameter to mimic a forall(U) query using u32::MAX for now.
|
||||||
// FIXME(mikeyhew) this is a total hack. Once object_safe_for_dispatch is stabilized, we can
|
// FIXME(mikeyhew) this is a total hack. Once object_safe_for_dispatch is stabilized, we can
|
||||||
// replace this with `dyn Trait`
|
// replace this with `dyn Trait`
|
||||||
let unsized_self_ty: Ty<'tcx> =
|
let unsized_self_ty: Ty<'tcx> =
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub enum EscapeError {
|
||||||
|
|
||||||
/// Escaped '\' character without continuation.
|
/// Escaped '\' character without continuation.
|
||||||
LoneSlash,
|
LoneSlash,
|
||||||
/// Invalid escape characted (e.g. '\z').
|
/// Invalid escape character (e.g. '\z').
|
||||||
InvalidEscape,
|
InvalidEscape,
|
||||||
/// Raw '\r' encountered.
|
/// Raw '\r' encountered.
|
||||||
BareCarriageReturn,
|
BareCarriageReturn,
|
||||||
|
@ -43,7 +43,7 @@ pub enum EscapeError {
|
||||||
UnclosedUnicodeEscape,
|
UnclosedUnicodeEscape,
|
||||||
/// '\u{_12}'
|
/// '\u{_12}'
|
||||||
LeadingUnderscoreUnicodeEscape,
|
LeadingUnderscoreUnicodeEscape,
|
||||||
/// More than 6 charactes in '\u{..}', e.g. '\u{10FFFF_FF}'
|
/// More than 6 characters in '\u{..}', e.g. '\u{10FFFF_FF}'
|
||||||
OverlongUnicodeEscape,
|
OverlongUnicodeEscape,
|
||||||
/// Invalid in-bound unicode character code, e.g. '\u{DFFF}'.
|
/// Invalid in-bound unicode character code, e.g. '\u{DFFF}'.
|
||||||
LoneSurrogateUnicodeEscape,
|
LoneSurrogateUnicodeEscape,
|
||||||
|
|
|
@ -57,7 +57,7 @@ enum QueryModifier {
|
||||||
/// Generate a dep node based on the dependencies of the query
|
/// Generate a dep node based on the dependencies of the query
|
||||||
Anon,
|
Anon,
|
||||||
|
|
||||||
/// Always evaluate the query, ignoring its depdendencies
|
/// Always evaluate the query, ignoring its dependencies
|
||||||
EvalAlways,
|
EvalAlways,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ struct QueryModifiers {
|
||||||
/// Generate a dep node based on the dependencies of the query
|
/// Generate a dep node based on the dependencies of the query
|
||||||
anon: bool,
|
anon: bool,
|
||||||
|
|
||||||
// Always evaluate the query, ignoring its depdendencies
|
// Always evaluate the query, ignoring its dependencies
|
||||||
eval_always: bool,
|
eval_always: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -711,7 +711,7 @@ impl<'a> CrateLocator<'a> {
|
||||||
// See also #68149 which provides more detail on why emitting the
|
// See also #68149 which provides more detail on why emitting the
|
||||||
// dependency on the rlib is a bad thing.
|
// dependency on the rlib is a bad thing.
|
||||||
//
|
//
|
||||||
// We currenty do not verify that these other sources are even in sync,
|
// We currently do not verify that these other sources are even in sync,
|
||||||
// and this is arguably a bug (see #10786), but because reading metadata
|
// and this is arguably a bug (see #10786), but because reading metadata
|
||||||
// is quite slow (especially from dylibs) we currently do not read it
|
// is quite slow (especially from dylibs) we currently do not read it
|
||||||
// from the other crate sources.
|
// from the other crate sources.
|
||||||
|
|
|
@ -201,7 +201,7 @@ crate struct CrateRoot<'tcx> {
|
||||||
|
|
||||||
per_def: LazyPerDefTables<'tcx>,
|
per_def: LazyPerDefTables<'tcx>,
|
||||||
|
|
||||||
/// The DefIndex's of any proc macros delcared by this crate.
|
/// The DefIndex's of any proc macros declared by this crate.
|
||||||
proc_macro_data: Option<Lazy<[DefIndex]>>,
|
proc_macro_data: Option<Lazy<[DefIndex]>>,
|
||||||
|
|
||||||
compiler_builtins: bool,
|
compiler_builtins: bool,
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
GeneratorKind::Async(async_kind) => match async_kind {
|
GeneratorKind::Async(async_kind) => match async_kind {
|
||||||
AsyncGeneratorKind::Block => "async block",
|
AsyncGeneratorKind::Block => "async block",
|
||||||
AsyncGeneratorKind::Closure => "async closure",
|
AsyncGeneratorKind::Closure => "async closure",
|
||||||
_ => bug!("async block/closure expected, but async funtion found."),
|
_ => bug!("async block/closure expected, but async function found."),
|
||||||
},
|
},
|
||||||
GeneratorKind::Gen => "generator",
|
GeneratorKind::Gen => "generator",
|
||||||
},
|
},
|
||||||
|
|
|
@ -445,7 +445,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||||
err.buffer(&mut self.errors_buffer);
|
err.buffer(&mut self.errors_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Targetted error when encountering an `FnMut` closure where an `Fn` closure was expected.
|
/// Targeted error when encountering an `FnMut` closure where an `Fn` closure was expected.
|
||||||
fn expected_fn_found_fn_mut_call(&self, err: &mut DiagnosticBuilder<'_>, sp: Span, act: &str) {
|
fn expected_fn_found_fn_mut_call(&self, err: &mut DiagnosticBuilder<'_>, sp: Span, act: &str) {
|
||||||
err.span_label(sp, format!("cannot {}", act));
|
err.span_label(sp, format!("cannot {}", act));
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
|
||||||
self.mutate_place(location, lhs, Shallow(None), JustWrite);
|
self.mutate_place(location, lhs, Shallow(None), JustWrite);
|
||||||
}
|
}
|
||||||
StatementKind::FakeRead(_, _) => {
|
StatementKind::FakeRead(_, _) => {
|
||||||
// Only relavent for initialized/liveness/safety checks.
|
// Only relevant for initialized/liveness/safety checks.
|
||||||
}
|
}
|
||||||
StatementKind::SetDiscriminant { ref place, variant_index: _ } => {
|
StatementKind::SetDiscriminant { ref place, variant_index: _ } => {
|
||||||
self.mutate_place(location, place, Shallow(None), JustWrite);
|
self.mutate_place(location, place, Shallow(None), JustWrite);
|
||||||
|
|
|
@ -125,7 +125,7 @@ where
|
||||||
// wind up mapped to the same key `S`, we would append the
|
// wind up mapped to the same key `S`, we would append the
|
||||||
// linked list for `Ra` onto the end of the linked list for
|
// linked list for `Ra` onto the end of the linked list for
|
||||||
// `Rb` (or vice versa) -- this basically just requires
|
// `Rb` (or vice versa) -- this basically just requires
|
||||||
// rewriting the final link from one list to point at the othe
|
// rewriting the final link from one list to point at the other
|
||||||
// other (see `append_list`).
|
// other (see `append_list`).
|
||||||
|
|
||||||
let MemberConstraintSet { first_constraints, mut constraints, choice_regions } = self;
|
let MemberConstraintSet { first_constraints, mut constraints, choice_regions } = self;
|
||||||
|
|
|
@ -452,7 +452,7 @@ crate struct MirBorrowckCtxt<'cx, 'tcx> {
|
||||||
/// for the activation of the borrow.
|
/// for the activation of the borrow.
|
||||||
reservation_warnings:
|
reservation_warnings:
|
||||||
FxHashMap<BorrowIndex, (Place<'tcx>, Span, Location, BorrowKind, BorrowData<'tcx>)>,
|
FxHashMap<BorrowIndex, (Place<'tcx>, Span, Location, BorrowKind, BorrowData<'tcx>)>,
|
||||||
/// This field keeps track of move errors that are to be reported for given move indicies.
|
/// This field keeps track of move errors that are to be reported for given move indices.
|
||||||
///
|
///
|
||||||
/// There are situations where many errors can be reported for a single move out (see #53807)
|
/// There are situations where many errors can be reported for a single move out (see #53807)
|
||||||
/// and we want only the best of those errors.
|
/// and we want only the best of those errors.
|
||||||
|
|
|
@ -579,7 +579,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
|
||||||
| ConstraintCategory::UseAsConst
|
| ConstraintCategory::UseAsConst
|
||||||
| ConstraintCategory::UseAsStatic = constraint.category
|
| ConstraintCategory::UseAsStatic = constraint.category
|
||||||
{
|
{
|
||||||
// "Returning" from a promoted is an assigment to a
|
// "Returning" from a promoted is an assignment to a
|
||||||
// temporary from the user's point of view.
|
// temporary from the user's point of view.
|
||||||
constraint.category = ConstraintCategory::Boring;
|
constraint.category = ConstraintCategory::Boring;
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ pub fn const_eval_validated_provider<'tcx>(
|
||||||
match tcx.const_eval_validated(key) {
|
match tcx.const_eval_validated(key) {
|
||||||
// try again with reveal all as requested
|
// try again with reveal all as requested
|
||||||
Err(ErrorHandled::TooGeneric) => {}
|
Err(ErrorHandled::TooGeneric) => {}
|
||||||
// dedupliate calls
|
// deduplicate calls
|
||||||
other => return other,
|
other => return other,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ pub fn const_eval_raw_provider<'tcx>(
|
||||||
match tcx.const_eval_raw(key) {
|
match tcx.const_eval_raw(key) {
|
||||||
// try again with reveal all as requested
|
// try again with reveal all as requested
|
||||||
Err(ErrorHandled::TooGeneric) => {}
|
Err(ErrorHandled::TooGeneric) => {}
|
||||||
// dedupliate calls
|
// deduplicate calls
|
||||||
other => return other,
|
other => return other,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -670,7 +670,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
);
|
);
|
||||||
if cur_unwinding {
|
if cur_unwinding {
|
||||||
// Follow the unwind edge.
|
// Follow the unwind edge.
|
||||||
let unwind = next_block.expect("Encounted StackPopCleanup::None when unwinding!");
|
let unwind = next_block.expect("Encountered StackPopCleanup::None when unwinding!");
|
||||||
self.unwind_to_block(unwind);
|
self.unwind_to_block(unwind);
|
||||||
} else {
|
} else {
|
||||||
// Follow the normal return edge.
|
// Follow the normal return edge.
|
||||||
|
|
|
@ -227,7 +227,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
|
||||||
/// it contains (in relocations) tagged. The way we construct allocations is
|
/// it contains (in relocations) tagged. The way we construct allocations is
|
||||||
/// to always first construct it without extra and then add the extra.
|
/// to always first construct it without extra and then add the extra.
|
||||||
/// This keeps uniform code paths for handling both allocations created by CTFE
|
/// This keeps uniform code paths for handling both allocations created by CTFE
|
||||||
/// for statics, and allocations ceated by Miri during evaluation.
|
/// for statics, and allocations created by Miri during evaluation.
|
||||||
///
|
///
|
||||||
/// `kind` is the kind of the allocation being tagged; it can be `None` when
|
/// `kind` is the kind of the allocation being tagged; it can be `None` when
|
||||||
/// it's a static and `STATIC_KIND` is `None`.
|
/// it's a static and `STATIC_KIND` is `None`.
|
||||||
|
|
|
@ -678,7 +678,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
// Then computing the absolute variant idx should not overflow any more.
|
// Then computing the absolute variant idx should not overflow any more.
|
||||||
let variant_index = variants_start
|
let variant_index = variants_start
|
||||||
.checked_add(variant_index_relative)
|
.checked_add(variant_index_relative)
|
||||||
.expect("oveflow computing absolute variant idx");
|
.expect("overflow computing absolute variant idx");
|
||||||
let variants_len = rval
|
let variants_len = rval
|
||||||
.layout
|
.layout
|
||||||
.ty
|
.ty
|
||||||
|
|
|
@ -292,7 +292,7 @@ where
|
||||||
|
|
||||||
let all_bytes = 0..self.len();
|
let all_bytes = 0..self.len();
|
||||||
// This 'inspect' is okay since following access respects undef and relocations. This does
|
// This 'inspect' is okay since following access respects undef and relocations. This does
|
||||||
// influence interpreter exeuction, but only to detect the error of cycles in evalution
|
// influence interpreter exeuction, but only to detect the error of cycles in evaluation
|
||||||
// dependencies.
|
// dependencies.
|
||||||
let bytes = self.inspect_with_undef_and_ptr_outside_interpreter(all_bytes);
|
let bytes = self.inspect_with_undef_and_ptr_outside_interpreter(all_bytes);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ fn is_stable(place: PlaceRef<'_, '_>) -> bool {
|
||||||
// Which place this evaluates to can change with any memory write,
|
// Which place this evaluates to can change with any memory write,
|
||||||
// so cannot assume this to be stable.
|
// so cannot assume this to be stable.
|
||||||
ProjectionElem::Deref => false,
|
ProjectionElem::Deref => false,
|
||||||
// Array indices are intersting, but MIR building generates a *fresh*
|
// Array indices are interesting, but MIR building generates a *fresh*
|
||||||
// temporary for every array access, so the index cannot be changed as
|
// temporary for every array access, so the index cannot be changed as
|
||||||
// a side-effect.
|
// a side-effect.
|
||||||
ProjectionElem::Index { .. } |
|
ProjectionElem::Index { .. } |
|
||||||
|
|
|
@ -664,7 +664,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME> figure out what tho do when try_read_immediate fails
|
// FIXME> figure out what to do when try_read_immediate fails
|
||||||
let imm = self.use_ecx(|this| this.ecx.try_read_immediate(value));
|
let imm = self.use_ecx(|this| this.ecx.try_read_immediate(value));
|
||||||
|
|
||||||
if let Some(Ok(imm)) = imm {
|
if let Some(Ok(imm)) = imm {
|
||||||
|
|
|
@ -731,7 +731,7 @@ where
|
||||||
self.elaborator.patch().new_block(base_block)
|
self.elaborator.patch().new_block(base_block)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ceates a pair of drop-loops of `place`, which drops its contents, even
|
/// Creates a pair of drop-loops of `place`, which drops its contents, even
|
||||||
/// in the case of 1 panic. If `ptr_based`, creates a pointer loop,
|
/// in the case of 1 panic. If `ptr_based`, creates a pointer loop,
|
||||||
/// otherwise create an index loop.
|
/// otherwise create an index loop.
|
||||||
fn drop_loop_pair(
|
fn drop_loop_pair(
|
||||||
|
|
|
@ -490,7 +490,7 @@ fn write_scope_tree(
|
||||||
}
|
}
|
||||||
|
|
||||||
let children = match scope_tree.get(&parent) {
|
let children = match scope_tree.get(&parent) {
|
||||||
Some(childs) => childs,
|
Some(children) => children,
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -837,7 +837,7 @@ impl<'tcx> Constructor<'tcx> {
|
||||||
// eliminate it straight away.
|
// eliminate it straight away.
|
||||||
remaining_ranges = vec![];
|
remaining_ranges = vec![];
|
||||||
} else {
|
} else {
|
||||||
// Otherwise explicitely compute the remaining ranges.
|
// Otherwise explicitly compute the remaining ranges.
|
||||||
remaining_ranges = other_range.subtract_from(remaining_ranges);
|
remaining_ranges = other_range.subtract_from(remaining_ranges);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,7 @@ impl<'a> StripUnconfigured<'a> {
|
||||||
/// Parse and expand all `cfg_attr` attributes into a list of attributes
|
/// Parse and expand all `cfg_attr` attributes into a list of attributes
|
||||||
/// that are within each `cfg_attr` that has a true configuration predicate.
|
/// that are within each `cfg_attr` that has a true configuration predicate.
|
||||||
///
|
///
|
||||||
/// Gives compiler warnigns if any `cfg_attr` does not contain any
|
/// Gives compiler warnings if any `cfg_attr` does not contain any
|
||||||
/// attributes and is in the original source code. Gives compiler errors if
|
/// attributes and is in the original source code. Gives compiler errors if
|
||||||
/// the syntax of any `cfg_attr` is incorrect.
|
/// the syntax of any `cfg_attr` is incorrect.
|
||||||
pub fn process_cfg_attrs<T: HasAttrs>(&mut self, node: &mut T) {
|
pub fn process_cfg_attrs<T: HasAttrs>(&mut self, node: &mut T) {
|
||||||
|
|
|
@ -138,7 +138,7 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
if let Some(prev_attr_sp) = prev_attr_sp {
|
if let Some(prev_attr_sp) = prev_attr_sp {
|
||||||
diagnostic
|
diagnostic
|
||||||
.span_label(attr_sp, "not permitted following an outer attibute")
|
.span_label(attr_sp, "not permitted following an outer attribute")
|
||||||
.span_label(prev_attr_sp, prev_attr_note);
|
.span_label(prev_attr_sp, prev_attr_note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -895,7 +895,7 @@ impl<'a> Parser<'a> {
|
||||||
let msg = format!("expected `;`, found `{}`", super::token_descr(&self.token));
|
let msg = format!("expected `;`, found `{}`", super::token_descr(&self.token));
|
||||||
let appl = Applicability::MachineApplicable;
|
let appl = Applicability::MachineApplicable;
|
||||||
if self.token.span == DUMMY_SP || self.prev_token.span == DUMMY_SP {
|
if self.token.span == DUMMY_SP || self.prev_token.span == DUMMY_SP {
|
||||||
// Likely inside a macro, can't provide meaninful suggestions.
|
// Likely inside a macro, can't provide meaningful suggestions.
|
||||||
return self.expect(&token::Semi).map(drop);
|
return self.expect(&token::Semi).map(drop);
|
||||||
} else if !sm.is_multiline(self.prev_token.span.until(self.token.span)) {
|
} else if !sm.is_multiline(self.prev_token.span.until(self.token.span)) {
|
||||||
// The current token is in the same line as the prior token, not recoverable.
|
// The current token is in the same line as the prior token, not recoverable.
|
||||||
|
|
|
@ -1373,7 +1373,7 @@ impl<'a> Parser<'a> {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses an optional `move` prefix to a closure lke construct.
|
/// Parses an optional `move` prefix to a closure-like construct.
|
||||||
fn parse_capture_clause(&mut self) -> CaptureBy {
|
fn parse_capture_clause(&mut self) -> CaptureBy {
|
||||||
if self.eat_keyword(kw::Move) { CaptureBy::Value } else { CaptureBy::Ref }
|
if self.eat_keyword(kw::Move) { CaptureBy::Value } else { CaptureBy::Ref }
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
|
||||||
|
|
||||||
// Ordinarily, we can rely on the visit order of HIR intravisit
|
// Ordinarily, we can rely on the visit order of HIR intravisit
|
||||||
// to correspond to the actual execution order of statements.
|
// to correspond to the actual execution order of statements.
|
||||||
// However, there's a weird corner case with compund assignment
|
// However, there's a weird corner case with compound assignment
|
||||||
// operators (e.g. `a += b`). The evaluation order depends on whether
|
// operators (e.g. `a += b`). The evaluation order depends on whether
|
||||||
// or not the operator is overloaded (e.g. whether or not a trait
|
// or not the operator is overloaded (e.g. whether or not a trait
|
||||||
// like AddAssign is implemented).
|
// like AddAssign is implemented).
|
||||||
|
|
|
@ -655,7 +655,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(#44232): the `used_features` table no longer exists, so we
|
// FIXME(#44232): the `used_features` table no longer exists, so we
|
||||||
// don't lint about unused features. We should reenable this one day!
|
// don't lint about unused features. We should re-enable this one day!
|
||||||
}
|
}
|
||||||
|
|
||||||
fn unnecessary_stable_feature_lint(tcx: TyCtxt<'_>, span: Span, feature: Symbol, since: Symbol) {
|
fn unnecessary_stable_feature_lint(tcx: TyCtxt<'_>, span: Span, feature: Symbol, since: Symbol) {
|
||||||
|
|
|
@ -1090,7 +1090,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort extern crate names in reverse order to get
|
// Sort extern crate names in reverse order to get
|
||||||
// 1) some consistent ordering for emitted dignostics, and
|
// 1) some consistent ordering for emitted diagnostics, and
|
||||||
// 2) `std` suggestions before `core` suggestions.
|
// 2) `std` suggestions before `core` suggestions.
|
||||||
let mut extern_crate_names =
|
let mut extern_crate_names =
|
||||||
self.r.extern_prelude.iter().map(|(ident, _)| ident.name).collect::<Vec<_>>();
|
self.r.extern_prelude.iter().map(|(ident, _)| ident.name).collect::<Vec<_>>();
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
||||||
// single import (see test `issue-55884-2.rs`). In theory single imports should
|
// single import (see test `issue-55884-2.rs`). In theory single imports should
|
||||||
// always block globs, even if they are not yet resolved, so that this kind of
|
// always block globs, even if they are not yet resolved, so that this kind of
|
||||||
// self-inconsistent resolution never happens.
|
// self-inconsistent resolution never happens.
|
||||||
// Reenable the assert when the issue is fixed.
|
// Re-enable the assert when the issue is fixed.
|
||||||
// assert!(result[ns].get().is_err());
|
// assert!(result[ns].get().is_err());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ impl<'a, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
|
||||||
let prev = replace(&mut self.diagnostic_metadata.currently_processing_generics, true);
|
let prev = replace(&mut self.diagnostic_metadata.currently_processing_generics, true);
|
||||||
match arg {
|
match arg {
|
||||||
GenericArg::Type(ref ty) => {
|
GenericArg::Type(ref ty) => {
|
||||||
// We parse const arguments as path types as we cannot distiguish them during
|
// We parse const arguments as path types as we cannot distinguish them during
|
||||||
// parsing. We try to resolve that ambiguity by attempting resolution the type
|
// parsing. We try to resolve that ambiguity by attempting resolution the type
|
||||||
// namespace first, and if that fails we try again in the value namespace. If
|
// namespace first, and if that fails we try again in the value namespace. If
|
||||||
// resolution in the value namespace succeeds, we have an generic const argument on
|
// resolution in the value namespace succeeds, we have an generic const argument on
|
||||||
|
|
|
@ -540,7 +540,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
||||||
LifetimeName::Implicit => {
|
LifetimeName::Implicit => {
|
||||||
// For types like `dyn Foo`, we should
|
// For types like `dyn Foo`, we should
|
||||||
// generate a special form of elided.
|
// generate a special form of elided.
|
||||||
span_bug!(ty.span, "object-lifetime-default expected, not implict",);
|
span_bug!(ty.span, "object-lifetime-default expected, not implicit",);
|
||||||
}
|
}
|
||||||
LifetimeName::ImplicitObjectLifetimeDefault => {
|
LifetimeName::ImplicitObjectLifetimeDefault => {
|
||||||
// If the user does not write *anything*, we
|
// If the user does not write *anything*, we
|
||||||
|
|
|
@ -365,11 +365,11 @@ impl<'a, Ty> TyLayout<'a, Ty> {
|
||||||
//
|
//
|
||||||
// NB: for all tagged `enum`s (which include all non-C-like
|
// NB: for all tagged `enum`s (which include all non-C-like
|
||||||
// `enum`s with defined FFI representation), this will
|
// `enum`s with defined FFI representation), this will
|
||||||
// match the homogenous computation on the equivalent
|
// match the homogeneous computation on the equivalent
|
||||||
// `struct { tag; union { variant1; ... } }` and/or
|
// `struct { tag; union { variant1; ... } }` and/or
|
||||||
// `union { struct { tag; variant1; } ... }`
|
// `union { struct { tag; variant1; } ... }`
|
||||||
// (the offsets of variant fields should be identical
|
// (the offsets of variant fields should be identical
|
||||||
// between the two for either to be a homogenous aggregate).
|
// between the two for either to be a homogeneous aggregate).
|
||||||
let variant_start = total;
|
let variant_start = total;
|
||||||
for variant_idx in variants.indices() {
|
for variant_idx in variants.indices() {
|
||||||
let (variant_result, variant_total) =
|
let (variant_result, variant_total) =
|
||||||
|
@ -542,7 +542,7 @@ pub struct FnAbi<'a, Ty> {
|
||||||
/// The count of non-variadic arguments.
|
/// The count of non-variadic arguments.
|
||||||
///
|
///
|
||||||
/// Should only be different from args.len() when c_variadic is true.
|
/// Should only be different from args.len() when c_variadic is true.
|
||||||
/// This can be used to know wether an argument is variadic or not.
|
/// This can be used to know whether an argument is variadic or not.
|
||||||
pub fixed_count: usize,
|
pub fixed_count: usize,
|
||||||
|
|
||||||
pub conv: Conv,
|
pub conv: Conv,
|
||||||
|
|
|
@ -401,7 +401,7 @@ impl Align {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A pair of aligments, ABI-mandated and preferred.
|
/// A pair of alignments, ABI-mandated and preferred.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
#[derive(HashStable_Generic)]
|
#[derive(HashStable_Generic)]
|
||||||
pub struct AbiAndPrefAlign {
|
pub struct AbiAndPrefAlign {
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub fn target() -> TargetResult {
|
||||||
base.abi_return_struct_as_int = true;
|
base.abi_return_struct_as_int = true;
|
||||||
|
|
||||||
// Use -GNU here, because of the reason below:
|
// Use -GNU here, because of the reason below:
|
||||||
// Backgound and Problem:
|
// Background and Problem:
|
||||||
// If we use i686-unknown-windows, the LLVM IA32 MSVC generates compiler intrinsic
|
// If we use i686-unknown-windows, the LLVM IA32 MSVC generates compiler intrinsic
|
||||||
// _alldiv, _aulldiv, _allrem, _aullrem, _allmul, which will cause undefined symbol.
|
// _alldiv, _aulldiv, _allrem, _aullrem, _allmul, which will cause undefined symbol.
|
||||||
// A real issue is __aulldiv() is referred by __udivdi3() - udivmod_inner!(), from
|
// A real issue is __aulldiv() is referred by __udivdi3() - udivmod_inner!(), from
|
||||||
|
@ -64,7 +64,7 @@ pub fn target() -> TargetResult {
|
||||||
// i386/umoddi3.S
|
// i386/umoddi3.S
|
||||||
// Possible solution:
|
// Possible solution:
|
||||||
// 1. Eliminate Intrinsics generation.
|
// 1. Eliminate Intrinsics generation.
|
||||||
// 1.1 Choose differnt target to bypass isTargetKnownWindowsMSVC().
|
// 1.1 Choose different target to bypass isTargetKnownWindowsMSVC().
|
||||||
// 1.2 Remove the "Setup Windows compiler runtime calls" in LLVM
|
// 1.2 Remove the "Setup Windows compiler runtime calls" in LLVM
|
||||||
// 2. Implement Intrinsics.
|
// 2. Implement Intrinsics.
|
||||||
// We evaluated all options.
|
// We evaluated all options.
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub fn target() -> TargetResult {
|
||||||
// The linker can be installed from `crates.io`.
|
// The linker can be installed from `crates.io`.
|
||||||
linker: Some("rust-ptx-linker".to_string()),
|
linker: Some("rust-ptx-linker".to_string()),
|
||||||
|
|
||||||
// With `ptx-linker` approach, it can be later overriden via link flags.
|
// With `ptx-linker` approach, it can be later overridden via link flags.
|
||||||
cpu: "sm_30".to_string(),
|
cpu: "sm_30".to_string(),
|
||||||
|
|
||||||
// FIXME: create tests for the atomics.
|
// FIXME: create tests for the atomics.
|
||||||
|
@ -43,7 +43,7 @@ pub fn target() -> TargetResult {
|
||||||
// Let the `ptx-linker` to handle LLVM lowering into MC / assembly.
|
// Let the `ptx-linker` to handle LLVM lowering into MC / assembly.
|
||||||
obj_is_bitcode: true,
|
obj_is_bitcode: true,
|
||||||
|
|
||||||
// Convinient and predicable naming scheme.
|
// Convenient and predicable naming scheme.
|
||||||
dll_prefix: "".to_string(),
|
dll_prefix: "".to_string(),
|
||||||
dll_suffix: ".ptx".to_string(),
|
dll_suffix: ".ptx".to_string(),
|
||||||
exe_suffix: ".ptx".to_string(),
|
exe_suffix: ".ptx".to_string(),
|
||||||
|
|
|
@ -661,7 +661,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
/// Given the type/lifetime/const arguments provided to some path (along with
|
/// Given the type/lifetime/const arguments provided to some path (along with
|
||||||
/// an implicit `Self`, if this is a trait reference), returns the complete
|
/// an implicit `Self`, if this is a trait reference), returns the complete
|
||||||
/// set of substitutions. This may involve applying defaulted type parameters.
|
/// set of substitutions. This may involve applying defaulted type parameters.
|
||||||
/// Also returns back constriants on associated types.
|
/// Also returns back constraints on associated types.
|
||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
|
@ -2924,7 +2924,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
|
|
||||||
let tcx = self.tcx();
|
let tcx = self.tcx();
|
||||||
|
|
||||||
// We proactively collect all the infered type params to emit a single error per fn def.
|
// We proactively collect all the inferred type params to emit a single error per fn def.
|
||||||
let mut visitor = PlaceholderHirTyCollector::default();
|
let mut visitor = PlaceholderHirTyCollector::default();
|
||||||
for ty in decl.inputs {
|
for ty in decl.inputs {
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
|
|
|
@ -1040,7 +1040,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("pick: actual search failed, assemble diagnotics");
|
debug!("pick: actual search failed, assemble diagnostics");
|
||||||
|
|
||||||
let static_candidates = mem::take(&mut self.static_candidates);
|
let static_candidates = mem::take(&mut self.static_candidates);
|
||||||
let private_candidate = self.private_candidate.take();
|
let private_candidate = self.private_candidate.take();
|
||||||
|
|
|
@ -457,7 +457,7 @@ pub enum Diverges {
|
||||||
/// where all arms diverge), we may be
|
/// where all arms diverge), we may be
|
||||||
/// able to provide a more informative
|
/// able to provide a more informative
|
||||||
/// message to the user.
|
/// message to the user.
|
||||||
/// If this is `None`, a default messsage
|
/// If this is `None`, a default message
|
||||||
/// will be generated, which is suitable
|
/// will be generated, which is suitable
|
||||||
/// for most cases.
|
/// for most cases.
|
||||||
custom_note: Option<&'static str>,
|
custom_note: Option<&'static str>,
|
||||||
|
@ -896,7 +896,7 @@ where
|
||||||
ty::Opaque(def_id, substs) => {
|
ty::Opaque(def_id, substs) => {
|
||||||
debug!("fixup_opaque_types: found type {:?}", ty);
|
debug!("fixup_opaque_types: found type {:?}", ty);
|
||||||
// Here, we replace any inference variables that occur within
|
// Here, we replace any inference variables that occur within
|
||||||
// the substs of an opaque type. By definition, any type occuring
|
// the substs of an opaque type. By definition, any type occurring
|
||||||
// in the substs has a corresponding generic parameter, which is what
|
// in the substs has a corresponding generic parameter, which is what
|
||||||
// we replace it with.
|
// we replace it with.
|
||||||
// This replacement is only run on the function signature, so any
|
// This replacement is only run on the function signature, so any
|
||||||
|
@ -1937,7 +1937,7 @@ fn check_specialization_validity<'tcx>(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// If `opt_result` is `None`, we have only encoutered `default impl`s that don't contain the
|
// If `opt_result` is `None`, we have only encountered `default impl`s that don't contain the
|
||||||
// item. This is allowed, the item isn't actually getting specialized here.
|
// item. This is allowed, the item isn't actually getting specialized here.
|
||||||
let result = opt_result.unwrap_or(Ok(()));
|
let result = opt_result.unwrap_or(Ok(()));
|
||||||
|
|
||||||
|
@ -3452,7 +3452,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
// }
|
// }
|
||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
// In the above snippet, the inference varaible created by
|
// In the above snippet, the inference variable created by
|
||||||
// instantiating `Option<Foo>` will be completely unconstrained.
|
// instantiating `Option<Foo>` will be completely unconstrained.
|
||||||
// We treat this as a non-defining use by making the inference
|
// We treat this as a non-defining use by making the inference
|
||||||
// variable fall back to the opaque type itself.
|
// variable fall back to the opaque type itself.
|
||||||
|
|
|
@ -98,7 +98,7 @@ const INITIAL_BM: BindingMode = BindingMode::BindByValue(hir::Mutability::Not);
|
||||||
enum AdjustMode {
|
enum AdjustMode {
|
||||||
/// Peel off all immediate reference types.
|
/// Peel off all immediate reference types.
|
||||||
Peel,
|
Peel,
|
||||||
/// Reset binding mode to the inital mode.
|
/// Reset binding mode to the initial mode.
|
||||||
Reset,
|
Reset,
|
||||||
/// Pass on the input binding mode and expected type.
|
/// Pass on the input binding mode and expected type.
|
||||||
Pass,
|
Pass,
|
||||||
|
@ -841,7 +841,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
// N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
|
// N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
|
||||||
// with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
|
// with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
|
||||||
let missing_parenthesis = match (&expected.kind, fields, had_err) {
|
let missing_parenthesis = match (&expected.kind, fields, had_err) {
|
||||||
// #67037: only do this if we could sucessfully type-check the expected type against
|
// #67037: only do this if we could successfully type-check the expected type against
|
||||||
// the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
|
// the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
|
||||||
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
|
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
|
||||||
(ty::Adt(_, substs), [field], false) => {
|
(ty::Adt(_, substs), [field], false) => {
|
||||||
|
|
|
@ -174,7 +174,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
|
||||||
// impl !Send for (A, B) { }
|
// impl !Send for (A, B) { }
|
||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
// This final impl is legal according to the orpan
|
// This final impl is legal according to the orphan
|
||||||
// rules, but it invalidates the reasoning from
|
// rules, but it invalidates the reasoning from
|
||||||
// `two_foos` above.
|
// `two_foos` above.
|
||||||
debug!(
|
debug!(
|
||||||
|
|
|
@ -1395,7 +1395,7 @@ fn are_suggestable_generic_args(generic_args: &[hir::GenericArg<'_>]) -> bool {
|
||||||
.any(is_suggestable_infer_ty)
|
.any(is_suggestable_infer_ty)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether `ty` is a type with `_` placeholders that can be infered. Used in diagnostics only to
|
/// Whether `ty` is a type with `_` placeholders that can be inferred. Used in diagnostics only to
|
||||||
/// use inference to provide suggestions for the appropriate type if possible.
|
/// use inference to provide suggestions for the appropriate type if possible.
|
||||||
fn is_suggestable_infer_ty(ty: &hir::Ty<'_>) -> bool {
|
fn is_suggestable_infer_ty(ty: &hir::Ty<'_>) -> bool {
|
||||||
use hir::TyKind::*;
|
use hir::TyKind::*;
|
||||||
|
|
|
@ -493,7 +493,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
|
||||||
// Writing a projection trait bound of the form
|
// Writing a projection trait bound of the form
|
||||||
// <T as Trait>::Name : ?Sized
|
// <T as Trait>::Name : ?Sized
|
||||||
// is illegal, because ?Sized bounds can only
|
// is illegal, because ?Sized bounds can only
|
||||||
// be written in the (here, nonexistant) definition
|
// be written in the (here, nonexistent) definition
|
||||||
// of the type.
|
// of the type.
|
||||||
// Therefore, we make sure that we never add a ?Sized
|
// Therefore, we make sure that we never add a ?Sized
|
||||||
// bound for projections
|
// bound for projections
|
||||||
|
|
|
@ -135,7 +135,7 @@ trait Writer {
|
||||||
fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()>;
|
fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implement `Writer` for anthing that can be written to, this just implements
|
// Implement `Writer` for anything that can be written to, this just implements
|
||||||
// the default rustdoc behaviour.
|
// the default rustdoc behaviour.
|
||||||
impl<U: Write> Writer for U {
|
impl<U: Write> Writer for U {
|
||||||
fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()> {
|
fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()> {
|
||||||
|
|
|
@ -3601,7 +3601,7 @@ fn render_impl(
|
||||||
use_absolute: Option<bool>,
|
use_absolute: Option<bool>,
|
||||||
is_on_foreign_type: bool,
|
is_on_foreign_type: bool,
|
||||||
show_default_items: bool,
|
show_default_items: bool,
|
||||||
// This argument is used to reference same type with different pathes to avoid duplication
|
// This argument is used to reference same type with different paths to avoid duplication
|
||||||
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
|
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
|
||||||
aliases: &[String],
|
aliases: &[String],
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -651,7 +651,7 @@ impl Ipv4Addr {
|
||||||
|
|
||||||
/// Returns [`true`] if this address is reserved by IANA for future use. [IETF RFC 1112]
|
/// Returns [`true`] if this address is reserved by IANA for future use. [IETF RFC 1112]
|
||||||
/// defines the block of reserved addresses as `240.0.0.0/4`. This range normally includes the
|
/// defines the block of reserved addresses as `240.0.0.0/4`. This range normally includes the
|
||||||
/// broadcast address `255.255.255.255`, but this implementation explicitely excludes it, since
|
/// broadcast address `255.255.255.255`, but this implementation explicitly excludes it, since
|
||||||
/// it is obviously not reserved for future use.
|
/// it is obviously not reserved for future use.
|
||||||
///
|
///
|
||||||
/// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112
|
/// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112
|
||||||
|
|
|
@ -34,7 +34,7 @@ pub trait MetadataExt {
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
||||||
#[rustc_deprecated(since = "1.8.0", reason = "other methods of this trait are now prefered")]
|
#[rustc_deprecated(since = "1.8.0", reason = "other methods of this trait are now preferred")]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
fn as_raw_stat(&self) -> &raw::stat;
|
fn as_raw_stat(&self) -> &raw::stat;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct Consumer<T, Addition> {
|
||||||
tail: UnsafeCell<*mut Node<T>>, // where to pop from
|
tail: UnsafeCell<*mut Node<T>>, // where to pop from
|
||||||
tail_prev: AtomicPtr<Node<T>>, // where to pop from
|
tail_prev: AtomicPtr<Node<T>>, // where to pop from
|
||||||
cache_bound: usize, // maximum cache size
|
cache_bound: usize, // maximum cache size
|
||||||
cached_nodes: AtomicUsize, // number of nodes marked as cachable
|
cached_nodes: AtomicUsize, // number of nodes marked as cacheable
|
||||||
addition: Addition,
|
addition: Addition,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue