Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Commit 4eb3fe5

Browse files
authored
Merge pull request #89 from durka/no-const-fn
remove usage of const fn
2 parents 7920eb7 + af07298 commit 4eb3fe5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
#![feature(const_fn)]
109
#![feature(type_ascription)]
1110

1211
#[macro_use]
@@ -35,6 +34,7 @@ use std::collections::HashMap;
3534
use std::path::{Path, PathBuf};
3635
use std::sync::Mutex;
3736
use std::time::{Instant, SystemTime};
37+
use std::u64;
3838

3939
#[derive(Debug)]
4040
pub struct AnalysisHost<L: AnalysisLoader = CargoAnalysisLoader> {
@@ -76,7 +76,7 @@ pub type Span = span::Span<span::ZeroIndexed>;
7676
pub struct Id(u64);
7777

7878
// Used to indicate a missing index in the Id.
79-
pub const NULL: Id = Id(u64::max_value());
79+
pub const NULL: Id = Id(u64::MAX);
8080

8181
type Blacklist<'a> = &'a [&'static str];
8282

src/lowering.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::collections::HashMap;
2121
use std::iter::Extend;
2222
use std::path::{Path, PathBuf};
2323
use std::time::Instant;
24+
use std::u32;
2425

2526
// f is a function used to record the lowered crate into analysis.
2627
pub fn lower<F, L>(
@@ -336,7 +337,7 @@ impl CrateReader {
336337
// }
337338

338339
fn id_from_compiler_id(&self, id: &data::Id) -> Id {
339-
if id.krate == u32::max_value() || id.index == u32::max_value() {
340+
if id.krate == u32::MAX || id.index == u32::MAX {
340341
return NULL;
341342
}
342343
// We build an id by looking up the local crate number into a global crate number and using

0 commit comments

Comments
 (0)