Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add errors for unknown, stable and duplicate feature attributes #52644

Merged
merged 38 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
64185f2
Remove unnecessary or invalid feature attributes
varkor Jul 23, 2018
a00ba4d
Correct invalid feature attributes
varkor Jul 23, 2018
5242dce
Add lint for unknown feature attributes
varkor Jul 23, 2018
70ff6fd
Add error for inconsistent stability `since` value
varkor Jul 23, 2018
3584601
Trigger stable feature lint for lib features
varkor Jul 23, 2018
fc99ea7
Add a lint for duplicate feature attributes
varkor Jul 23, 2018
a92d3a3
Add duplicity lint for lang features
varkor Jul 23, 2018
82a98ac
Get around tidy bug
varkor Jul 23, 2018
99db9d6
Fix test/debuginfo
varkor Jul 23, 2018
61b9d87
Fix test/run-fail
varkor Jul 23, 2018
279fbaa
Fix test/run-pass
varkor Jul 23, 2018
895fcec
Fix test/compile-fail
varkor Jul 23, 2018
671a817
Fix test/ui
varkor Jul 23, 2018
c717ccb
Add a test for unknown features
varkor Jul 23, 2018
372e128
Add test for duplicate features
varkor Jul 23, 2018
1511df2
Add a test for feature attribute consistency
varkor Jul 23, 2018
af77c42
Remove panic-runtime opt-out
varkor Jul 23, 2018
bd66cbb
Remove obsolete tests in tidy
varkor Jul 23, 2018
c81b95f
Remove unnecessary feature attributes that sneaked in
varkor Jul 23, 2018
47619c0
Turn the duplicate feature lint into an error
varkor Jul 23, 2018
1209891
Convert unknown_features lint into an error
varkor Jul 23, 2018
53add5d
Add support for feature attributes on macros
varkor Jul 23, 2018
f91d7ba
Add special support for libc
varkor Jul 23, 2018
f2fd000
Fix incremental tests
varkor Jul 24, 2018
f22ccbe
Fix run-pass-fulldeps tests
varkor Jul 24, 2018
8cee487
Fix rustdoc test
varkor Jul 24, 2018
319b052
Fix stage 2 tests
varkor Jul 25, 2018
e5d5e6a
Fix outdated handling of GetLangItems
varkor Jul 26, 2018
bd90137
Improve query efficiency
varkor Jul 26, 2018
d198321
Remove bad features after rebase
varkor Aug 2, 2018
60ad636
Add an error when declaring features that are stable in the current R…
varkor Aug 2, 2018
5815a84
Remove references to unknown feature `io`
varkor Aug 2, 2018
c157ec8
Fix 2018 edition tests
varkor Aug 2, 2018
d027cc8
Change feature edition error into a warning
varkor Aug 3, 2018
8d7638f
Fix failure on msvc
varkor Aug 5, 2018
a8b5b95
Fix diagnostic_list error
varkor Aug 5, 2018
7e7622a
Fix WASM tests
varkor Aug 5, 2018
4687476
Special-case "test" feature
varkor Aug 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions src/etc/test-float-parse/many-digits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rand)]

extern crate rand;

mod _common;
Expand Down
2 changes: 0 additions & 2 deletions src/etc/test-float-parse/rand-f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rand)]

extern crate rand;

