build: Warn if not use 2018 idioms

This commit is contained in:
Lzu Tao 2019-07-24 21:24:26 +07:00
parent aadff8560b
commit e6a677fe63
3 changed files with 6 additions and 5 deletions

View file

@ -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()
})();

View file

@ -1,5 +1,6 @@
#![feature(rustc_private)]
#![warn(rust_2018_idioms)]
#![allow(clippy::cast_lossless)]
#[macro_use]

View file

@ -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)"),