Skip to content

Commit 0d3e178

Browse files
committedFeb 6, 2019
librustc_apfloat => 2018
1 parent b139669 commit 0d3e178

File tree

6 files changed

+11
-18
lines changed

6 files changed

+11
-18
lines changed
 

‎src/librustc_apfloat/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
authors = ["The Rust Project Developers"]
33
name = "rustc_apfloat"
44
version = "0.0.0"
5+
edition = "2018"
56

67
[lib]
78
name = "rustc_apfloat"

‎src/librustc_apfloat/ieee.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use {Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
2-
use {Float, FloatConvert, ParseError, Round, Status, StatusAnd};
1+
use crate::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
2+
use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
33

44
use smallvec::{SmallVec, smallvec};
55
use std::cmp::{self, Ordering};
@@ -325,7 +325,7 @@ impl<S> Neg for IeeeFloat<S> {
325325
/// 1.01E-2 4 2 0.0101
326326
/// 1.01E-2 4 1 1.01E-2
327327
impl<S: Semantics> fmt::Display for IeeeFloat<S> {
328-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
328+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
329329
let width = f.width().unwrap_or(3);
330330
let alternate = f.alternate();
331331

@@ -614,7 +614,7 @@ impl<S: Semantics> fmt::Display for IeeeFloat<S> {
614614
}
615615

616616
impl<S: Semantics> fmt::Debug for IeeeFloat<S> {
617-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
617+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
618618
write!(f, "{}({:?} | {}{:?} * 2^{})",
619619
self, self.category,
620620
if self.sign { "-" } else { "+" },

‎src/librustc_apfloat/lib.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,20 @@
3434
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3535
html_root_url = "https://doc.rust-lang.org/nightly/")]
3636
#![forbid(unsafe_code)]
37+
#![deny(rust_2018_idioms)]
3738

38-
#![feature(nll)]
3939
#![feature(try_from)]
4040
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
4141
#[allow(unused_extern_crates)]
4242
extern crate rustc_cratesio_shim;
4343

44-
#[macro_use]
45-
extern crate bitflags;
46-
extern crate smallvec;
47-
4844
use std::cmp::Ordering;
4945
use std::fmt;
5046
use std::ops::{Neg, Add, Sub, Mul, Div, Rem};
5147
use std::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign};
5248
use std::str::FromStr;
5349

54-
bitflags! {
50+
bitflags::bitflags! {
5551
/// IEEE-754R 7: Default exception handling.
5652
///
5753
/// UNDERFLOW or OVERFLOW are always returned or-ed with INEXACT.

‎src/librustc_apfloat/ppc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use {Category, ExpInt, Float, FloatConvert, Round, ParseError, Status, StatusAnd};
2-
use ieee;
1+
use crate::{Category, ExpInt, Float, FloatConvert, Round, ParseError, Status, StatusAnd};
2+
use crate::ieee;
33

44
use std::cmp::Ordering;
55
use std::fmt;
@@ -124,7 +124,7 @@ impl<F: Float> Neg for DoubleFloat<F> {
124124
}
125125

126126
impl<F: FloatConvert<Fallback<F>>> fmt::Display for DoubleFloat<F> {
127-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
127+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
128128
fmt::Display::fmt(&Fallback::from(*self), f)
129129
}
130130
}

‎src/librustc_apfloat/tests/ieee.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
#[macro_use]
2-
extern crate rustc_apfloat;
3-
41
use rustc_apfloat::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
52
use rustc_apfloat::{Float, FloatConvert, ParseError, Round, Status};
63
use rustc_apfloat::ieee::{Half, Single, Double, Quad, X87DoubleExtended};
4+
use rustc_apfloat::unpack;
75

86
trait SingleExt {
97
fn from_f32(input: f32) -> Self;

‎src/librustc_apfloat/tests/ppc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate rustc_apfloat;
2-
31
use rustc_apfloat::{Category, Float, Round};
42
use rustc_apfloat::ppc::DoubleDouble;
53

0 commit comments

Comments
 (0)