mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 19:47:38 +00:00
Auto merge of #70330 - Centril:rollup-ts0clvx, r=Centril
Rollup of 9 pull requests Successful merges: - #68700 (Add Wake trait for safe construction of Wakers.) - #69494 (Stabilize --crate-version option in rustdoc) - #70080 (rustc_mir: remove extra space when pretty-printing MIR.) - #70195 (Add test for issue #53275) - #70199 (Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.) - #70299 (add err_machine_stop macro) - #70300 (Reword unused variable warning) - #70315 (Rename remaining occurences of Void to Opaque.) - #70318 (Split long derive lists into two derive attributes.) Failed merges: r? @ghost
This commit is contained in:
commit
1edd389cc4
@ -52,12 +52,7 @@ fn main() {
|
|||||||
// Bootstrap's Cargo-command builder sets this variable to the current Rust version; let's pick
|
// Bootstrap's Cargo-command builder sets this variable to the current Rust version; let's pick
|
||||||
// it up so we can make rustdoc print this into the docs
|
// it up so we can make rustdoc print this into the docs
|
||||||
if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") {
|
if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") {
|
||||||
// This "unstable-options" can be removed when `--crate-version` is stabilized
|
|
||||||
if !has_unstable {
|
|
||||||
cmd.arg("-Z").arg("unstable-options");
|
|
||||||
}
|
|
||||||
cmd.arg("--crate-version").arg(version);
|
cmd.arg("--crate-version").arg(version);
|
||||||
has_unstable = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needed to be able to run all rustdoc tests.
|
// Needed to be able to run all rustdoc tests.
|
||||||
|
@ -313,6 +313,9 @@ impl Step for Standalone {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut cmd = builder.rustdoc_cmd(compiler);
|
let mut cmd = builder.rustdoc_cmd(compiler);
|
||||||
|
// Needed for --index-page flag
|
||||||
|
cmd.arg("-Z").arg("unstable-options");
|
||||||
|
|
||||||
cmd.arg("--html-after-content")
|
cmd.arg("--html-after-content")
|
||||||
.arg(&footer)
|
.arg(&footer)
|
||||||
.arg("--html-before-content")
|
.arg("--html-before-content")
|
||||||
@ -395,7 +398,7 @@ impl Step for Std {
|
|||||||
|
|
||||||
// Keep a whitelist so we do not build internal stdlib crates, these will be
|
// Keep a whitelist so we do not build internal stdlib crates, these will be
|
||||||
// build by the rustc step later if enabled.
|
// build by the rustc step later if enabled.
|
||||||
cargo.arg("-Z").arg("unstable-options").arg("-p").arg(package);
|
cargo.arg("-p").arg(package);
|
||||||
// Create all crate output directories first to make sure rustdoc uses
|
// Create all crate output directories first to make sure rustdoc uses
|
||||||
// relative links.
|
// relative links.
|
||||||
// FIXME: Cargo should probably do this itself.
|
// FIXME: Cargo should probably do this itself.
|
||||||
@ -406,6 +409,8 @@ impl Step for Std {
|
|||||||
.arg("rust.css")
|
.arg("rust.css")
|
||||||
.arg("--markdown-no-toc")
|
.arg("--markdown-no-toc")
|
||||||
.arg("--generate-redirect-pages")
|
.arg("--generate-redirect-pages")
|
||||||
|
.arg("-Z")
|
||||||
|
.arg("unstable-options")
|
||||||
.arg("--resource-suffix")
|
.arg("--resource-suffix")
|
||||||
.arg(crate::channel::CFG_RELEASE_NUM)
|
.arg(crate::channel::CFG_RELEASE_NUM)
|
||||||
.arg("--index-page")
|
.arg("--index-page")
|
||||||
|
@ -168,7 +168,7 @@ Diagnostics have the following format:
|
|||||||
"rendered": null
|
"rendered": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "consider prefixing with an underscore",
|
"message": "if this is intentional, prefix it with an underscore",
|
||||||
"code": null,
|
"code": null,
|
||||||
"level": "help",
|
"level": "help",
|
||||||
"spans": [
|
"spans": [
|
||||||
@ -201,7 +201,7 @@ Diagnostics have the following format:
|
|||||||
/* Optional string of the rendered version of the diagnostic as displayed
|
/* Optional string of the rendered version of the diagnostic as displayed
|
||||||
by rustc. Note that this may be influenced by the `--json` flag.
|
by rustc. Note that this may be influenced by the `--json` flag.
|
||||||
*/
|
*/
|
||||||
"rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n |\n2 | let x = 123;\n | ^ help: consider prefixing with an underscore: `_x`\n |\n = note: `#[warn(unused_variables)]` on by default\n\n"
|
"rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n |\n2 | let x = 123;\n | ^ help: if this is intentional, prefix it with an underscore: `_x`\n |\n = note: `#[warn(unused_variables)]` on by default\n\n"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -390,3 +390,15 @@ the same CSS rules as the official `light` theme.
|
|||||||
`--check-theme` is a separate mode in `rustdoc`. When `rustdoc` sees the
|
`--check-theme` is a separate mode in `rustdoc`. When `rustdoc` sees the
|
||||||
`--check-theme` flag, it discards all other flags and only performs the CSS rule
|
`--check-theme` flag, it discards all other flags and only performs the CSS rule
|
||||||
comparison operation.
|
comparison operation.
|
||||||
|
|
||||||
|
### `--crate-version`: control the crate version
|
||||||
|
|
||||||
|
Using this flag looks like this:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ rustdoc src/lib.rs --crate-version 1.3.37
|
||||||
|
```
|
||||||
|
|
||||||
|
When `rustdoc` receives this flag, it will print an extra "Version (version)" into the sidebar of
|
||||||
|
the crate root's docs. You can use this flag to differentiate between different versions of your
|
||||||
|
library's documentation.
|
||||||
|
@ -248,18 +248,6 @@ Markdown file, the URL given to `--markdown-playground-url` will take precedence
|
|||||||
`--playground-url` and `#![doc(html_playground_url = "url")]` are present when rendering crate docs,
|
`--playground-url` and `#![doc(html_playground_url = "url")]` are present when rendering crate docs,
|
||||||
the attribute will take precedence.
|
the attribute will take precedence.
|
||||||
|
|
||||||
### `--crate-version`: control the crate version
|
|
||||||
|
|
||||||
Using this flag looks like this:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ rustdoc src/lib.rs -Z unstable-options --crate-version 1.3.37
|
|
||||||
```
|
|
||||||
|
|
||||||
When `rustdoc` receives this flag, it will print an extra "Version (version)" into the sidebar of
|
|
||||||
the crate root's docs. You can use this flag to differentiate between different versions of your
|
|
||||||
library's documentation.
|
|
||||||
|
|
||||||
### `--sort-modules-by-appearance`: control how items on module pages are sorted
|
### `--sort-modules-by-appearance`: control how items on module pages are sorted
|
||||||
|
|
||||||
Using this flag looks like this:
|
Using this flag looks like this:
|
||||||
|
@ -161,6 +161,8 @@ pub mod str;
|
|||||||
pub mod string;
|
pub mod string;
|
||||||
#[cfg(target_has_atomic = "ptr")]
|
#[cfg(target_has_atomic = "ptr")]
|
||||||
pub mod sync;
|
pub mod sync;
|
||||||
|
#[cfg(target_has_atomic = "ptr")]
|
||||||
|
pub mod task;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
pub mod vec;
|
pub mod vec;
|
||||||
|
87
src/liballoc/task.rs
Normal file
87
src/liballoc/task.rs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#![unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
//! Types and Traits for working with asynchronous tasks.
|
||||||
|
use core::mem::{self, ManuallyDrop};
|
||||||
|
use core::task::{RawWaker, RawWakerVTable, Waker};
|
||||||
|
|
||||||
|
use crate::sync::Arc;
|
||||||
|
|
||||||
|
/// The implementation of waking a task on an executor.
|
||||||
|
///
|
||||||
|
/// This trait can be used to create a [`Waker`]. An executor can define an
|
||||||
|
/// implementation of this trait, and use that to construct a Waker to pass
|
||||||
|
/// to the tasks that are executed on that executor.
|
||||||
|
///
|
||||||
|
/// This trait is a memory-safe and ergonomic alternative to constructing a
|
||||||
|
/// [`RawWaker`]. It supports the common executor design in which the data
|
||||||
|
/// used to wake up a task is stored in an [`Arc`]. Some executors (especially
|
||||||
|
/// those for embedded systems) cannot use this API, which is why [`RawWaker`]
|
||||||
|
/// exists as an alternative for those systems.
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
pub trait Wake {
|
||||||
|
/// Wake this task.
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
fn wake(self: Arc<Self>);
|
||||||
|
|
||||||
|
/// Wake this task without consuming the waker.
|
||||||
|
///
|
||||||
|
/// If an executor supports a cheaper way to wake without consuming the
|
||||||
|
/// waker, it should override this method. By default, it clones the
|
||||||
|
/// [`Arc`] and calls `wake` on the clone.
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
fn wake_by_ref(self: &Arc<Self>) {
|
||||||
|
self.clone().wake();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
impl<W: Wake + Send + Sync + 'static> From<Arc<W>> for Waker {
|
||||||
|
fn from(waker: Arc<W>) -> Waker {
|
||||||
|
// SAFETY: This is safe because raw_waker safely constructs
|
||||||
|
// a RawWaker from Arc<W>.
|
||||||
|
unsafe { Waker::from_raw(raw_waker(waker)) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
impl<W: Wake + Send + Sync + 'static> From<Arc<W>> for RawWaker {
|
||||||
|
fn from(waker: Arc<W>) -> RawWaker {
|
||||||
|
raw_waker(waker)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NB: This private function for constructing a RawWaker is used, rather than
|
||||||
|
// inlining this into the `From<Arc<W>> for RawWaker` impl, to ensure that
|
||||||
|
// the safety of `From<Arc<W>> for Waker` does not depend on the correct
|
||||||
|
// trait dispatch - instead both impls call this function directly and
|
||||||
|
// explicitly.
|
||||||
|
#[inline(always)]
|
||||||
|
fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
|
||||||
|
// Increment the reference count of the arc to clone it.
|
||||||
|
unsafe fn clone_waker<W: Wake + Send + Sync + 'static>(waker: *const ()) -> RawWaker {
|
||||||
|
let waker: Arc<W> = Arc::from_raw(waker as *const W);
|
||||||
|
mem::forget(Arc::clone(&waker));
|
||||||
|
raw_waker(waker)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wake by value, moving the Arc into the Wake::wake function
|
||||||
|
unsafe fn wake<W: Wake + Send + Sync + 'static>(waker: *const ()) {
|
||||||
|
let waker: Arc<W> = Arc::from_raw(waker as *const W);
|
||||||
|
<W as Wake>::wake(waker);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wake by reference, wrap the waker in ManuallyDrop to avoid dropping it
|
||||||
|
unsafe fn wake_by_ref<W: Wake + Send + Sync + 'static>(waker: *const ()) {
|
||||||
|
let waker: ManuallyDrop<Arc<W>> = ManuallyDrop::new(Arc::from_raw(waker as *const W));
|
||||||
|
<W as Wake>::wake_by_ref(&waker);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decrement the reference count of the Arc on drop
|
||||||
|
unsafe fn drop_waker<W: Wake + Send + Sync + 'static>(waker: *const ()) {
|
||||||
|
mem::drop(Arc::from_raw(waker as *const W));
|
||||||
|
}
|
||||||
|
|
||||||
|
RawWaker::new(
|
||||||
|
Arc::into_raw(waker) as *const (),
|
||||||
|
&RawWakerVTable::new(clone_waker::<W>, wake::<W>, wake_by_ref::<W>, drop_waker::<W>),
|
||||||
|
)
|
||||||
|
}
|
@ -282,10 +282,10 @@ impl<'a> ArgumentV1<'a> {
|
|||||||
// SAFETY: `mem::transmute(x)` is safe because
|
// SAFETY: `mem::transmute(x)` is safe because
|
||||||
// 1. `&'b T` keeps the lifetime it originated with `'b`
|
// 1. `&'b T` keeps the lifetime it originated with `'b`
|
||||||
// (so as to not have an unbounded lifetime)
|
// (so as to not have an unbounded lifetime)
|
||||||
// 2. `&'b T` and `&'b Void` have the same memory layout
|
// 2. `&'b T` and `&'b Opaque` have the same memory layout
|
||||||
// (when `T` is `Sized`, as it is here)
|
// (when `T` is `Sized`, as it is here)
|
||||||
// `mem::transmute(f)` is safe since `fn(&T, &mut Formatter<'_>) -> Result`
|
// `mem::transmute(f)` is safe since `fn(&T, &mut Formatter<'_>) -> Result`
|
||||||
// and `fn(&Void, &mut Formatter<'_>) -> Result` have the same ABI
|
// and `fn(&Opaque, &mut Formatter<'_>) -> Result` have the same ABI
|
||||||
// (as long as `T` is `Sized`)
|
// (as long as `T` is `Sized`)
|
||||||
unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } }
|
unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } }
|
||||||
}
|
}
|
||||||
|
@ -489,19 +489,8 @@ impl<'tcx> DepNodeParams<'tcx> for HirId {
|
|||||||
/// some independent path or string that persists between runs without
|
/// some independent path or string that persists between runs without
|
||||||
/// the need to be mapped or unmapped. (This ensures we can serialize
|
/// the need to be mapped or unmapped. (This ensures we can serialize
|
||||||
/// them even in the absence of a tcx.)
|
/// them even in the absence of a tcx.)
|
||||||
#[derive(
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct WorkProductId {
|
pub struct WorkProductId {
|
||||||
hash: Fingerprint,
|
hash: Fingerprint,
|
||||||
}
|
}
|
||||||
|
@ -40,18 +40,8 @@ impl CrateSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Debug)]
|
||||||
RustcEncodable,
|
#[derive(HashStable)]
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Debug,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum DepKind {
|
pub enum DepKind {
|
||||||
/// A dependency that is only used for its macros.
|
/// A dependency that is only used for its macros.
|
||||||
MacrosOnly,
|
MacrosOnly,
|
||||||
|
@ -80,18 +80,8 @@ use std::fmt;
|
|||||||
// placate the same deriving in `ty::FreeRegion`, but we may want to
|
// placate the same deriving in `ty::FreeRegion`, but we may want to
|
||||||
// actually attach a more meaningful ordering to scopes than the one
|
// actually attach a more meaningful ordering to scopes than the one
|
||||||
// generated via deriving here.
|
// generated via deriving here.
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Copy, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Eq,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Copy,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct Scope {
|
pub struct Scope {
|
||||||
pub id: hir::ItemLocalId,
|
pub id: hir::ItemLocalId,
|
||||||
pub data: ScopeData,
|
pub data: ScopeData,
|
||||||
@ -114,19 +104,8 @@ impl fmt::Debug for Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, Debug, Copy, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Eq,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
Copy,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum ScopeData {
|
pub enum ScopeData {
|
||||||
Node,
|
Node,
|
||||||
|
|
||||||
|
@ -15,18 +15,8 @@ use std::ops::{Deref, DerefMut, Range};
|
|||||||
|
|
||||||
// NOTE: When adding new fields, make sure to adjust the `Snapshot` impl in
|
// NOTE: When adding new fields, make sure to adjust the `Snapshot` impl in
|
||||||
// `src/librustc_mir/interpret/snapshot.rs`.
|
// `src/librustc_mir/interpret/snapshot.rs`.
|
||||||
#[derive(
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct Allocation<Tag = (), Extra = ()> {
|
pub struct Allocation<Tag = (), Extra = ()> {
|
||||||
/// The actual bytes of the allocation.
|
/// The actual bytes of the allocation.
|
||||||
/// Note that the bytes of a pointer represent the offset of the pointer.
|
/// Note that the bytes of a pointer represent the offset of the pointer.
|
||||||
@ -759,18 +749,8 @@ type Block = u64;
|
|||||||
|
|
||||||
/// A bitmask where each bit refers to the byte with the same index. If the bit is `true`, the byte
|
/// A bitmask where each bit refers to the byte with the same index. If the bit is `true`, the byte
|
||||||
/// is defined. If it is `false` the byte is undefined.
|
/// is defined. If it is `false` the byte is undefined.
|
||||||
#[derive(
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct UndefMask {
|
pub struct UndefMask {
|
||||||
blocks: Vec<Block>,
|
blocks: Vec<Block>,
|
||||||
len: Size,
|
len: Size,
|
||||||
|
@ -46,6 +46,13 @@ macro_rules! err_exhaust {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! err_machine_stop {
|
||||||
|
($($tt:tt)*) => {
|
||||||
|
$crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// In the `throw_*` macros, avoid `return` to make them work with `try {}`.
|
// In the `throw_*` macros, avoid `return` to make them work with `try {}`.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! throw_unsup {
|
macro_rules! throw_unsup {
|
||||||
@ -79,9 +86,7 @@ macro_rules! throw_exhaust {
|
|||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! throw_machine_stop {
|
macro_rules! throw_machine_stop {
|
||||||
($($tt:tt)*) => {
|
($($tt:tt)*) => { Err::<!, _>(err_machine_stop!($($tt)*))? };
|
||||||
Err::<!, _>($crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*)))?
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mod allocation;
|
mod allocation;
|
||||||
|
@ -111,18 +111,8 @@ impl<T: layout::HasDataLayout> PointerArithmetic for T {}
|
|||||||
///
|
///
|
||||||
/// `Pointer` is also generic over the `Tag` associated with each pointer,
|
/// `Pointer` is also generic over the `Tag` associated with each pointer,
|
||||||
/// which is used to do provenance tracking during execution.
|
/// which is used to do provenance tracking during execution.
|
||||||
#[derive(
|
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct Pointer<Tag = (), Id = AllocId> {
|
pub struct Pointer<Tag = (), Id = AllocId> {
|
||||||
pub alloc_id: Id,
|
pub alloc_id: Id,
|
||||||
pub offset: Size,
|
pub offset: Size,
|
||||||
|
@ -23,19 +23,8 @@ pub struct RawConst<'tcx> {
|
|||||||
|
|
||||||
/// Represents a constant value in Rust. `Scalar` and `Slice` are optimizations for
|
/// Represents a constant value in Rust. `Scalar` and `Slice` are optimizations for
|
||||||
/// array length computations, enum discriminants and the pattern matching logic.
|
/// array length computations, enum discriminants and the pattern matching logic.
|
||||||
#[derive(
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum ConstValue<'tcx> {
|
pub enum ConstValue<'tcx> {
|
||||||
/// Used only for types with `layout::abi::Scalar` ABI and ZSTs.
|
/// Used only for types with `layout::abi::Scalar` ABI and ZSTs.
|
||||||
///
|
///
|
||||||
@ -98,18 +87,8 @@ impl<'tcx> ConstValue<'tcx> {
|
|||||||
/// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 8 bytes in
|
/// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 8 bytes in
|
||||||
/// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes
|
/// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes
|
||||||
/// of a simple value or a pointer into another `Allocation`
|
/// of a simple value or a pointer into another `Allocation`
|
||||||
#[derive(
|
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum Scalar<Tag = (), Id = AllocId> {
|
pub enum Scalar<Tag = (), Id = AllocId> {
|
||||||
/// The raw bytes of a simple value.
|
/// The raw bytes of a simple value.
|
||||||
Raw {
|
Raw {
|
||||||
|
@ -69,18 +69,8 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
|
|||||||
/// The various "big phases" that MIR goes through.
|
/// The various "big phases" that MIR goes through.
|
||||||
///
|
///
|
||||||
/// Warning: ordering of variants is significant.
|
/// Warning: ordering of variants is significant.
|
||||||
#[derive(
|
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord
|
|
||||||
)]
|
|
||||||
pub enum MirPhase {
|
pub enum MirPhase {
|
||||||
Build = 0,
|
Build = 0,
|
||||||
Const = 1,
|
Const = 1,
|
||||||
@ -439,18 +429,8 @@ pub struct SourceInfo {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Borrow kinds
|
// Borrow kinds
|
||||||
|
|
||||||
#[derive(
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, RustcDecodable)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum BorrowKind {
|
pub enum BorrowKind {
|
||||||
/// Data must be immutable and is aliasable.
|
/// Data must be immutable and is aliasable.
|
||||||
Shared,
|
Shared,
|
||||||
|
@ -2642,19 +2642,8 @@ impl<'tcx> FieldDef {
|
|||||||
///
|
///
|
||||||
/// You can get the environment type of a closure using
|
/// You can get the environment type of a closure using
|
||||||
/// `tcx.closure_env_ty()`.
|
/// `tcx.closure_env_ty()`.
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum ClosureKind {
|
pub enum ClosureKind {
|
||||||
// Warning: Ordering is significant here! The ordering is chosen
|
// Warning: Ordering is significant here! The ordering is chosen
|
||||||
// because the trait Fn is a subtrait of FnMut and so in turn, and
|
// because the trait Fn is a subtrait of FnMut and so in turn, and
|
||||||
|
@ -31,38 +31,15 @@ use std::cmp::Ordering;
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable, TypeFoldable, Lift)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable,
|
|
||||||
TypeFoldable,
|
|
||||||
Lift
|
|
||||||
)]
|
|
||||||
pub struct TypeAndMut<'tcx> {
|
pub struct TypeAndMut<'tcx> {
|
||||||
pub ty: Ty<'tcx>,
|
pub ty: Ty<'tcx>,
|
||||||
pub mutbl: hir::Mutability,
|
pub mutbl: hir::Mutability,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Copy)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Eq,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
/// A "free" region `fr` can be interpreted as "some region
|
/// A "free" region `fr` can be interpreted as "some region
|
||||||
/// at least as big as the scope `fr.scope`".
|
/// at least as big as the scope `fr.scope`".
|
||||||
pub struct FreeRegion {
|
pub struct FreeRegion {
|
||||||
@ -70,18 +47,8 @@ pub struct FreeRegion {
|
|||||||
pub bound_region: BoundRegion,
|
pub bound_region: BoundRegion,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Copy)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Eq,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum BoundRegion {
|
pub enum BoundRegion {
|
||||||
/// An anonymous region parameter for a given fn (&T)
|
/// An anonymous region parameter for a given fn (&T)
|
||||||
BrAnon(u32),
|
BrAnon(u32),
|
||||||
@ -119,18 +86,8 @@ impl BoundRegion {
|
|||||||
|
|
||||||
/// N.B., if you change this, you'll probably want to change the corresponding
|
/// N.B., if you change this, you'll probably want to change the corresponding
|
||||||
/// AST structure in `librustc_ast/ast.rs` as well.
|
/// AST structure in `librustc_ast/ast.rs` as well.
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable,
|
|
||||||
Debug
|
|
||||||
)]
|
|
||||||
#[rustc_diagnostic_item = "TyKind"]
|
#[rustc_diagnostic_item = "TyKind"]
|
||||||
pub enum TyKind<'tcx> {
|
pub enum TyKind<'tcx> {
|
||||||
/// The primitive boolean type. Written as `bool`.
|
/// The primitive boolean type. Written as `bool`.
|
||||||
@ -1147,18 +1104,8 @@ impl<'tcx> PolyFnSig<'tcx> {
|
|||||||
|
|
||||||
pub type CanonicalPolyFnSig<'tcx> = Canonical<'tcx, Binder<FnSig<'tcx>>>;
|
pub type CanonicalPolyFnSig<'tcx> = Canonical<'tcx, Binder<FnSig<'tcx>>>;
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct ParamTy {
|
pub struct ParamTy {
|
||||||
pub index: u32,
|
pub index: u32,
|
||||||
pub name: Symbol,
|
pub name: Symbol,
|
||||||
@ -1182,18 +1129,8 @@ impl<'tcx> ParamTy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Copy, Clone, Hash, RustcEncodable, RustcDecodable, Eq, PartialEq, Ord, PartialOrd)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct ParamConst {
|
pub struct ParamConst {
|
||||||
pub index: u32,
|
pub index: u32,
|
||||||
pub name: Symbol,
|
pub name: Symbol,
|
||||||
@ -1465,18 +1402,8 @@ impl Atom for RegionVid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum InferTy {
|
pub enum InferTy {
|
||||||
TyVar(TyVid),
|
TyVar(TyVid),
|
||||||
IntVar(IntVid),
|
IntVar(IntVid),
|
||||||
@ -1494,37 +1421,15 @@ rustc_index::newtype_index! {
|
|||||||
pub struct BoundVar { .. }
|
pub struct BoundVar { .. }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct BoundTy {
|
pub struct BoundTy {
|
||||||
pub var: BoundVar,
|
pub var: BoundVar,
|
||||||
pub kind: BoundTyKind,
|
pub kind: BoundTyKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Clone,
|
#[derive(HashStable)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum BoundTyKind {
|
pub enum BoundTyKind {
|
||||||
Anon,
|
Anon,
|
||||||
Param(Symbol),
|
Param(Symbol),
|
||||||
@ -2358,19 +2263,8 @@ impl<'tcx> TyS<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Typed constant value.
|
/// Typed constant value.
|
||||||
#[derive(
|
#[derive(Copy, Clone, Debug, Hash, RustcEncodable, RustcDecodable, Eq, PartialEq, Ord, PartialOrd)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub struct Const<'tcx> {
|
pub struct Const<'tcx> {
|
||||||
pub ty: Ty<'tcx>,
|
pub ty: Ty<'tcx>,
|
||||||
|
|
||||||
@ -2499,19 +2393,8 @@ impl<'tcx> Const<'tcx> {
|
|||||||
impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {}
|
impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {}
|
||||||
|
|
||||||
/// Represents a constant in Rust.
|
/// Represents a constant in Rust.
|
||||||
#[derive(
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum ConstKind<'tcx> {
|
pub enum ConstKind<'tcx> {
|
||||||
/// A const generic parameter.
|
/// A const generic parameter.
|
||||||
Param(ParamConst),
|
Param(ParamConst),
|
||||||
@ -2549,19 +2432,8 @@ impl<'tcx> ConstKind<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An inference variable for a const, for use in const generics.
|
/// An inference variable for a const, for use in const generics.
|
||||||
#[derive(
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
|
||||||
Copy,
|
#[derive(HashStable)]
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
HashStable
|
|
||||||
)]
|
|
||||||
pub enum InferConst<'tcx> {
|
pub enum InferConst<'tcx> {
|
||||||
/// Infer the value of the const.
|
/// Infer the value of the const.
|
||||||
Var(ConstVid<'tcx>),
|
Var(ConstVid<'tcx>),
|
||||||
|
@ -684,19 +684,8 @@ pub enum PatKind {
|
|||||||
MacCall(MacCall),
|
MacCall(MacCall),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Debug,
|
|
||||||
Copy,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum Mutability {
|
pub enum Mutability {
|
||||||
Mut,
|
Mut,
|
||||||
Not,
|
Not,
|
||||||
@ -1321,19 +1310,8 @@ pub enum CaptureBy {
|
|||||||
|
|
||||||
/// The movability of a generator / closure literal:
|
/// The movability of a generator / closure literal:
|
||||||
/// whether a generator contains self-references, causing it to be `!Unpin`.
|
/// whether a generator contains self-references, causing it to be `!Unpin`.
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug, Copy)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Debug,
|
|
||||||
Copy,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum Movability {
|
pub enum Movability {
|
||||||
/// May contain self-references, `!Unpin`.
|
/// May contain self-references, `!Unpin`.
|
||||||
Static,
|
Static,
|
||||||
@ -1614,19 +1592,8 @@ pub struct FnSig {
|
|||||||
pub decl: P<FnDecl>,
|
pub decl: P<FnDecl>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Debug
|
|
||||||
)]
|
|
||||||
pub enum FloatTy {
|
pub enum FloatTy {
|
||||||
F32,
|
F32,
|
||||||
F64,
|
F64,
|
||||||
@ -1655,19 +1622,8 @@ impl FloatTy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Debug)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Debug
|
|
||||||
)]
|
|
||||||
pub enum IntTy {
|
pub enum IntTy {
|
||||||
Isize,
|
Isize,
|
||||||
I8,
|
I8,
|
||||||
@ -1731,19 +1687,8 @@ impl IntTy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Copy, Debug)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
Debug
|
|
||||||
)]
|
|
||||||
pub enum UintTy {
|
pub enum UintTy {
|
||||||
Usize,
|
Usize,
|
||||||
U8,
|
U8,
|
||||||
|
@ -120,17 +120,8 @@ pub fn find_unwind_attr(diagnostic: Option<&Handler>, attrs: &[Attribute]) -> Op
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Represents the #[stable], #[unstable], #[rustc_deprecated] attributes.
|
/// Represents the #[stable], #[unstable], #[rustc_deprecated] attributes.
|
||||||
#[derive(
|
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
RustcEncodable,
|
#[derive(HashStable_Generic)]
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub struct Stability {
|
pub struct Stability {
|
||||||
pub level: StabilityLevel,
|
pub level: StabilityLevel,
|
||||||
pub feature: Symbol,
|
pub feature: Symbol,
|
||||||
@ -138,17 +129,8 @@ pub struct Stability {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Represents the #[rustc_const_unstable] and #[rustc_const_stable] attributes.
|
/// Represents the #[rustc_const_unstable] and #[rustc_const_stable] attributes.
|
||||||
#[derive(
|
#[derive(RustcEncodable, RustcDecodable, Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
RustcEncodable,
|
#[derive(HashStable_Generic)]
|
||||||
RustcDecodable,
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub struct ConstStability {
|
pub struct ConstStability {
|
||||||
pub level: StabilityLevel,
|
pub level: StabilityLevel,
|
||||||
pub feature: Symbol,
|
pub feature: Symbol,
|
||||||
@ -159,18 +141,8 @@ pub struct ConstStability {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The available stability levels.
|
/// The available stability levels.
|
||||||
#[derive(
|
#[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Copy, Clone, Debug, Eq, Hash)]
|
||||||
RustcEncodable,
|
#[derive(HashStable_Generic)]
|
||||||
RustcDecodable,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum StabilityLevel {
|
pub enum StabilityLevel {
|
||||||
// Reason for the current stability level and the relevant rust-lang issue
|
// Reason for the current stability level and the relevant rust-lang issue
|
||||||
Unstable { reason: Option<Symbol>, issue: Option<NonZeroU32>, is_soft: bool },
|
Unstable { reason: Option<Symbol>, issue: Option<NonZeroU32>, is_soft: bool },
|
||||||
@ -186,18 +158,8 @@ impl StabilityLevel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Copy, Clone, Debug, Eq, Hash)]
|
||||||
RustcEncodable,
|
#[derive(HashStable_Generic)]
|
||||||
RustcDecodable,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Copy,
|
|
||||||
Clone,
|
|
||||||
Debug,
|
|
||||||
Eq,
|
|
||||||
Hash,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub struct RustcDeprecation {
|
pub struct RustcDeprecation {
|
||||||
pub since: Symbol,
|
pub since: Symbol,
|
||||||
pub reason: Symbol,
|
pub reason: Symbol,
|
||||||
|
@ -1574,7 +1574,7 @@ impl EmitterWriter {
|
|||||||
.span_to_lines(parts[0].span)
|
.span_to_lines(parts[0].span)
|
||||||
.expect("span_to_lines failed when emitting suggestion");
|
.expect("span_to_lines failed when emitting suggestion");
|
||||||
|
|
||||||
assert!(!lines.lines.is_empty());
|
assert!(!lines.lines.is_empty() || parts[0].span.is_dummy());
|
||||||
|
|
||||||
let line_start = sm.lookup_char_pos(parts[0].span.lo()).line;
|
let line_start = sm.lookup_char_pos(parts[0].span.lo()).line;
|
||||||
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
|
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
|
||||||
|
@ -194,7 +194,7 @@ impl CodeSuggestion {
|
|||||||
let bounding_span = Span::with_root_ctxt(lo, hi);
|
let bounding_span = Span::with_root_ctxt(lo, hi);
|
||||||
// The different spans might belong to different contexts, if so ignore suggestion.
|
// The different spans might belong to different contexts, if so ignore suggestion.
|
||||||
let lines = sm.span_to_lines(bounding_span).ok()?;
|
let lines = sm.span_to_lines(bounding_span).ok()?;
|
||||||
assert!(!lines.lines.is_empty());
|
assert!(!lines.lines.is_empty() || bounding_span.is_dummy());
|
||||||
|
|
||||||
// We can't splice anything if the source is unavailable.
|
// We can't splice anything if the source is unavailable.
|
||||||
if !sm.ensure_source_file_source_present(lines.file.clone()) {
|
if !sm.ensure_source_file_source_present(lines.file.clone()) {
|
||||||
@ -213,8 +213,8 @@ impl CodeSuggestion {
|
|||||||
let sf = &lines.file;
|
let sf = &lines.file;
|
||||||
let mut prev_hi = sm.lookup_char_pos(bounding_span.lo());
|
let mut prev_hi = sm.lookup_char_pos(bounding_span.lo());
|
||||||
prev_hi.col = CharPos::from_usize(0);
|
prev_hi.col = CharPos::from_usize(0);
|
||||||
|
let mut prev_line =
|
||||||
let mut prev_line = sf.get_line(lines.lines[0].line_index);
|
lines.lines.get(0).and_then(|line0| sf.get_line(line0.line_index));
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
|
|
||||||
for part in &substitution.parts {
|
for part in &substitution.parts {
|
||||||
|
@ -5,7 +5,7 @@ use rustc::mir::AssertKind;
|
|||||||
use rustc_span::Symbol;
|
use rustc_span::Symbol;
|
||||||
|
|
||||||
use super::InterpCx;
|
use super::InterpCx;
|
||||||
use crate::interpret::{ConstEvalErr, InterpError, InterpErrorInfo, Machine};
|
use crate::interpret::{ConstEvalErr, InterpErrorInfo, Machine};
|
||||||
|
|
||||||
/// The CTFE machine has some custom error kinds.
|
/// The CTFE machine has some custom error kinds.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
@ -21,7 +21,7 @@ pub enum ConstEvalErrKind {
|
|||||||
// handle these.
|
// handle these.
|
||||||
impl<'tcx> Into<InterpErrorInfo<'tcx>> for ConstEvalErrKind {
|
impl<'tcx> Into<InterpErrorInfo<'tcx>> for ConstEvalErrKind {
|
||||||
fn into(self) -> InterpErrorInfo<'tcx> {
|
fn into(self) -> InterpErrorInfo<'tcx> {
|
||||||
InterpError::MachineStop(Box::new(self.to_string())).into()
|
err_machine_stop!(self.to_string()).into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ fn write_mir_sig(
|
|||||||
|
|
||||||
ty::print::with_forced_impl_filename_line(|| {
|
ty::print::with_forced_impl_filename_line(|| {
|
||||||
// see notes on #41697 elsewhere
|
// see notes on #41697 elsewhere
|
||||||
write!(w, " {}", tcx.def_path_str(src.def_id()))
|
write!(w, "{}", tcx.def_path_str(src.def_id()))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if src.promoted.is_none() && is_function {
|
if src.promoted.is_none() && is_function {
|
||||||
|
@ -1565,7 +1565,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err.multipart_suggestion(
|
err.multipart_suggestion(
|
||||||
"consider prefixing with an underscore",
|
"if this is intentional, prefix it with an underscore",
|
||||||
spans.iter().map(|span| (*span, format!("_{}", name))).collect(),
|
spans.iter().map(|span| (*span, format!("_{}", name))).collect(),
|
||||||
Applicability::MachineApplicable,
|
Applicability::MachineApplicable,
|
||||||
);
|
);
|
||||||
|
@ -105,19 +105,8 @@ impl ::std::fmt::Debug for CrateNum {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Copy,
|
#[derive(HashStable_Generic)]
|
||||||
Clone,
|
|
||||||
Hash,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub struct DefPathHash(pub Fingerprint);
|
pub struct DefPathHash(pub Fingerprint);
|
||||||
|
|
||||||
impl Borrow<Fingerprint> for DefPathHash {
|
impl Borrow<Fingerprint> for DefPathHash {
|
||||||
|
@ -5,18 +5,8 @@ use std::str::FromStr;
|
|||||||
use rustc_macros::HashStable_Generic;
|
use rustc_macros::HashStable_Generic;
|
||||||
|
|
||||||
/// The edition of the compiler (RFC 2052)
|
/// The edition of the compiler (RFC 2052)
|
||||||
#[derive(
|
#[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, RustcEncodable, RustcDecodable, Eq)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
Copy,
|
|
||||||
Hash,
|
|
||||||
PartialEq,
|
|
||||||
PartialOrd,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Eq,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum Edition {
|
pub enum Edition {
|
||||||
// editions must be kept in order, oldest to newest
|
// editions must be kept in order, oldest to newest
|
||||||
/// The 2015 edition
|
/// The 2015 edition
|
||||||
|
@ -59,18 +59,8 @@ pub struct ExpnId(u32);
|
|||||||
|
|
||||||
/// A property of a macro expansion that determines how identifiers
|
/// A property of a macro expansion that determines how identifiers
|
||||||
/// produced by that expansion are resolved.
|
/// produced by that expansion are resolved.
|
||||||
#[derive(
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Hash, Debug, RustcEncodable, RustcDecodable)]
|
||||||
Copy,
|
#[derive(HashStable_Generic)]
|
||||||
Clone,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum Transparency {
|
pub enum Transparency {
|
||||||
/// Identifier produced by a transparent expansion is always resolved at call-site.
|
/// Identifier produced by a transparent expansion is always resolved at call-site.
|
||||||
/// Call-site spans in procedural macros, hygiene opt-out in `macro` should use this.
|
/// Call-site spans in procedural macros, hygiene opt-out in `macro` should use this.
|
||||||
@ -747,17 +737,8 @@ impl ExpnKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of macro invocation or definition.
|
/// The kind of macro invocation or definition.
|
||||||
#[derive(
|
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||||
Clone,
|
#[derive(HashStable_Generic)]
|
||||||
Copy,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Hash,
|
|
||||||
Debug,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum MacroKind {
|
pub enum MacroKind {
|
||||||
/// A bang macro `foo!()`.
|
/// A bang macro `foo!()`.
|
||||||
Bang,
|
Bang,
|
||||||
|
@ -72,18 +72,8 @@ impl Globals {
|
|||||||
scoped_tls::scoped_thread_local!(pub static GLOBALS: Globals);
|
scoped_tls::scoped_thread_local!(pub static GLOBALS: Globals);
|
||||||
|
|
||||||
/// Differentiates between real files and common virtual files.
|
/// Differentiates between real files and common virtual files.
|
||||||
#[derive(
|
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, RustcDecodable, RustcEncodable)]
|
||||||
Debug,
|
#[derive(HashStable_Generic)]
|
||||||
Eq,
|
|
||||||
PartialEq,
|
|
||||||
Clone,
|
|
||||||
Ord,
|
|
||||||
PartialOrd,
|
|
||||||
Hash,
|
|
||||||
RustcDecodable,
|
|
||||||
RustcEncodable,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum FileName {
|
pub enum FileName {
|
||||||
Real(PathBuf),
|
Real(PathBuf),
|
||||||
/// Call to `quote!`.
|
/// Call to `quote!`.
|
||||||
|
@ -535,6 +535,10 @@ impl SourceMap {
|
|||||||
let (lo, hi) = self.is_valid_span(sp)?;
|
let (lo, hi) = self.is_valid_span(sp)?;
|
||||||
assert!(hi.line >= lo.line);
|
assert!(hi.line >= lo.line);
|
||||||
|
|
||||||
|
if sp.is_dummy() {
|
||||||
|
return Ok(FileLines { file: lo.file, lines: Vec::new() });
|
||||||
|
}
|
||||||
|
|
||||||
let mut lines = Vec::with_capacity(hi.line - lo.line + 1);
|
let mut lines = Vec::with_capacity(hi.line - lo.line + 1);
|
||||||
|
|
||||||
// The span starts partway through the first line,
|
// The span starts partway through the first line,
|
||||||
@ -545,6 +549,9 @@ impl SourceMap {
|
|||||||
// and to the end of the line. Be careful because the line
|
// and to the end of the line. Be careful because the line
|
||||||
// numbers in Loc are 1-based, so we subtract 1 to get 0-based
|
// numbers in Loc are 1-based, so we subtract 1 to get 0-based
|
||||||
// lines.
|
// lines.
|
||||||
|
//
|
||||||
|
// FIXME: now that we handle DUMMY_SP up above, we should consider
|
||||||
|
// asserting that the line numbers here are all indeed 1-based.
|
||||||
let hi_line = hi.line.saturating_sub(1);
|
let hi_line = hi.line.saturating_sub(1);
|
||||||
for line_index in lo.line.saturating_sub(1)..hi_line {
|
for line_index in lo.line.saturating_sub(1)..hi_line {
|
||||||
let line_len = lo.file.get_line(line_index).map(|s| s.chars().count()).unwrap_or(0);
|
let line_len = lo.file.get_line(line_index).map(|s| s.chars().count()).unwrap_or(0);
|
||||||
|
@ -5,19 +5,8 @@ use rustc_macros::HashStable_Generic;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
#[derive(
|
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Debug)]
|
||||||
PartialEq,
|
#[derive(HashStable_Generic)]
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
RustcEncodable,
|
|
||||||
RustcDecodable,
|
|
||||||
Clone,
|
|
||||||
Copy,
|
|
||||||
Debug,
|
|
||||||
HashStable_Generic
|
|
||||||
)]
|
|
||||||
pub enum Abi {
|
pub enum Abi {
|
||||||
// N.B., this ordering MUST match the AbiDatas array below.
|
// N.B., this ordering MUST match the AbiDatas array below.
|
||||||
// (This is ensured by the test indices_are_correct().)
|
// (This is ensured by the test indices_are_correct().)
|
||||||
|
@ -267,7 +267,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
|||||||
unstable("display-warnings", |o| {
|
unstable("display-warnings", |o| {
|
||||||
o.optflag("", "display-warnings", "to print code warnings when testing doc")
|
o.optflag("", "display-warnings", "to print code warnings when testing doc")
|
||||||
}),
|
}),
|
||||||
unstable("crate-version", |o| {
|
stable("crate-version", |o| {
|
||||||
o.optopt("", "crate-version", "crate version to print into documentation", "VERSION")
|
o.optopt("", "crate-version", "crate version to print into documentation", "VERSION")
|
||||||
}),
|
}),
|
||||||
unstable("sort-modules-by-appearance", |o| {
|
unstable("sort-modules-by-appearance", |o| {
|
||||||
|
@ -310,6 +310,7 @@
|
|||||||
#![feature(untagged_unions)]
|
#![feature(untagged_unions)]
|
||||||
#![feature(unwind_attributes)]
|
#![feature(unwind_attributes)]
|
||||||
#![feature(vec_into_raw_parts)]
|
#![feature(vec_into_raw_parts)]
|
||||||
|
#![feature(wake_trait)]
|
||||||
// NB: the above list is sorted to minimize merge conflicts.
|
// NB: the above list is sorted to minimize merge conflicts.
|
||||||
#![default_lib_allocator]
|
#![default_lib_allocator]
|
||||||
|
|
||||||
@ -463,9 +464,14 @@ pub mod time;
|
|||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
pub mod task {
|
pub mod task {
|
||||||
//! Types and Traits for working with asynchronous tasks.
|
//! Types and Traits for working with asynchronous tasks.
|
||||||
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
pub use core::task::*;
|
pub use core::task::*;
|
||||||
|
|
||||||
|
#[doc(inline)]
|
||||||
|
#[unstable(feature = "wake_trait", issue = "69912")]
|
||||||
|
pub use alloc::task::*;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// compile-flags: --crate-version=1.3.37 -Z unstable-options
|
// compile-flags: --crate-version=1.3.37
|
||||||
|
|
||||||
// @has 'crate_version/index.html' '//div[@class="block version"]/p' 'Version 1.3.37'
|
// @has 'crate_version/index.html' '//div[@class="block version"]/p' 'Version 1.3.37'
|
||||||
|
@ -10,7 +10,7 @@ warning: unused variable: `foo`
|
|||||||
--> $DIR/issue-62187-encountered-polymorphic-const.rs:15:9
|
--> $DIR/issue-62187-encountered-polymorphic-const.rs:15:9
|
||||||
|
|
|
|
||||||
LL | let foo = <[u8; 2]>::BIT_LEN;
|
LL | let foo = <[u8; 2]>::BIT_LEN;
|
||||||
| ^^^ help: consider prefixing with an underscore: `_foo`
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
|
||||||
|
|
|
|
||||||
= note: `#[warn(unused_variables)]` on by default
|
= note: `#[warn(unused_variables)]` on by default
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `x`
|
|||||||
--> $DIR/issue-17999.rs:5:13
|
--> $DIR/issue-17999.rs:5:13
|
||||||
|
|
|
|
||||||
LL | let x = ();
|
LL | let x = ();
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/issue-17999.rs:1:9
|
--> $DIR/issue-17999.rs:1:9
|
||||||
@ -14,7 +14,7 @@ error: unused variable: `a`
|
|||||||
--> $DIR/issue-17999.rs:7:13
|
--> $DIR/issue-17999.rs:7:13
|
||||||
|
|
|
|
||||||
LL | a => {}
|
LL | a => {}
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `a`
|
|||||||
--> $DIR/issue-22599.rs:8:19
|
--> $DIR/issue-22599.rs:8:19
|
||||||
|
|
|
|
||||||
LL | v = match 0 { a => 0 };
|
LL | v = match 0 { a => 0 };
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/issue-22599.rs:1:9
|
--> $DIR/issue-22599.rs:1:9
|
||||||
|
9
src/test/ui/issues/issue-53275.rs
Normal file
9
src/test/ui/issues/issue-53275.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// build-pass
|
||||||
|
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
#![allow(unconditional_panic)]
|
||||||
|
struct S(u8);
|
||||||
|
|
||||||
|
pub fn ice() {
|
||||||
|
S([][0]);
|
||||||
|
}
|
@ -9,7 +9,7 @@ note: the lint level is defined here
|
|||||||
|
|
|
|
||||||
LL | #![deny(unused_variables)]
|
LL | #![deny(unused_variables)]
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
help: consider prefixing with an underscore
|
help: if this is intentional, prefix it with an underscore
|
||||||
|
|
|
|
||||||
LL | E::A(_x) | E::B(_x) => {}
|
LL | E::A(_x) | E::B(_x) => {}
|
||||||
| ^^ ^^
|
| ^^ ^^
|
||||||
@ -20,7 +20,7 @@ error: unused variable: `x`
|
|||||||
LL | F::A(x, y) | F::B(x, y) => { y },
|
LL | F::A(x, y) | F::B(x, y) => { y },
|
||||||
| ^ ^
|
| ^ ^
|
||||||
|
|
|
|
||||||
help: consider prefixing with an underscore
|
help: if this is intentional, prefix it with an underscore
|
||||||
|
|
|
|
||||||
LL | F::A(_x, y) | F::B(_x, y) => { y },
|
LL | F::A(_x, y) | F::B(_x, y) => { y },
|
||||||
| ^^ ^^
|
| ^^ ^^
|
||||||
@ -29,13 +29,13 @@ error: unused variable: `a`
|
|||||||
--> $DIR/issue-56685.rs:27:14
|
--> $DIR/issue-56685.rs:27:14
|
||||||
|
|
|
|
||||||
LL | F::C(a, b) => { 3 }
|
LL | F::C(a, b) => { 3 }
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/issue-56685.rs:27:17
|
--> $DIR/issue-56685.rs:27:17
|
||||||
|
|
|
|
||||||
LL | F::C(a, b) => { 3 }
|
LL | F::C(a, b) => { 3 }
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/issue-56685.rs:32:25
|
--> $DIR/issue-56685.rs:32:25
|
||||||
@ -43,7 +43,7 @@ error: unused variable: `x`
|
|||||||
LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
|
LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
|
||||||
| ^ ^
|
| ^ ^
|
||||||
|
|
|
|
||||||
help: consider prefixing with an underscore
|
help: if this is intentional, prefix it with an underscore
|
||||||
|
|
|
|
||||||
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
|
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
|
||||||
| ^^ ^^
|
| ^^ ^^
|
||||||
@ -54,7 +54,7 @@ error: unused variable: `x`
|
|||||||
LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
|
LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
|
||||||
| ^ ^
|
| ^ ^
|
||||||
|
|
|
|
||||||
help: consider prefixing with an underscore
|
help: if this is intentional, prefix it with an underscore
|
||||||
|
|
|
|
||||||
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
|
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
|
||||||
| ^^ ^^
|
| ^^ ^^
|
||||||
|
@ -2,7 +2,7 @@ warning: unused variable: `i_think_continually`
|
|||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:26:9
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:26:9
|
||||||
|
|
|
|
||||||
LL | let i_think_continually = 2;
|
LL | let i_think_continually = 2;
|
||||||
| ^^^^^^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_i_think_continually`
|
| ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_i_think_continually`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:5:9
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:5:9
|
||||||
@ -15,19 +15,19 @@ warning: unused variable: `mut_unused_var`
|
|||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:33:13
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:33:13
|
||||||
|
|
|
|
||||||
LL | let mut mut_unused_var = 1;
|
LL | let mut mut_unused_var = 1;
|
||||||
| ^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_mut_unused_var`
|
| ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_mut_unused_var`
|
||||||
|
|
||||||
warning: unused variable: `var`
|
warning: unused variable: `var`
|
||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:14
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:14
|
||||||
|
|
|
|
||||||
LL | let (mut var, unused_var) = (1, 2);
|
LL | let (mut var, unused_var) = (1, 2);
|
||||||
| ^^^ help: consider prefixing with an underscore: `_var`
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_var`
|
||||||
|
|
||||||
warning: unused variable: `unused_var`
|
warning: unused variable: `unused_var`
|
||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:19
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:19
|
||||||
|
|
|
|
||||||
LL | let (mut var, unused_var) = (1, 2);
|
LL | let (mut var, unused_var) = (1, 2);
|
||||||
| ^^^^^^^^^^ help: consider prefixing with an underscore: `_unused_var`
|
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused_var`
|
||||||
|
|
||||||
warning: unused variable: `corridors_of_light`
|
warning: unused variable: `corridors_of_light`
|
||||||
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:45:26
|
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:45:26
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `y`
|
|||||||
--> $DIR/lint-match-arms.rs:5:9
|
--> $DIR/lint-match-arms.rs:5:9
|
||||||
|
|
|
|
||||||
LL | y => (),
|
LL | y => (),
|
||||||
| ^ help: consider prefixing with an underscore: `_y`
|
| ^ help: if this is intentional, prefix it with an underscore: `_y`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-match-arms.rs:3:16
|
--> $DIR/lint-match-arms.rs:3:16
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-removed-allow.rs:8:17
|
--> $DIR/lint-removed-allow.rs:8:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-removed-allow.rs:7:8
|
--> $DIR/lint-removed-allow.rs:7:8
|
||||||
|
@ -18,7 +18,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-removed-cmdline.rs:12:17
|
--> $DIR/lint-removed-cmdline.rs:12:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-removed-cmdline.rs:11:8
|
--> $DIR/lint-removed-cmdline.rs:11:8
|
||||||
|
@ -10,7 +10,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-removed.rs:8:17
|
--> $DIR/lint-removed.rs:8:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-removed.rs:7:8
|
--> $DIR/lint-removed.rs:7:8
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-renamed-allow.rs:8:17
|
--> $DIR/lint-renamed-allow.rs:8:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-renamed-allow.rs:7:8
|
--> $DIR/lint-renamed-allow.rs:7:8
|
||||||
|
@ -18,7 +18,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-renamed-cmdline.rs:8:17
|
--> $DIR/lint-renamed-cmdline.rs:8:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-renamed-cmdline.rs:7:8
|
--> $DIR/lint-renamed-cmdline.rs:7:8
|
||||||
|
@ -10,7 +10,7 @@ error: unused variable: `unused`
|
|||||||
--> $DIR/lint-renamed.rs:4:17
|
--> $DIR/lint-renamed.rs:4:17
|
||||||
|
|
|
|
||||||
LL | fn main() { let unused = (); }
|
LL | fn main() { let unused = (); }
|
||||||
| ^^^^^^ help: consider prefixing with an underscore: `_unused`
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-renamed.rs:3:8
|
--> $DIR/lint-renamed.rs:3:8
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `a`
|
|||||||
--> $DIR/lint-unused-variables.rs:8:5
|
--> $DIR/lint-unused-variables.rs:8:5
|
||||||
|
|
|
|
||||||
LL | a: i32,
|
LL | a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-unused-variables.rs:5:9
|
--> $DIR/lint-unused-variables.rs:5:9
|
||||||
@ -14,61 +14,61 @@ error: unused variable: `b`
|
|||||||
--> $DIR/lint-unused-variables.rs:14:5
|
--> $DIR/lint-unused-variables.rs:14:5
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `a`
|
error: unused variable: `a`
|
||||||
--> $DIR/lint-unused-variables.rs:68:9
|
--> $DIR/lint-unused-variables.rs:68:9
|
||||||
|
|
|
|
||||||
LL | a: i32,
|
LL | a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:74:9
|
--> $DIR/lint-unused-variables.rs:74:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:42:9
|
--> $DIR/lint-unused-variables.rs:42:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:47:9
|
--> $DIR/lint-unused-variables.rs:47:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `a`
|
error: unused variable: `a`
|
||||||
--> $DIR/lint-unused-variables.rs:22:9
|
--> $DIR/lint-unused-variables.rs:22:9
|
||||||
|
|
|
|
||||||
LL | a: i32,
|
LL | a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:29:9
|
--> $DIR/lint-unused-variables.rs:29:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:34:9
|
--> $DIR/lint-unused-variables.rs:34:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:55:9
|
--> $DIR/lint-unused-variables.rs:55:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/lint-unused-variables.rs:60:9
|
--> $DIR/lint-unused-variables.rs:60:9
|
||||||
|
|
|
|
||||||
LL | b: i32,
|
LL | b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: aborting due to 11 previous errors
|
error: aborting due to 11 previous errors
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ warning: unused variable: `Foo`
|
|||||||
--> $DIR/lint-uppercase-variables.rs:22:9
|
--> $DIR/lint-uppercase-variables.rs:22:9
|
||||||
|
|
|
|
||||||
LL | Foo => {}
|
LL | Foo => {}
|
||||||
| ^^^ help: consider prefixing with an underscore: `_Foo`
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/lint-uppercase-variables.rs:1:9
|
--> $DIR/lint-uppercase-variables.rs:1:9
|
||||||
@ -35,13 +35,13 @@ warning: unused variable: `Foo`
|
|||||||
--> $DIR/lint-uppercase-variables.rs:28:9
|
--> $DIR/lint-uppercase-variables.rs:28:9
|
||||||
|
|
|
|
||||||
LL | let Foo = foo::Foo::Foo;
|
LL | let Foo = foo::Foo::Foo;
|
||||||
| ^^^ help: consider prefixing with an underscore: `_Foo`
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
|
||||||
|
|
||||||
warning: unused variable: `Foo`
|
warning: unused variable: `Foo`
|
||||||
--> $DIR/lint-uppercase-variables.rs:33:17
|
--> $DIR/lint-uppercase-variables.rs:33:17
|
||||||
|
|
|
|
||||||
LL | fn in_param(Foo: foo::Foo) {}
|
LL | fn in_param(Foo: foo::Foo) {}
|
||||||
| ^^^ help: consider prefixing with an underscore: `_Foo`
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_Foo`
|
||||||
|
|
||||||
error: structure field `X` should have a snake case name
|
error: structure field `X` should have a snake case name
|
||||||
--> $DIR/lint-uppercase-variables.rs:10:5
|
--> $DIR/lint-uppercase-variables.rs:10:5
|
||||||
|
@ -17,7 +17,7 @@ error: unused variable: `x`
|
|||||||
--> $DIR/liveness-unused.rs:8:7
|
--> $DIR/liveness-unused.rs:8:7
|
||||||
|
|
|
|
||||||
LL | fn f1(x: isize) {
|
LL | fn f1(x: isize) {
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/liveness-unused.rs:2:9
|
--> $DIR/liveness-unused.rs:2:9
|
||||||
@ -29,19 +29,19 @@ error: unused variable: `x`
|
|||||||
--> $DIR/liveness-unused.rs:12:8
|
--> $DIR/liveness-unused.rs:12:8
|
||||||
|
|
|
|
||||||
LL | fn f1b(x: &mut isize) {
|
LL | fn f1b(x: &mut isize) {
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/liveness-unused.rs:20:9
|
--> $DIR/liveness-unused.rs:20:9
|
||||||
|
|
|
|
||||||
LL | let x: isize;
|
LL | let x: isize;
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/liveness-unused.rs:25:9
|
--> $DIR/liveness-unused.rs:25:9
|
||||||
|
|
|
|
||||||
LL | let x = 3;
|
LL | let x = 3;
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: variable `x` is assigned to, but never used
|
error: variable `x` is assigned to, but never used
|
||||||
--> $DIR/liveness-unused.rs:30:13
|
--> $DIR/liveness-unused.rs:30:13
|
||||||
@ -76,25 +76,25 @@ error: unused variable: `i`
|
|||||||
--> $DIR/liveness-unused.rs:59:12
|
--> $DIR/liveness-unused.rs:59:12
|
||||||
|
|
|
|
||||||
LL | Some(i) => {
|
LL | Some(i) => {
|
||||||
| ^ help: consider prefixing with an underscore: `_i`
|
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/liveness-unused.rs:79:9
|
--> $DIR/liveness-unused.rs:79:9
|
||||||
|
|
|
|
||||||
LL | for x in 1..10 { }
|
LL | for x in 1..10 { }
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/liveness-unused.rs:84:10
|
--> $DIR/liveness-unused.rs:84:10
|
||||||
|
|
|
|
||||||
LL | for (x, _) in [1, 2, 3].iter().enumerate() { }
|
LL | for (x, _) in [1, 2, 3].iter().enumerate() { }
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: unused variable: `x`
|
error: unused variable: `x`
|
||||||
--> $DIR/liveness-unused.rs:89:13
|
--> $DIR/liveness-unused.rs:89:13
|
||||||
|
|
|
|
||||||
LL | for (_, x) in [1, 2, 3].iter().enumerate() {
|
LL | for (_, x) in [1, 2, 3].iter().enumerate() {
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: variable `x` is assigned to, but never used
|
error: variable `x` is assigned to, but never used
|
||||||
--> $DIR/liveness-unused.rs:112:9
|
--> $DIR/liveness-unused.rs:112:9
|
||||||
|
@ -25,7 +25,7 @@ warning: unused variable: `x`
|
|||||||
--> $DIR/never-assign-dead-code.rs:9:9
|
--> $DIR/never-assign-dead-code.rs:9:9
|
||||||
|
|
|
|
||||||
LL | let x: ! = panic!("aah");
|
LL | let x: ! = panic!("aah");
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/never-assign-dead-code.rs:6:9
|
--> $DIR/never-assign-dead-code.rs:6:9
|
||||||
|
@ -2,7 +2,7 @@ warning: unused variable: `a`
|
|||||||
--> $DIR/attributes-included.rs:17:9
|
--> $DIR/attributes-included.rs:17:9
|
||||||
|
|
|
|
||||||
LL | let a: i32 = "foo";
|
LL | let a: i32 = "foo";
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/attributes-included.rs:4:9
|
--> $DIR/attributes-included.rs:4:9
|
||||||
|
@ -2,7 +2,7 @@ error: unused variable: `a`
|
|||||||
--> $DIR/param-attrs-cfg.rs:24:23
|
--> $DIR/param-attrs-cfg.rs:24:23
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] a: i32,
|
LL | #[cfg(something)] a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/param-attrs-cfg.rs:5:9
|
--> $DIR/param-attrs-cfg.rs:5:9
|
||||||
@ -14,109 +14,109 @@ error: unused variable: `b`
|
|||||||
--> $DIR/param-attrs-cfg.rs:30:23
|
--> $DIR/param-attrs-cfg.rs:30:23
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:32:40
|
--> $DIR/param-attrs-cfg.rs:32:40
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `a`
|
error: unused variable: `a`
|
||||||
--> $DIR/param-attrs-cfg.rs:107:27
|
--> $DIR/param-attrs-cfg.rs:107:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] a: i32,
|
LL | #[cfg(something)] a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:113:27
|
--> $DIR/param-attrs-cfg.rs:113:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:115:44
|
--> $DIR/param-attrs-cfg.rs:115:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:67:27
|
--> $DIR/param-attrs-cfg.rs:67:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:69:44
|
--> $DIR/param-attrs-cfg.rs:69:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:75:27
|
--> $DIR/param-attrs-cfg.rs:75:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:77:44
|
--> $DIR/param-attrs-cfg.rs:77:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `a`
|
error: unused variable: `a`
|
||||||
--> $DIR/param-attrs-cfg.rs:41:27
|
--> $DIR/param-attrs-cfg.rs:41:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] a: i32,
|
LL | #[cfg(something)] a: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_a`
|
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:48:27
|
--> $DIR/param-attrs-cfg.rs:48:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:50:44
|
--> $DIR/param-attrs-cfg.rs:50:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:56:27
|
--> $DIR/param-attrs-cfg.rs:56:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:58:44
|
--> $DIR/param-attrs-cfg.rs:58:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:86:27
|
--> $DIR/param-attrs-cfg.rs:86:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:88:44
|
--> $DIR/param-attrs-cfg.rs:88:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: unused variable: `b`
|
error: unused variable: `b`
|
||||||
--> $DIR/param-attrs-cfg.rs:94:27
|
--> $DIR/param-attrs-cfg.rs:94:27
|
||||||
|
|
|
|
||||||
LL | #[cfg(something)] b: i32,
|
LL | #[cfg(something)] b: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_b`
|
| ^ help: if this is intentional, prefix it with an underscore: `_b`
|
||||||
|
|
||||||
error: unused variable: `c`
|
error: unused variable: `c`
|
||||||
--> $DIR/param-attrs-cfg.rs:96:44
|
--> $DIR/param-attrs-cfg.rs:96:44
|
||||||
|
|
|
|
||||||
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
|
||||||
| ^ help: consider prefixing with an underscore: `_c`
|
| ^ help: if this is intentional, prefix it with an underscore: `_c`
|
||||||
|
|
||||||
error: aborting due to 19 previous errors
|
error: aborting due to 19 previous errors
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ warning: unused variable: `theOtherTwo`
|
|||||||
--> $DIR/issue-24690.rs:13:9
|
--> $DIR/issue-24690.rs:13:9
|
||||||
|
|
|
|
||||||
LL | let theOtherTwo = 2;
|
LL | let theOtherTwo = 2;
|
||||||
| ^^^^^^^^^^^ help: consider prefixing with an underscore: `_theOtherTwo`
|
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_theOtherTwo`
|
||||||
|
|
|
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/issue-24690.rs:8:9
|
--> $DIR/issue-24690.rs:8:9
|
||||||
|
@ -14,7 +14,7 @@ error: unused variable: `x`
|
|||||||
--> $DIR/unused-closure-argument.rs:17:15
|
--> $DIR/unused-closure-argument.rs:17:15
|
||||||
|
|
|
|
||||||
LL | .map(|x| 4)
|
LL | .map(|x| 4)
|
||||||
| ^ help: consider prefixing with an underscore: `_x`
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user