mod _common;
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/benches/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rand)]
#![feature(repr_simd)]
#![feature(slice_sort_by_cached_key)]
#![feature(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,7 @@ macro_rules! __impl_slice_eq1 {
__impl_slice_eq1! { $Lhs, $Rhs, Sized }
};
($Lhs: ty, $Rhs: ty, $Bound: ident) => {
#[stable(feature = "vec-deque-partial-eq-slice", since = "1.17.0")]
#[stable(feature = "vec_deque_partial_eq_slice", since = "1.17.0")]
impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
fn eq(&self, other: &$Rhs) -> bool {
if self.len() != other.len() {
Expand Down
14 changes: 3 additions & 11 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,24 @@
#![needs_allocator]
#![deny(missing_debug_implementations)]

#![cfg_attr(test, allow(deprecated))] // rand
#![cfg_attr(not(test), feature(exact_size_is_empty))]
#![cfg_attr(not(test), feature(fn_traits))]
#![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(test, feature(rand, test))]
#![cfg_attr(test, feature(test))]

#![feature(allocator_api)]
#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
#![feature(ascii_ctype)]
#![feature(box_into_raw_non_null)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(cfg_target_has_atomic)]
#![feature(coerce_unsized)]
#![feature(collections_range)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(custom_attribute)]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(fmt_internals)]
#![feature(from_ref)]
#![feature(fundamental)]
#![feature(futures_api)]
#![feature(lang_items)]
Expand All @@ -118,14 +115,9 @@
#![feature(allocator_internals)]
#![feature(on_unimplemented)]
#![feature(exact_chunks)]
#![feature(pointer_methods)]
#![feature(inclusive_range_methods)]
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]

#![cfg_attr(not(test), feature(fn_traits, i128))]
#![cfg_attr(test, feature(test))]

// Allow testing this library

#[cfg(test)]
Expand Down
3 changes: 0 additions & 3 deletions src/liballoc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
#![feature(drain_filter)]
#![feature(exact_size_is_empty)]
#![feature(pattern)]
#![feature(rand)]
#![feature(slice_sort_by_cached_key)]
#![feature(splice)]
#![feature(str_escape)]
#![feature(string_retain)]
#![feature(try_reserve)]
#![feature(unboxed_closures)]
#![feature(exact_chunks)]
Expand Down
20 changes: 0 additions & 20 deletions src/libcore/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1084,8 +1082,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1118,8 +1114,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1155,8 +1149,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1189,8 +1181,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1226,8 +1216,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1264,8 +1252,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1298,8 +1284,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1349,8 +1333,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down Expand Up @@ -1385,8 +1367,6 @@ impl char {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = 'A';
/// let uppercase_g = 'G';
/// let a = 'a';
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#![feature(concat_idents)]
#![feature(const_fn)]
#![feature(const_int_ops)]
#![feature(core_float)]
#![feature(custom_attribute)]
#![feature(doc_cfg)]
#![feature(doc_spotlight)]
Expand All @@ -102,16 +101,13 @@
#![feature(rustc_attrs)]
#![feature(rustc_const_unstable)]
#![feature(simd_ffi)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![feature(specialization)]
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
#![feature(unboxed_closures)]
#![feature(untagged_unions)]
#![feature(unwind_attributes)]
#![feature(doc_alias)]
#![feature(inclusive_range_methods)]
#![feature(mmx_target_feature)]
#![feature(tbm_target_feature)]
#![feature(sse4a_target_feature)]
Expand Down
20 changes: 0 additions & 20 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3761,8 +3761,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3799,8 +3797,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3837,8 +3833,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3878,8 +3872,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3916,8 +3908,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3957,8 +3947,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -3999,8 +3987,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -4037,8 +4023,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -4092,8 +4076,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down Expand Up @@ -4132,8 +4114,6 @@ impl u8 {
/// # Examples
///
/// ```
/// #![feature(ascii_ctype)]
///
/// let uppercase_a = b'A';
/// let uppercase_g = b'G';
/// let a = b'a';
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
fn index_mut(self, slice: &mut T) -> &mut Self::Output;
}

#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for usize {
type Output = T;

Expand Down Expand Up @@ -2056,7 +2056,7 @@ impl<T> SliceIndex<[T]> for usize {
}
}

#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::Range<usize> {
type Output = [T];

Expand Down Expand Up @@ -2117,7 +2117,7 @@ impl<T> SliceIndex<[T]> for ops::Range<usize> {
}
}

#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
type Output = [T];

Expand Down Expand Up @@ -2152,7 +2152,7 @@ impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
}
}

#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
type Output = [T];

Expand Down Expand Up @@ -2187,7 +2187,7 @@ impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
}
}

#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
impl<T> SliceIndex<[T]> for ops::RangeFull {
type Output = [T];

Expand Down
5 changes: 0 additions & 5 deletions src/libcore/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(ascii_ctype)]
#![feature(box_syntax)]
#![feature(cell_update)]
#![feature(core_float)]
#![feature(core_private_bignum)]
#![feature(core_private_diy_float)]
#![feature(dec2flt)]
#![feature(decode_utf8)]
#![feature(euclidean_division)]
#![feature(exact_size_is_empty)]
#![feature(fixed_size_array)]
#![feature(float_internals)]
#![feature(flt2dec)]
#![feature(fmt_internals)]
#![feature(hashmap_internals)]
Expand All @@ -29,7 +25,6 @@
#![feature(refcell_map_split)]
#![feature(refcell_replace_swap)]
#![feature(slice_patterns)]
#![feature(slice_rotate)]
#![feature(sort_internals)]
#![feature(specialization)]
#![feature(step_trait)]
Expand Down
1 change: 0 additions & 1 deletion src/libpanic_unwind/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#![feature(staged_api)]
#![feature(std_internals)]
#![feature(unwind_attributes)]
#![cfg_attr(target_env = "msvc", feature(raw))]

#![panic_runtime]
#![feature(panic_runtime)]
Expand Down
4 changes: 3 additions & 1 deletion src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ define_dep_nodes!( <'tcx>
[input] CrateName(CrateNum),
[] ItemChildren(DefId),
[] ExternModStmtCnum(DefId),
[input] GetLangItems,
[eval_always] GetLibFeatures,
[] DefinedLibFeatures(CrateNum),
[eval_always] GetLangItems,
[] DefinedLangItems(CrateNum),
[] MissingLangItems(CrateNum),
[] VisibleParentMap,
Expand Down
Loading