Auto merge of #854 - lzutao:warn-idioms, r=RalfJung
build: Warn if not use 2018 idioms As requested in https://github.com/rust-lang/miri/pull/852#issuecomment-514612244
This commit is contained in:
commit
7ef4097915
3 changed files with 6 additions and 5 deletions
|
|
@ -179,7 +179,7 @@ pub fn eval_main<'tcx>(
|
|||
};
|
||||
|
||||
// Perform the main execution.
|
||||
let res: InterpResult = (|| {
|
||||
let res: InterpResult<'_> = (|| {
|
||||
ecx.run()?;
|
||||
ecx.run_tls_dtors()
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#![feature(rustc_private)]
|
||||
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![allow(clippy::cast_lossless)]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub enum Tag {
|
|||
}
|
||||
|
||||
impl fmt::Debug for Tag {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Tag::Tagged(id) => write!(f, "<{}>", id),
|
||||
Tag::Untagged => write!(f, "<untagged>"),
|
||||
|
|
@ -62,7 +62,7 @@ pub struct Item {
|
|||
}
|
||||
|
||||
impl fmt::Debug for Item {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "[{:?} for {:?}", self.perm, self.tag)?;
|
||||
if let Some(call) = self.protector {
|
||||
write!(f, " (call {})", call)?;
|
||||
|
|
@ -117,7 +117,7 @@ pub enum AccessKind {
|
|||
}
|
||||
|
||||
impl fmt::Display for AccessKind {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
AccessKind::Read => write!(f, "read access"),
|
||||
AccessKind::Write => write!(f, "write access"),
|
||||
|
|
@ -139,7 +139,7 @@ pub enum RefKind {
|
|||
}
|
||||
|
||||
impl fmt::Display for RefKind {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
RefKind::Unique { two_phase: false } => write!(f, "unique"),
|
||||
RefKind::Unique { two_phase: true } => write!(f, "unique (two-phase)"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue