Skip to content

Commit 7120279

Browse files
committed
Remove unstable features from rustc_errors
1 parent 198917b commit 7120279

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustc_errors/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ crate-type = ["dylib"]
1111
[dependencies]
1212
serialize = { path = "../libserialize" }
1313
syntax_pos = { path = "../libsyntax_pos" }
14+
libc = "0.2"

src/librustc_errors/emitter.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,12 @@ fn num_overlap(a_start: usize, a_end: usize, b_start: usize, b_end:usize, inclus
12001200
} else {
12011201
0
12021202
};
1203-
(b_start..b_end + extra).contains(a_start) ||
1204-
(a_start..a_end + extra).contains(b_start)
1203+
return range_contains(b_start..b_end + extra, a_start) ||
1204+
range_contains(a_start..a_end + extra, b_start);
1205+
1206+
fn range_contains<T: PartialOrd>(range: ::std::ops::Range<T>, item: T) -> bool {
1207+
(range.start <= item) && (item < range.end)
1208+
}
12051209
}
12061210
fn overlaps(a1: &Annotation, a2: &Annotation, padding: usize) -> bool {
12071211
num_overlap(a1.start_col, a1.end_col + padding, a2.start_col, a2.end_col, false)

src/librustc_errors/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
html_root_url = "https://doc.rust-lang.org/nightly/")]
1818
#![deny(warnings)]
1919

20-
#![feature(custom_attribute)]
2120
#![allow(unused_attributes)]
2221
#![feature(rustc_private)]
2322
#![feature(staged_api)]
24-
#![feature(range_contains)]
25-
#![feature(libc)]
2623

2724
extern crate term;
2825
extern crate libc;

0 commit comments

Comments
 (0)