Skip to content

Commit 7ef4097

Browse files
committed
Auto merge of #854 - lzutao:warn-idioms, r=RalfJung
build: Warn if not use 2018 idioms As requested in rust-lang/miri#852 (comment)
2 parents aadff85 + e6a677f commit 7ef4097

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub fn eval_main<'tcx>(
179179
};
180180

181181
// Perform the main execution.
182-
let res: InterpResult = (|| {
182+
let res: InterpResult<'_> = (|| {
183183
ecx.run()?;
184184
ecx.run_tls_dtors()
185185
})();

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(rustc_private)]
22

3+
#![warn(rust_2018_idioms)]
34
#![allow(clippy::cast_lossless)]
45

56
#[macro_use]

src/stacked_borrows.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub enum Tag {
2828
}
2929

3030
impl fmt::Debug for Tag {
31-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3232
match self {
3333
Tag::Tagged(id) => write!(f, "<{}>", id),
3434
Tag::Untagged => write!(f, "<untagged>"),
@@ -62,7 +62,7 @@ pub struct Item {
6262
}
6363

6464
impl fmt::Debug for Item {
65-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
65+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6666
write!(f, "[{:?} for {:?}", self.perm, self.tag)?;
6767
if let Some(call) = self.protector {
6868
write!(f, " (call {})", call)?;
@@ -117,7 +117,7 @@ pub enum AccessKind {
117117
}
118118

119119
impl fmt::Display for AccessKind {
120-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
120+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
121121
match self {
122122
AccessKind::Read => write!(f, "read access"),
123123
AccessKind::Write => write!(f, "write access"),
@@ -139,7 +139,7 @@ pub enum RefKind {
139139
}
140140

141141
impl fmt::Display for RefKind {
142-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
142+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
143143
match self {
144144
RefKind::Unique { two_phase: false } => write!(f, "unique"),
145145
RefKind::Unique { two_phase: true } => write!(f, "unique (two-phase)"),

0 commit comments

Comments
 (0)