1
Fork 0

Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr

Ensure stability directives are checked in all cases

Split off  #93017

Stability and deprecation were not checked in all cases, for instance if a type error happened.
This PR moves the check earlier in the pipeline to ensure the errors are emitted in all cases.

r? `@lcnr`
This commit is contained in:
bors 2022-03-04 05:49:14 +00:00
commit 65f6d33b77
133 changed files with 530 additions and 510 deletions

View file

@ -420,6 +420,31 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
} }
} }
} }
// Emit errors for non-staged-api crates.
if !self.features.staged_api {
if attr.has_name(sym::rustc_deprecated)
|| attr.has_name(sym::unstable)
|| attr.has_name(sym::stable)
|| attr.has_name(sym::rustc_const_unstable)
|| attr.has_name(sym::rustc_const_stable)
{
struct_span_err!(
self.sess,
attr.span,
E0734,
"stability attributes may not be used outside of the standard library",
)
.emit();
}
} else {
if attr.has_name(sym::deprecated) {
self.sess
.struct_span_err(attr.span, "`#[deprecated]` cannot be used in staged API")
.span_label(attr.span, "use `#[rustc_deprecated]` instead")
.emit();
}
}
} }
fn visit_item(&mut self, i: &'a ast::Item) { fn visit_item(&mut self, i: &'a ast::Item) {

View file

@ -167,6 +167,7 @@ fn get_features(
if let Some(Feature { since, .. }) = ACCEPTED_FEATURES.iter().find(|f| name == f.name) { if let Some(Feature { since, .. }) = ACCEPTED_FEATURES.iter().find(|f| name == f.name) {
let since = Some(Symbol::intern(since)); let since = Some(Symbol::intern(since));
features.declared_lang_features.push((name, mi.span(), since)); features.declared_lang_features.push((name, mi.span(), since));
features.active_features.insert(name);
continue; continue;
} }
@ -187,10 +188,12 @@ fn get_features(
if let Some(f) = ACTIVE_FEATURES.iter().find(|f| name == f.name) { if let Some(f) = ACTIVE_FEATURES.iter().find(|f| name == f.name) {
f.set(&mut features, mi.span()); f.set(&mut features, mi.span());
features.declared_lang_features.push((name, mi.span(), None)); features.declared_lang_features.push((name, mi.span(), None));
features.active_features.insert(name);
continue; continue;
} }
features.declared_lib_features.push((name, mi.span())); features.declared_lib_features.push((name, mi.span()));
features.active_features.insert(name);
} }
} }

View file

@ -2,6 +2,7 @@
use super::{to_nonzero, Feature, State}; use super::{to_nonzero, Feature, State};
use rustc_data_structures::fx::FxHashSet;
use rustc_span::edition::Edition; use rustc_span::edition::Edition;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span; use rustc_span::Span;
@ -47,6 +48,8 @@ macro_rules! declare_features {
pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>, pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,
/// `#![feature]` attrs for non-language (library) features. /// `#![feature]` attrs for non-language (library) features.
pub declared_lib_features: Vec<(Symbol, Span)>, pub declared_lib_features: Vec<(Symbol, Span)>,
/// Features enabled for this crate.
pub active_features: FxHashSet<Symbol>,
$( $(
$(#[doc = $doc])* $(#[doc = $doc])*
pub $feature: bool pub $feature: bool
@ -58,6 +61,11 @@ macro_rules! declare_features {
$(f(stringify!($feature), self.$feature);)+ $(f(stringify!($feature), self.$feature);)+
} }
/// Is the given feature active?
pub fn active(&self, feature: Symbol) -> bool {
self.active_features.contains(&feature)
}
/// Is the given feature enabled? /// Is the given feature enabled?
/// ///
/// Panics if the symbol doesn't correspond to a declared feature. /// Panics if the symbol doesn't correspond to a declared feature.

View file

@ -921,12 +921,18 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
tcx.ensure().check_mod_const_bodies(module); tcx.ensure().check_mod_const_bodies(module);
}); });
}, },
{
sess.time("unused_lib_feature_checking", || {
rustc_passes::stability::check_unused_or_stable_features(tcx)
});
},
{ {
// We force these querie to run, // We force these querie to run,
// since they might not otherwise get called. // since they might not otherwise get called.
// This marks the corresponding crate-level attributes // This marks the corresponding crate-level attributes
// as used, and ensures that their values are valid. // as used, and ensures that their values are valid.
tcx.ensure().limits(()); tcx.ensure().limits(());
tcx.ensure().stability_index(());
} }
); );
}); });
@ -998,11 +1004,6 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
tcx.hir() tcx.hir()
.par_for_each_module(|module| tcx.ensure().check_mod_deathness(module)); .par_for_each_module(|module| tcx.ensure().check_mod_deathness(module));
}, },
{
sess.time("unused_lib_feature_checking", || {
rustc_passes::stability::check_unused_or_stable_features(tcx)
});
},
{ {
sess.time("lint_checking", || { sess.time("lint_checking", || {
rustc_lint::check_crate(tcx, || { rustc_lint::check_crate(tcx, || {

View file

@ -6,12 +6,12 @@ pub use self::StabilityLevel::*;
use crate::ty::{self, DefIdTree, TyCtxt}; use crate::ty::{self, DefIdTree, TyCtxt};
use rustc_ast::NodeId; use rustc_ast::NodeId;
use rustc_attr::{self as attr, ConstStability, Deprecation, Stability}; use rustc_attr::{self as attr, ConstStability, Deprecation, Stability};
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{Applicability, Diagnostic}; use rustc_errors::{Applicability, Diagnostic};
use rustc_feature::GateIssue; use rustc_feature::GateIssue;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX}; use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_INDEX};
use rustc_hir::{self, HirId}; use rustc_hir::{self, HirId};
use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE}; use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
@ -63,12 +63,6 @@ pub struct Index {
pub stab_map: FxHashMap<LocalDefId, Stability>, pub stab_map: FxHashMap<LocalDefId, Stability>,
pub const_stab_map: FxHashMap<LocalDefId, ConstStability>, pub const_stab_map: FxHashMap<LocalDefId, ConstStability>,
pub depr_map: FxHashMap<LocalDefId, DeprecationEntry>, pub depr_map: FxHashMap<LocalDefId, DeprecationEntry>,
/// Maps for each crate whether it is part of the staged API.
pub staged_api: FxHashMap<CrateNum, bool>,
/// Features enabled for this crate.
pub active_features: FxHashSet<Symbol>,
} }
impl Index { impl Index {
@ -423,7 +417,7 @@ impl<'tcx> TyCtxt<'tcx> {
debug!("stability: skipping span={:?} since it is internal", span); debug!("stability: skipping span={:?} since it is internal", span);
return EvalResult::Allow; return EvalResult::Allow;
} }
if self.stability().active_features.contains(&feature) { if self.features().active(feature) {
return EvalResult::Allow; return EvalResult::Allow;
} }

View file

@ -2999,11 +2999,6 @@ pub fn provide(providers: &mut ty::query::Providers) {
tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default()) tcx.arena.alloc(tcx.resolutions(()).glob_map.get(&id).cloned().unwrap_or_default())
}; };
providers.lookup_stability = |tcx, id| tcx.stability().local_stability(id.expect_local());
providers.lookup_const_stability =
|tcx, id| tcx.stability().local_const_stability(id.expect_local());
providers.lookup_deprecation_entry =
|tcx, id| tcx.stability().local_deprecation_entry(id.expect_local());
providers.extern_mod_stmt_cnum = providers.extern_mod_stmt_cnum =
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned(); |tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
providers.output_filenames = |tcx, ()| &tcx.output_filenames; providers.output_filenames = |tcx, ()| &tcx.output_filenames;

View file

@ -1,13 +1,12 @@
//! A pass that annotates every item and method with its stability level, //! A pass that annotates every item and method with its stability level,
//! propagating default levels lexically from parent to children ast nodes. //! propagating default levels lexically from parent to children ast nodes.
use rustc_ast::Attribute;
use rustc_attr::{self as attr, ConstStability, Stability}; use rustc_attr::{self as attr, ConstStability, Stability};
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_errors::struct_span_err; use rustc_errors::struct_span_err;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res}; use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, CRATE_DEF_INDEX};
use rustc_hir::hir_id::CRATE_HIR_ID; use rustc_hir::hir_id::CRATE_HIR_ID;
use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{FieldDef, Generics, HirId, Item, TraitRef, Ty, TyKind, Variant}; use rustc_hir::{FieldDef, Generics, HirId, Item, TraitRef, Ty, TyKind, Variant};
@ -113,12 +112,8 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
{ {
let attrs = self.tcx.get_attrs(def_id.to_def_id()); let attrs = self.tcx.get_attrs(def_id.to_def_id());
debug!("annotate(id = {:?}, attrs = {:?})", def_id, attrs); debug!("annotate(id = {:?}, attrs = {:?})", def_id, attrs);
let mut did_error = false;
if !self.tcx.features().staged_api {
did_error = self.forbid_staged_api_attrs(def_id, attrs, inherit_deprecation.clone());
}
let depr = if did_error { None } else { attr::find_deprecation(&self.tcx.sess, attrs) }; let depr = attr::find_deprecation(&self.tcx.sess, attrs);
let mut is_deprecated = false; let mut is_deprecated = false;
if let Some((depr, span)) = &depr { if let Some((depr, span)) = &depr {
is_deprecated = true; is_deprecated = true;
@ -148,16 +143,15 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
} }
} }
if self.tcx.features().staged_api { if !self.tcx.features().staged_api {
if let Some(a) = attrs.iter().find(|a| a.has_name(sym::deprecated)) { // Propagate unstability. This can happen even for non-staged-api crates in case
self.tcx // -Zforce-unstable-if-unmarked is set.
.sess if let Some(stab) = self.parent_stab {
.struct_span_err(a.span, "`#[deprecated]` cannot be used in staged API") if inherit_deprecation.yes() && stab.level.is_unstable() {
.span_label(a.span, "use `#[rustc_deprecated]` instead") self.index.stab_map.insert(def_id, stab);
.span_label(item_sp, "") }
.emit();
} }
} else {
self.recurse_with_stability_attrs( self.recurse_with_stability_attrs(
depr.map(|(d, _)| DeprecationEntry::local(d, def_id)), depr.map(|(d, _)| DeprecationEntry::local(d, def_id)),
None, None,
@ -329,47 +323,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
self.parent_const_stab = orig_parent_const_stab; self.parent_const_stab = orig_parent_const_stab;
} }
} }
// returns true if an error occurred, used to suppress some spurious errors
fn forbid_staged_api_attrs(
&mut self,
def_id: LocalDefId,
attrs: &[Attribute],
inherit_deprecation: InheritDeprecation,
) -> bool {
// Emit errors for non-staged-api crates.
let unstable_attrs = [
sym::unstable,
sym::stable,
sym::rustc_deprecated,
sym::rustc_const_unstable,
sym::rustc_const_stable,
];
let mut has_error = false;
for attr in attrs {
let name = attr.name_or_empty();
if unstable_attrs.contains(&name) {
struct_span_err!(
self.tcx.sess,
attr.span,
E0734,
"stability attributes may not be used outside of the standard library",
)
.emit();
has_error = true;
}
}
// Propagate unstability. This can happen even for non-staged-api crates in case
// -Zforce-unstable-if-unmarked is set.
if let Some(stab) = self.parent_stab {
if inherit_deprecation.yes() && stab.level.is_unstable() {
self.index.stab_map.insert(def_id, stab);
}
}
has_error
}
} }
impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> { impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
@ -654,28 +607,12 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
} }
fn stability_index(tcx: TyCtxt<'_>, (): ()) -> Index { fn stability_index(tcx: TyCtxt<'_>, (): ()) -> Index {
let is_staged_api =
tcx.sess.opts.debugging_opts.force_unstable_if_unmarked || tcx.features().staged_api;
let mut staged_api = FxHashMap::default();
staged_api.insert(LOCAL_CRATE, is_staged_api);
let mut index = Index { let mut index = Index {
staged_api,
stab_map: Default::default(), stab_map: Default::default(),
const_stab_map: Default::default(), const_stab_map: Default::default(),
depr_map: Default::default(), depr_map: Default::default(),
active_features: Default::default(),
}; };
let active_lib_features = &tcx.features().declared_lib_features;
let active_lang_features = &tcx.features().declared_lang_features;
// Put the active features into a map for quick lookup.
index.active_features = active_lib_features
.iter()
.map(|&(s, ..)| s)
.chain(active_lang_features.iter().map(|&(s, ..)| s))
.collect();
{ {
let mut annotator = Annotator { let mut annotator = Annotator {
tcx, tcx,
@ -728,7 +665,16 @@ fn check_mod_unstable_api_usage(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
} }
pub(crate) fn provide(providers: &mut Providers) { pub(crate) fn provide(providers: &mut Providers) {
*providers = Providers { check_mod_unstable_api_usage, stability_index, ..*providers }; *providers = Providers {
check_mod_unstable_api_usage,
stability_index,
lookup_stability: |tcx, id| tcx.stability().local_stability(id.expect_local()),
lookup_const_stability: |tcx, id| tcx.stability().local_const_stability(id.expect_local()),
lookup_deprecation_entry: |tcx, id| {
tcx.stability().local_deprecation_entry(id.expect_local())
},
..*providers
};
} }
struct Checker<'tcx> { struct Checker<'tcx> {
@ -884,9 +830,10 @@ impl<'tcx> Visitor<'tcx> for CheckTraitImplStable<'tcx> {
/// were expected to be library features), and the list of features used from /// were expected to be library features), and the list of features used from
/// libraries, identify activated features that don't exist and error about them. /// libraries, identify activated features that don't exist and error about them.
pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) { pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
let access_levels = &tcx.privacy_access_levels(()); let is_staged_api =
tcx.sess.opts.debugging_opts.force_unstable_if_unmarked || tcx.features().staged_api;
if tcx.stability().staged_api[&LOCAL_CRATE] { if is_staged_api {
let access_levels = &tcx.privacy_access_levels(());
let mut missing = MissingStabilityAnnotations { tcx, access_levels }; let mut missing = MissingStabilityAnnotations { tcx, access_levels };
missing.check_missing_stability(CRATE_DEF_ID, tcx.hir().span(CRATE_HIR_ID)); missing.check_missing_stability(CRATE_DEF_ID, tcx.hir().span(CRATE_HIR_ID));
tcx.hir().walk_toplevel_module(&mut missing); tcx.hir().walk_toplevel_module(&mut missing);
@ -907,7 +854,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
} }
let declared_lib_features = &tcx.features().declared_lib_features; let declared_lib_features = &tcx.features().declared_lib_features;
let mut remaining_lib_features = FxHashMap::default(); let mut remaining_lib_features = FxIndexMap::default();
for (feature, span) in declared_lib_features { for (feature, span) in declared_lib_features {
if !tcx.sess.opts.unstable_features.is_nightly_build() { if !tcx.sess.opts.unstable_features.is_nightly_build() {
struct_span_err!( struct_span_err!(
@ -934,7 +881,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
remaining_lib_features.remove(&sym::libc); remaining_lib_features.remove(&sym::libc);
remaining_lib_features.remove(&sym::test); remaining_lib_features.remove(&sym::test);
let check_features = |remaining_lib_features: &mut FxHashMap<_, _>, defined_features: &[_]| { let check_features = |remaining_lib_features: &mut FxIndexMap<_, _>, defined_features: &[_]| {
for &(feature, since) in defined_features { for &(feature, since) in defined_features {
if let Some(since) = since { if let Some(since) = since {
if let Some(span) = remaining_lib_features.get(&feature) { if let Some(span) = remaining_lib_features.get(&feature) {

View file

@ -1,6 +1,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(alloc_error_handler, panic_handler)] #![feature(alloc_error_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,6 +1,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(alloc_error_handler, panic_handler)] #![feature(alloc_error_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,6 +1,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(alloc_error_handler, panic_handler)] #![feature(alloc_error_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -4,7 +4,6 @@
// ignore-wasm32 // ignore-wasm32
#![feature(naked_functions)] #![feature(naked_functions)]
#![feature(or_patterns)]
#![feature(asm_const, asm_sym, asm_unwind)] #![feature(asm_const, asm_sym, asm_unwind)]
#![crate_type = "lib"] #![crate_type = "lib"]

View file

@ -1,35 +1,35 @@
error: asm with the `pure` option must have at least one output error: asm with the `pure` option must have at least one output
--> $DIR/naked-functions.rs:111:14 --> $DIR/naked-functions.rs:110:14
| |
LL | asm!("", options(readonly, nostack), options(pure)); LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
error: patterns not allowed in naked function parameters error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:21:5 --> $DIR/naked-functions.rs:20:5
| |
LL | mut a: u32, LL | mut a: u32,
| ^^^^^ | ^^^^^
error: patterns not allowed in naked function parameters error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:23:5 --> $DIR/naked-functions.rs:22:5
| |
LL | &b: &i32, LL | &b: &i32,
| ^^ | ^^
error: patterns not allowed in naked function parameters error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:25:6 --> $DIR/naked-functions.rs:24:6
| |
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>, LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: patterns not allowed in naked function parameters error: patterns not allowed in naked function parameters
--> $DIR/naked-functions.rs:27:5 --> $DIR/naked-functions.rs:26:5
| |
LL | P { x, y }: P, LL | P { x, y }: P,
| ^^^^^^^^^^ | ^^^^^^^^^^
error: referencing function parameters is not allowed in naked functions error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:36:5 --> $DIR/naked-functions.rs:35:5
| |
LL | a + 1 LL | a + 1
| ^ | ^
@ -37,7 +37,7 @@ LL | a + 1
= help: follow the calling convention in asm block to use parameters = help: follow the calling convention in asm block to use parameters
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:34:1 --> $DIR/naked-functions.rs:33:1
| |
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 { LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
LL | | LL | |
@ -48,7 +48,7 @@ LL | | }
| |_^ | |_^
error: referencing function parameters is not allowed in naked functions error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:42:31 --> $DIR/naked-functions.rs:41:31
| |
LL | asm!("/* {0} */", in(reg) a, options(noreturn)); LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^ | ^
@ -56,13 +56,13 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
= help: follow the calling convention in asm block to use parameters = help: follow the calling convention in asm block to use parameters
error[E0787]: only `const` and `sym` operands are supported in naked functions error[E0787]: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:42:23 --> $DIR/naked-functions.rs:41:23
| |
LL | asm!("/* {0} */", in(reg) a, options(noreturn)); LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^^^^^^^^^ | ^^^^^^^^^
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:48:1 --> $DIR/naked-functions.rs:47:1
| |
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 { LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
LL | | LL | |
@ -72,7 +72,7 @@ LL | | }
| |_^ | |_^
error[E0787]: only `const` and `sym` operands are supported in naked functions error[E0787]: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:65:10 --> $DIR/naked-functions.rs:64:10
| |
LL | in(reg) a, LL | in(reg) a,
| ^^^^^^^^^ | ^^^^^^^^^
@ -87,7 +87,7 @@ LL | out(reg) e,
| ^^^^^^^^^^ | ^^^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:63:5 --> $DIR/naked-functions.rs:62:5
| |
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */", LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
LL | | LL | |
@ -99,7 +99,7 @@ LL | | );
| |_____^ | |_____^
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:54:1 --> $DIR/naked-functions.rs:53:1
| |
LL | / pub unsafe extern "C" fn unsupported_operands() { LL | / pub unsafe extern "C" fn unsupported_operands() {
LL | | LL | |
@ -119,7 +119,7 @@ LL | | }
| |_^ | |_^
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:77:1 --> $DIR/naked-functions.rs:76:1
| |
LL | / pub extern "C" fn missing_assembly() { LL | / pub extern "C" fn missing_assembly() {
LL | | LL | |
@ -127,25 +127,25 @@ LL | | }
| |_^ | |_^
error[E0787]: asm in naked functions must use `noreturn` option error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:84:5 --> $DIR/naked-functions.rs:83:5
| |
LL | asm!(""); LL | asm!("");
| ^^^^^^^^ | ^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:86:5 --> $DIR/naked-functions.rs:85:5
| |
LL | asm!(""); LL | asm!("");
| ^^^^^^^^ | ^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:88:5 --> $DIR/naked-functions.rs:87:5
| |
LL | asm!(""); LL | asm!("");
| ^^^^^^^^ | ^^^^^^^^
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:82:1 --> $DIR/naked-functions.rs:81:1
| |
LL | / pub extern "C" fn too_many_asm_blocks() { LL | / pub extern "C" fn too_many_asm_blocks() {
LL | | LL | |
@ -163,7 +163,7 @@ LL | | }
| |_^ | |_^
error: referencing function parameters is not allowed in naked functions error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:97:11 --> $DIR/naked-functions.rs:96:11
| |
LL | *&y LL | *&y
| ^ | ^
@ -171,7 +171,7 @@ LL | *&y
= help: follow the calling convention in asm block to use parameters = help: follow the calling convention in asm block to use parameters
error[E0787]: naked functions must contain a single asm block error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:95:5 --> $DIR/naked-functions.rs:94:5
| |
LL | / pub extern "C" fn inner(y: usize) -> usize { LL | / pub extern "C" fn inner(y: usize) -> usize {
LL | | LL | |
@ -182,31 +182,31 @@ LL | | }
| |_____^ | |_____^
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags` error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
--> $DIR/naked-functions.rs:105:5 --> $DIR/naked-functions.rs:104:5
| |
LL | asm!("", options(nomem, preserves_flags, noreturn)); LL | asm!("", options(nomem, preserves_flags, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly` error[E0787]: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
--> $DIR/naked-functions.rs:111:5 --> $DIR/naked-functions.rs:110:5
| |
LL | asm!("", options(readonly, nostack), options(pure)); LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:111:5 --> $DIR/naked-functions.rs:110:5
| |
LL | asm!("", options(readonly, nostack), options(pure)); LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0787]: asm options unsupported in naked functions: `may_unwind` error[E0787]: asm options unsupported in naked functions: `may_unwind`
--> $DIR/naked-functions.rs:119:5 --> $DIR/naked-functions.rs:118:5
| |
LL | asm!("", options(noreturn, may_unwind)); LL | asm!("", options(noreturn, may_unwind));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: Rust ABI is unsupported in naked functions warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:124:15 --> $DIR/naked-functions.rs:123:15
| |
LL | pub unsafe fn default_abi() { LL | pub unsafe fn default_abi() {
| ^^^^^^^^^^^ | ^^^^^^^^^^^
@ -214,43 +214,43 @@ LL | pub unsafe fn default_abi() {
= note: `#[warn(undefined_naked_function_abi)]` on by default = note: `#[warn(undefined_naked_function_abi)]` on by default
warning: Rust ABI is unsupported in naked functions warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:130:15 --> $DIR/naked-functions.rs:129:15
| |
LL | pub unsafe fn rust_abi() { LL | pub unsafe fn rust_abi() {
| ^^^^^^^^ | ^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:170:1 --> $DIR/naked-functions.rs:169:1
| |
LL | #[inline] LL | #[inline]
| ^^^^^^^^^ | ^^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:177:1 --> $DIR/naked-functions.rs:176:1
| |
LL | #[inline(always)] LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:184:1 --> $DIR/naked-functions.rs:183:1
| |
LL | #[inline(never)] LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:191:1 --> $DIR/naked-functions.rs:190:1
| |
LL | #[inline] LL | #[inline]
| ^^^^^^^^^ | ^^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:193:1 --> $DIR/naked-functions.rs:192:1
| |
LL | #[inline(always)] LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: naked functions cannot be inlined error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:195:1 --> $DIR/naked-functions.rs:194:1
| |
LL | #[inline(never)] LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^

View file

@ -1,7 +1,5 @@
// #29924 // #29924
#![feature(associated_consts)]
trait Trait { trait Trait {
const N: usize; const N: usize;
} }

View file

@ -1,11 +1,11 @@
error[E0038]: the trait `Trait` cannot be made into an object error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/associated-const-in-trait.rs:9:6 --> $DIR/associated-const-in-trait.rs:7:6
| |
LL | impl dyn Trait { LL | impl dyn Trait {
| ^^^^^^^^^ `Trait` cannot be made into an object | ^^^^^^^^^ `Trait` cannot be made into an object
| |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/associated-const-in-trait.rs:6:11 --> $DIR/associated-const-in-trait.rs:4:11
| |
LL | trait Trait { LL | trait Trait {
| ----- this trait cannot be made into an object... | ----- this trait cannot be made into an object...

View file

@ -1,4 +1,4 @@
#![feature(try_trait, async_closure)] #![feature(async_closure)]
// edition:2018 // edition:2018
fn main() {} fn main() {}

View file

@ -1,3 +1,6 @@
#![feature(staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "foo", since = "0")] #[rustc_const_stable(feature = "foo", since = "0")]
//~^ ERROR macros cannot have const stability attributes //~^ ERROR macros cannot have const stability attributes
macro_rules! foo { macro_rules! foo {

View file

@ -1,5 +1,5 @@
error: macros cannot have const stability attributes error: macros cannot have const stability attributes
--> $DIR/const-stability-on-macro.rs:1:1 --> $DIR/const-stability-on-macro.rs:4:1
| |
LL | #[rustc_const_stable(feature = "foo", since = "0")] LL | #[rustc_const_stable(feature = "foo", since = "0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute
@ -8,7 +8,7 @@ LL | macro_rules! foo {
| ---------------- const stability attribute affects this macro | ---------------- const stability attribute affects this macro
error: macros cannot have const stability attributes error: macros cannot have const stability attributes
--> $DIR/const-stability-on-macro.rs:7:1 --> $DIR/const-stability-on-macro.rs:10:1
| |
LL | #[rustc_const_unstable(feature = "bar", issue="none")] LL | #[rustc_const_unstable(feature = "bar", issue="none")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute

View file

@ -1,6 +1,5 @@
// normalize-stderr-test: "couldn't read.*" -> "couldn't read the file" // normalize-stderr-test: "couldn't read.*" -> "couldn't read the file"
#![feature(extended_key_value_attributes)]
#![doc = include_str!("../not_existing_file.md")] #![doc = include_str!("../not_existing_file.md")]
struct Documented {} struct Documented {}
//~^^ ERROR couldn't read //~^^ ERROR couldn't read

View file

@ -1,5 +1,5 @@
error: couldn't read the file error: couldn't read the file
--> $DIR/extented-attribute-macro-error.rs:4:10 --> $DIR/extented-attribute-macro-error.rs:3:10
| |
LL | #![doc = include_str!("../not_existing_file.md")] LL | #![doc = include_str!("../not_existing_file.md")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,4 +1,4 @@
#![feature(generic_const_exprs, array_map)] #![feature(generic_const_exprs)]
#![allow(incomplete_features)] #![allow(incomplete_features)]
pub struct ConstCheck<const CHECK: bool>; pub struct ConstCheck<const CHECK: bool>;

View file

@ -1,5 +1,3 @@
#![feature(const_indexing)]
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47]; const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
const IDX: usize = 3; const IDX: usize = 3;
const VAL: i32 = ARR[IDX]; const VAL: i32 = ARR[IDX];

View file

@ -1,11 +1,11 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/const-array-oob-arith.rs:7:45 --> $DIR/const-array-oob-arith.rs:5:45
| |
LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5];
| ^^^ expected an array with a fixed size of 2 elements, found one with 1 element | ^^^ expected an array with a fixed size of 2 elements, found one with 1 element
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/const-array-oob-arith.rs:10:44 --> $DIR/const-array-oob-arith.rs:8:44
| |
LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99];
| ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements | ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements

View file

@ -1,5 +1,3 @@
#![feature(const_indexing)]
const FOO: [usize; 3] = [1, 2, 3]; const FOO: [usize; 3] = [1, 2, 3];
const BAR: usize = FOO[5]; // no error, because the error below occurs before regular const eval const BAR: usize = FOO[5]; // no error, because the error below occurs before regular const eval

View file

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed error[E0080]: evaluation of constant value failed
--> $DIR/const-array-oob.rs:6:19 --> $DIR/const-array-oob.rs:4:19
| |
LL | const BLUB: [u32; FOO[4]] = [5, 6]; LL | const BLUB: [u32; FOO[4]] = [5, 6];
| ^^^^^^ index out of bounds: the length is 3 but the index is 4 | ^^^^^^ index out of bounds: the length is 3 but the index is 4

View file

@ -1,5 +1,3 @@
#![feature(const_transmute)]
use std::mem; use std::mem;
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed error[E0716]: temporary value dropped while borrowed
--> $DIR/transmute-const-promotion.rs:6:37 --> $DIR/transmute-const-promotion.rs:4:37
| |
LL | let x: &'static u32 = unsafe { &mem::transmute(3.0f32) }; LL | let x: &'static u32 = unsafe { &mem::transmute(3.0f32) };
| ------------ ^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use | ------------ ^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use

View file

@ -2,7 +2,6 @@
#![crate_type="lib"] #![crate_type="lib"]
#![allow(unreachable_patterns)] #![allow(unreachable_patterns)]
#![feature(const_fn_union)]
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
#[repr(transparent)] #[repr(transparent)]

View file

@ -1,5 +1,5 @@
error: cannot use unsized non-slice type `Username` in constant patterns error: cannot use unsized non-slice type `Username` in constant patterns
--> $DIR/issue-87046.rs:29:13 --> $DIR/issue-87046.rs:28:13
| |
LL | ROOT_USER => true, LL | ROOT_USER => true,
| ^^^^^^^^^ | ^^^^^^^^^

View file

@ -1,5 +1,6 @@
#![feature(rustc_attrs, staged_api, rustc_allow_const_fn_unstable)] #![feature(rustc_attrs, staged_api, rustc_allow_const_fn_unstable)]
#![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_fn_ptr_basics)]
#![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(since="1.0.0", feature = "mep")] #[rustc_const_stable(since="1.0.0", feature = "mep")]

View file

@ -1,5 +1,5 @@
error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]` error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]`
--> $DIR/allow_const_fn_ptr.rs:6:16 --> $DIR/allow_const_fn_ptr.rs:7:16
| |
LL | const fn error(_: fn()) {} LL | const fn error(_: fn()) {}
| ^ | ^

View file

@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 }
// can't call non-min_const_fn // can't call non-min_const_fn
const fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn const fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn
#[unstable(feature = "rust1", issue = "none")] #[unstable(feature = "foo2", issue = "none")]
const fn foo2() -> u32 { 42 } const fn foo2() -> u32 { 42 }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View file

@ -15,7 +15,7 @@ const unsafe fn foo() -> u32 { 42 }
// can't call non-min_const_fn // can't call non-min_const_fn
const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR not yet stable as a const fn const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR not yet stable as a const fn
#[unstable(feature = "rust1", issue = "none")] #[unstable(feature = "foo2", issue = "none")]
const unsafe fn foo2() -> u32 { 42 } const unsafe fn foo2() -> u32 { 42 }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View file

@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 }
// can't call non-min_const_fn // can't call non-min_const_fn
const unsafe fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn const unsafe fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn
#[unstable(feature = "rust1", issue = "none")] #[unstable(feature = "foo2", issue = "none")]
const fn foo2() -> u32 { 42 } const fn foo2() -> u32 { 42 }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View file

@ -1,5 +1,3 @@
#![feature(const_transmute)]
// normalize-stderr-64bit "64 bits" -> "word size" // normalize-stderr-64bit "64 bits" -> "word size"
// normalize-stderr-32bit "32 bits" -> "word size" // normalize-stderr-32bit "32 bits" -> "word size"
// normalize-stderr-64bit "128 bits" -> "2 * word size" // normalize-stderr-64bit "128 bits" -> "2 * word size"

View file

@ -1,5 +1,5 @@
error: any use of this value will cause an error error: any use of this value will cause an error
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29 --> $DIR/transmute-size-mismatch-before-typeck.rs:13:29
| |
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^--- | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@ -11,13 +11,13 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: could not evaluate constant pattern error: could not evaluate constant pattern
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9 --> $DIR/transmute-size-mismatch-before-typeck.rs:8:9
| |
LL | ZST => {} LL | ZST => {}
| ^^^ | ^^^
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29 --> $DIR/transmute-size-mismatch-before-typeck.rs:13:29
| |
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
= note: target type: `&[u8]` (2 * word size) = note: target type: `&[u8]` (2 * word size)
error: could not evaluate constant pattern error: could not evaluate constant pattern
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9 --> $DIR/transmute-size-mismatch-before-typeck.rs:8:9
| |
LL | ZST => {} LL | ZST => {}
| ^^^ | ^^^

View file

@ -4,7 +4,6 @@
// gate was not enabled in libcore. // gate was not enabled in libcore.
#![stable(feature = "core", since = "1.6.0")] #![stable(feature = "core", since = "1.6.0")]
#![feature(rustc_const_unstable)]
#![feature(staged_api)] #![feature(staged_api)]
#![feature(const_fn_trait_bound)] #![feature(const_fn_trait_bound)]

View file

@ -1,5 +1,5 @@
error[E0015]: cannot call non-const closure in constant functions error[E0015]: cannot call non-const closure in constant functions
--> $DIR/unstable-const-fn-in-libcore.rs:24:26 --> $DIR/unstable-const-fn-in-libcore.rs:23:26
| |
LL | Opt::None => f(), LL | Opt::None => f(),
| ^^^ | ^^^
@ -11,7 +11,7 @@ LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>
| +++++++++++++++++++++++++++++ | +++++++++++++++++++++++++++++
error[E0493]: destructors cannot be evaluated at compile-time error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/unstable-const-fn-in-libcore.rs:19:53 --> $DIR/unstable-const-fn-in-libcore.rs:18:53
| |
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
| ^ constant functions cannot evaluate destructors | ^ constant functions cannot evaluate destructors
@ -20,7 +20,7 @@ LL | }
| - value is dropped here | - value is dropped here
error[E0493]: destructors cannot be evaluated at compile-time error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/unstable-const-fn-in-libcore.rs:19:47 --> $DIR/unstable-const-fn-in-libcore.rs:18:47
| |
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
| ^^^^ constant functions cannot evaluate destructors | ^^^^ constant functions cannot evaluate destructors

View file

@ -3,8 +3,6 @@ error: `#[deprecated]` cannot be used in staged API
| |
LL | #[deprecated] LL | #[deprecated]
| ^^^^^^^^^^^^^ use `#[rustc_deprecated]` instead | ^^^^^^^^^^^^^ use `#[rustc_deprecated]` instead
LL | fn main() {}
| ------------
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,7 +1,5 @@
// aux-build:pub-and-stability.rs // aux-build:pub-and-stability.rs
#![feature(unused_feature)]
// A big point of this test is that we *declare* `unstable_declared`, // A big point of this test is that we *declare* `unstable_declared`,
// but do *not* declare `unstable_undeclared`. This way we can check // but do *not* declare `unstable_undeclared`. This way we can check
// that the compiler is letting in uses of declared feature-gated // that the compiler is letting in uses of declared feature-gated

View file

@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:21:63 --> $DIR/explore-issue-38412.rs:19:63
| |
LL | let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } = LL | let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_un
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:30:5 --> $DIR/explore-issue-38412.rs:28:5
| |
LL | r.a_unstable_undeclared_pub; LL | r.a_unstable_undeclared_pub;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,25 +17,25 @@ LL | r.a_unstable_undeclared_pub;
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0616]: field `b_crate` of struct `Record` is private error[E0616]: field `b_crate` of struct `Record` is private
--> $DIR/explore-issue-38412.rs:31:7 --> $DIR/explore-issue-38412.rs:29:7
| |
LL | r.b_crate; LL | r.b_crate;
| ^^^^^^^ private field | ^^^^^^^ private field
error[E0616]: field `c_mod` of struct `Record` is private error[E0616]: field `c_mod` of struct `Record` is private
--> $DIR/explore-issue-38412.rs:32:7 --> $DIR/explore-issue-38412.rs:30:7
| |
LL | r.c_mod; LL | r.c_mod;
| ^^^^^ private field | ^^^^^ private field
error[E0616]: field `d_priv` of struct `Record` is private error[E0616]: field `d_priv` of struct `Record` is private
--> $DIR/explore-issue-38412.rs:33:7 --> $DIR/explore-issue-38412.rs:31:7
| |
LL | r.d_priv; LL | r.d_priv;
| ^^^^^^ private field | ^^^^^^ private field
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:37:5 --> $DIR/explore-issue-38412.rs:35:5
| |
LL | t.2; LL | t.2;
| ^^^ | ^^^
@ -44,25 +44,25 @@ LL | t.2;
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0616]: field `3` of struct `Tuple` is private error[E0616]: field `3` of struct `Tuple` is private
--> $DIR/explore-issue-38412.rs:38:7 --> $DIR/explore-issue-38412.rs:36:7
| |
LL | t.3; LL | t.3;
| ^ private field | ^ private field
error[E0616]: field `4` of struct `Tuple` is private error[E0616]: field `4` of struct `Tuple` is private
--> $DIR/explore-issue-38412.rs:39:7 --> $DIR/explore-issue-38412.rs:37:7
| |
LL | t.4; LL | t.4;
| ^ private field | ^ private field
error[E0616]: field `5` of struct `Tuple` is private error[E0616]: field `5` of struct `Tuple` is private
--> $DIR/explore-issue-38412.rs:40:7 --> $DIR/explore-issue-38412.rs:38:7
| |
LL | t.5; LL | t.5;
| ^ private field | ^ private field
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:44:7 --> $DIR/explore-issue-38412.rs:42:7
| |
LL | r.unstable_undeclared_trait_method(); LL | r.unstable_undeclared_trait_method();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -71,7 +71,7 @@ LL | r.unstable_undeclared_trait_method();
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:48:7 --> $DIR/explore-issue-38412.rs:46:7
| |
LL | r.unstable_undeclared(); LL | r.unstable_undeclared();
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
@ -80,7 +80,7 @@ LL | r.unstable_undeclared();
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: associated function `pub_crate` is private error[E0624]: associated function `pub_crate` is private
--> $DIR/explore-issue-38412.rs:50:7 --> $DIR/explore-issue-38412.rs:48:7
| |
LL | r.pub_crate(); LL | r.pub_crate();
| ^^^^^^^^^ private associated function | ^^^^^^^^^ private associated function
@ -91,7 +91,7 @@ LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
| ------------------------------------- private associated function defined here | ------------------------------------- private associated function defined here
error[E0624]: associated function `pub_mod` is private error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:51:7 --> $DIR/explore-issue-38412.rs:49:7
| |
LL | r.pub_mod(); LL | r.pub_mod();
| ^^^^^^^ private associated function | ^^^^^^^ private associated function
@ -102,7 +102,7 @@ LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
| ---------------------------------- private associated function defined here | ---------------------------------- private associated function defined here
error[E0624]: associated function `private` is private error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:52:7 --> $DIR/explore-issue-38412.rs:50:7
| |
LL | r.private(); LL | r.private();
| ^^^^^^^ private associated function | ^^^^^^^ private associated function
@ -113,7 +113,7 @@ LL | fn private(&self) -> i32 { self.d_priv }
| ------------------------ private associated function defined here | ------------------------ private associated function defined here
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:57:7 --> $DIR/explore-issue-38412.rs:55:7
| |
LL | t.unstable_undeclared_trait_method(); LL | t.unstable_undeclared_trait_method();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -122,7 +122,7 @@ LL | t.unstable_undeclared_trait_method();
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:61:7 --> $DIR/explore-issue-38412.rs:59:7
| |
LL | t.unstable_undeclared(); LL | t.unstable_undeclared();
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
@ -131,7 +131,7 @@ LL | t.unstable_undeclared();
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: associated function `pub_crate` is private error[E0624]: associated function `pub_crate` is private
--> $DIR/explore-issue-38412.rs:63:7 --> $DIR/explore-issue-38412.rs:61:7
| |
LL | t.pub_crate(); LL | t.pub_crate();
| ^^^^^^^^^ private associated function | ^^^^^^^^^ private associated function
@ -142,7 +142,7 @@ LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 }
| ------------------------------------- private associated function defined here | ------------------------------------- private associated function defined here
error[E0624]: associated function `pub_mod` is private error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:64:7 --> $DIR/explore-issue-38412.rs:62:7
| |
LL | t.pub_mod(); LL | t.pub_mod();
| ^^^^^^^ private associated function | ^^^^^^^ private associated function
@ -153,7 +153,7 @@ LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 }
| ---------------------------------- private associated function defined here | ---------------------------------- private associated function defined here
error[E0624]: associated function `private` is private error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:65:7 --> $DIR/explore-issue-38412.rs:63:7
| |
LL | t.private(); LL | t.private();
| ^^^^^^^ private associated function | ^^^^^^^ private associated function

View file

@ -1,15 +1,15 @@
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/feature-gate-staged_api.rs:1:1
|
LL | #![stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/feature-gate-staged_api.rs:8:1 --> $DIR/feature-gate-staged_api.rs:8:1
| |
LL | #[stable(feature = "a", since = "b")] LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/feature-gate-staged_api.rs:1:1
|
LL | #![stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0734`. For more information about this error, try `rustc --explain E0734`.

View file

@ -1,10 +1,10 @@
#![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
//~^ ERROR malformed `feature` //~^ ERROR malformed `feature`
//~| ERROR malformed `feature` //~| ERROR malformed `feature`
//~| ERROR unknown feature `foo`
//~| ERROR unknown feature `foo_bar_baz`
#![feature] //~ ERROR malformed `feature` attribute #![feature] //~ ERROR malformed `feature` attribute
#![feature = "foo"] //~ ERROR malformed `feature` attribute #![feature = "foo"] //~ ERROR malformed `feature` attribute
#![feature(test_removed_feature)] //~ ERROR: feature has been removed #![feature(test_removed_feature)] //~ ERROR: feature has been removed
fn main() {} fn main() {}

View file

@ -17,18 +17,30 @@ LL | #![feature(test_removed_feature)]
| ^^^^^^^^^^^^^^^^^^^^ feature has been removed | ^^^^^^^^^^^^^^^^^^^^ feature has been removed
error: malformed `feature` attribute input error: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:5:1 --> $DIR/gated-bad-feature.rs:6:1
| |
LL | #![feature] LL | #![feature]
| ^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]` | ^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`
error: malformed `feature` attribute input error: malformed `feature` attribute input
--> $DIR/gated-bad-feature.rs:6:1 --> $DIR/gated-bad-feature.rs:7:1
| |
LL | #![feature = "foo"] LL | #![feature = "foo"]
| ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]` | ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`
error: aborting due to 5 previous errors error[E0635]: unknown feature `foo_bar_baz`
--> $DIR/gated-bad-feature.rs:1:12
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^^^^^^^^^
Some errors have detailed explanations: E0556, E0557. error[E0635]: unknown feature `foo`
--> $DIR/gated-bad-feature.rs:1:48
|
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
| ^^^
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0556, E0557, E0635.
For more information about an error, try `rustc --explain E0556`. For more information about an error, try `rustc --explain E0556`.

View file

@ -6,25 +6,38 @@
#![rustc_deprecated()] #![rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
#[rustc_deprecated()] #[rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
mod rustc_deprecated { mod rustc_deprecated {
mod inner { #![rustc_deprecated()] } mod inner {
//~^ ERROR stability attributes may not be used outside of the standard library #![rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
}
#[rustc_deprecated()] fn f() { } #[rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
fn f() {}
#[rustc_deprecated()] struct S; #[rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library //~| ERROR missing 'since' [E0542]
//~| ERROR missing 'since' [E0542]
struct S;
#[rustc_deprecated()] type T = S; #[rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
type T = S;
#[rustc_deprecated()] impl S { } #[rustc_deprecated()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR missing 'since' [E0542]
impl S {}
} }
fn main() {} fn main() {}

View file

@ -1,51 +1,94 @@
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:9
|
LL | #![rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:21:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:32:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:37:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:11:1
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1 --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1
| |
LL | #![rustc_deprecated()] LL | #![rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:10:1 --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1
|
LL | #![rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:11:1
| |
LL | #[rustc_deprecated()] LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:13:17 --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:9
| |
LL | mod inner { #![rustc_deprecated()] } LL | #![rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:5 --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:21:5
| |
LL | #[rustc_deprecated()] fn f() { } LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5
|
LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5
|
LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:23:5
|
LL | #[rustc_deprecated()] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5 --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5
| |
LL | #[rustc_deprecated()] impl S { } LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 8 previous errors error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0734`. error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:32:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0542]: missing 'since'
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:37:5
|
LL | #[rustc_deprecated()]
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 15 previous errors
Some errors have detailed explanations: E0542, E0734.
For more information about an error, try `rustc --explain E0542`.

View file

@ -10,21 +10,26 @@
#[stable()] #[stable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
mod stable { mod stable {
mod inner { #![stable()] } mod inner {
//~^ ERROR stability attributes may not be used outside of the standard library #![stable()]
//~^ ERROR stability attributes may not be used outside of the standard library
}
#[stable()] fn f() { } #[stable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
fn f() {}
#[stable()] struct S; #[stable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library struct S;
#[stable()] type T = S; #[stable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
type T = S;
#[stable()] impl S { } #[stable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
impl S {}
} }
fn main() {} fn main() {}

View file

@ -1,8 +1,32 @@
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:7:1 --> $DIR/issue-43106-gating-of-stable.rs:14:9
| |
LL | #![stable()] LL | #![stable()]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:18:5
|
LL | #[stable()]
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:22:5
|
LL | #[stable()]
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:26:5
|
LL | #[stable()]
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:30:5
|
LL | #[stable()]
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:10:1 --> $DIR/issue-43106-gating-of-stable.rs:10:1
@ -11,41 +35,11 @@ LL | #[stable()]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:13:17 --> $DIR/issue-43106-gating-of-stable.rs:7:1
| |
LL | mod inner { #![stable()] } LL | #![stable()]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error: aborting due to 7 previous errors
--> $DIR/issue-43106-gating-of-stable.rs:16:5
|
LL | #[stable()] fn f() { }
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:19:5
|
LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:19:5
|
LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:23:5
|
LL | #[stable()] type T = S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:26:5
|
LL | #[stable()] impl S { }
| ^^^^^^^^^^^
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`. For more information about this error, try `rustc --explain E0734`.

View file

@ -10,21 +10,26 @@
#[unstable()] #[unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
mod unstable { mod unstable {
mod inner { #![unstable()] } mod inner {
//~^ ERROR stability attributes may not be used outside of the standard library #![unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library
}
#[unstable()] fn f() { } #[unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
fn f() {}
#[unstable()] struct S; #[unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library struct S;
#[unstable()] type T = S; #[unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
type T = S;
#[unstable()] impl S { } #[unstable()]
//~^ ERROR stability attributes may not be used outside of the standard library //~^ ERROR stability attributes may not be used outside of the standard library
impl S {}
} }
fn main() {} fn main() {}

View file

@ -1,8 +1,32 @@
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:7:1 --> $DIR/issue-43106-gating-of-unstable.rs:14:9
| |
LL | #![unstable()] LL | #![unstable()]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:18:5
|
LL | #[unstable()]
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:22:5
|
LL | #[unstable()]
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:26:5
|
LL | #[unstable()]
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:30:5
|
LL | #[unstable()]
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:10:1 --> $DIR/issue-43106-gating-of-unstable.rs:10:1
@ -11,41 +35,11 @@ LL | #[unstable()]
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:13:17 --> $DIR/issue-43106-gating-of-unstable.rs:7:1
| |
LL | mod inner { #![unstable()] } LL | #![unstable()]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library error: aborting due to 7 previous errors
--> $DIR/issue-43106-gating-of-unstable.rs:16:5
|
LL | #[unstable()] fn f() { }
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:19:5
|
LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:19:5
|
LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:23:5
|
LL | #[unstable()] type T = S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:26:5
|
LL | #[unstable()] impl S { }
| ^^^^^^^^^^^^^
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`. For more information about this error, try `rustc --explain E0734`.

View file

@ -1,4 +1,4 @@
#![feature(generators, generator_trait, box_leak)] #![feature(generators, generator_trait)]
use std::cell::RefCell; use std::cell::RefCell;
use std::ops::Generator; use std::ops::Generator;

View file

@ -1,5 +1,3 @@
#![feature(universal_impl_trait)]
use std::fmt::Debug; use std::fmt::Debug;
fn foo<T>(x: impl Debug) { } fn foo<T>(x: impl Debug) { }

View file

@ -1,5 +1,5 @@
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
--> $DIR/universal-issue-48703.rs:8:11 --> $DIR/universal-issue-48703.rs:6:11
| |
LL | foo::<String>('a'); LL | foo::<String>('a');
| ^^^^^^ explicit generic argument not allowed | ^^^^^^ explicit generic argument not allowed

View file

@ -1,5 +1,3 @@
#![feature(question_mark, question_mark_carrier)]
// Test that type inference fails where there are multiple possible return types // Test that type inference fails where there are multiple possible return types
// for the `?` operator. // for the `?` operator.

View file

@ -1,5 +1,5 @@
error[E0284]: type annotations needed error[E0284]: type annotations needed
--> $DIR/question-mark-type-infer.rs:12:21 --> $DIR/question-mark-type-infer.rs:10:21
| |
LL | l.iter().map(f).collect()? LL | l.iter().map(f).collect()?
| ^^^^^^^ cannot infer type | ^^^^^^^ cannot infer type

View file

@ -1,5 +1,5 @@
error[E0015]: cannot call non-const fn `Y::foo` in statics error[E0015]: cannot call non-const fn `Y::foo` in statics
--> $DIR/issue-16538.rs:15:23 --> $DIR/issue-16538.rs:14:23
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -7,7 +7,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: calls in statics are limited to constant functions, tuple structs and tuple variants = note: calls in statics are limited to constant functions, tuple structs and tuple variants
error[E0133]: use of extern static is unsafe and requires unsafe function or block error[E0133]: use of extern static is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:15:30 --> $DIR/issue-16538.rs:14:30
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^ use of extern static | ^^^^ use of extern static
@ -15,7 +15,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:15:21 --> $DIR/issue-16538.rs:14:21
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer

View file

@ -1,7 +1,6 @@
// revisions: mir thir // revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck // [thir]compile-flags: -Z thir-unsafeck
#![feature(const_raw_ptr_deref)]
mod Y { mod Y {
pub type X = usize; pub type X = usize;
extern "C" { extern "C" {

View file

@ -1,5 +1,5 @@
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:15:22 --> $DIR/issue-16538.rs:14:22
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
@ -7,7 +7,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
error[E0133]: use of extern static is unsafe and requires unsafe function or block error[E0133]: use of extern static is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:15:30 --> $DIR/issue-16538.rs:14:30
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^ use of extern static | ^^^^ use of extern static
@ -15,7 +15,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
error[E0015]: cannot call non-const fn `Y::foo` in statics error[E0015]: cannot call non-const fn `Y::foo` in statics
--> $DIR/issue-16538.rs:15:23 --> $DIR/issue-16538.rs:14:23
| |
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,5 +1,3 @@
#![feature(associated_consts)]
trait Foo { trait Foo {
const BAR: i32; const BAR: i32;
fn foo(self) -> &'static i32 { fn foo(self) -> &'static i32 {

View file

@ -1,5 +1,5 @@
error[E0277]: the size for values of type `Self` cannot be known at compilation time error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-27078.rs:5:12 --> $DIR/issue-27078.rs:3:12
| |
LL | fn foo(self) -> &'static i32 { LL | fn foo(self) -> &'static i32 {
| ^^^^ doesn't have a size known at compile-time | ^^^^ doesn't have a size known at compile-time

View file

@ -1,5 +1,3 @@
#![feature(associated_consts)]
trait VecN { trait VecN {
const DIM: usize; const DIM: usize;
} }

View file

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter error: constant expression depends on a generic parameter
--> $DIR/issue-39211.rs:11:17 --> $DIR/issue-39211.rs:9:17
| |
LL | let a = [3; M::Row::DIM]; LL | let a = [3; M::Row::DIM];
| ^^^^^^^^^^^ | ^^^^^^^^^^^

View file

@ -1,4 +1,3 @@
#![feature(use_extern_macros)]
trait Foo {} trait Foo {}
#[derive(Foo::Anything)] //~ ERROR failed to resolve: partially resolved path in a derive macro #[derive(Foo::Anything)] //~ ERROR failed to resolve: partially resolved path in a derive macro
//~| ERROR failed to resolve: partially resolved path in a derive macro //~| ERROR failed to resolve: partially resolved path in a derive macro

View file

@ -1,11 +1,11 @@
error[E0433]: failed to resolve: partially resolved path in a derive macro error[E0433]: failed to resolve: partially resolved path in a derive macro
--> $DIR/issue-46101.rs:3:10 --> $DIR/issue-46101.rs:2:10
| |
LL | #[derive(Foo::Anything)] LL | #[derive(Foo::Anything)]
| ^^^^^^^^^^^^^ partially resolved path in a derive macro | ^^^^^^^^^^^^^ partially resolved path in a derive macro
error[E0433]: failed to resolve: partially resolved path in a derive macro error[E0433]: failed to resolve: partially resolved path in a derive macro
--> $DIR/issue-46101.rs:3:10 --> $DIR/issue-46101.rs:2:10
| |
LL | #[derive(Foo::Anything)] LL | #[derive(Foo::Anything)]
| ^^^^^^^^^^^^^ partially resolved path in a derive macro | ^^^^^^^^^^^^^ partially resolved path in a derive macro

View file

@ -1,5 +1,3 @@
#![feature(macro_rules)]
macro_rules! g { macro_rules! g {
($inp:ident) => ( ($inp:ident) => (
{ $inp $nonexistent } { $inp $nonexistent }

View file

@ -1,5 +1,5 @@
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$` error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$`
--> $DIR/issue-6596-2.rs:5:16 --> $DIR/issue-6596-2.rs:3:16
| |
LL | { $inp $nonexistent } LL | { $inp $nonexistent }
| ^^^^^^^^^^^^ expected one of 8 possible tokens | ^^^^^^^^^^^^ expected one of 8 possible tokens

View file

@ -1,5 +1,5 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/issue-75777.rs:13:5 --> $DIR/issue-75777.rs:11:5
| |
LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> { LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
| -- lifetime `'a` defined here | -- lifetime `'a` defined here

View file

@ -1,8 +1,6 @@
// Regression test for #75777. // Regression test for #75777.
// Checks that a boxed future can be properly constructed. // Checks that a boxed future can be properly constructed.
#![feature(future_readiness_fns)]
use std::future::{self, Future}; use std::future::{self, Future};
use std::pin::Pin; use std::pin::Pin;

View file

@ -1,16 +1,16 @@
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/issue-75777.rs:13:14 --> $DIR/issue-75777.rs:11:14
| |
LL | Box::new(move |_| fut) LL | Box::new(move |_| fut)
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
note: first, the lifetime cannot outlive the lifetime `'a` as defined here... note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
--> $DIR/issue-75777.rs:11:11 --> $DIR/issue-75777.rs:9:11
| |
LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> { LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
| ^^ | ^^
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-75777.rs:13:14 --> $DIR/issue-75777.rs:11:14
| |
LL | Box::new(move |_| fut) LL | Box::new(move |_| fut)
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
@ -18,7 +18,7 @@ LL | Box::new(move |_| fut)
found `(Pin<Box<(dyn Future<Output = A> + Send + 'a)>>,)` found `(Pin<Box<(dyn Future<Output = A> + Send + 'a)>>,)`
= note: but, the lifetime must be valid for the static lifetime... = note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-75777.rs:13:5 --> $DIR/issue-75777.rs:11:5
| |
LL | Box::new(move |_| fut) LL | Box::new(move |_| fut)
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,5 +1,4 @@
#![deny(unused_attributes)] #![deny(unused_attributes)]
#![feature(min_const_generics)]
use std::marker::PhantomData; use std::marker::PhantomData;

View file

@ -1,11 +1,11 @@
error[E0518]: attribute should be applied to function or closure error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-78957.rs:6:16 --> $DIR/issue-78957.rs:5:16
| |
LL | pub struct Foo<#[inline] const N: usize>; LL | pub struct Foo<#[inline] const N: usize>;
| ^^^^^^^^^ - not a function or closure | ^^^^^^^^^ - not a function or closure
error: attribute should be applied to a function error: attribute should be applied to a function
--> $DIR/issue-78957.rs:8:16 --> $DIR/issue-78957.rs:7:16
| |
LL | pub struct Bar<#[cold] const N: usize>; LL | pub struct Bar<#[cold] const N: usize>;
| ^^^^^^^ - not a function | ^^^^^^^ - not a function
@ -18,19 +18,19 @@ LL | #![deny(unused_attributes)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error[E0517]: attribute should be applied to a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-78957.rs:11:23 --> $DIR/issue-78957.rs:10:23
| |
LL | pub struct Baz<#[repr(C)] const N: usize>; LL | pub struct Baz<#[repr(C)] const N: usize>;
| ^ - not a struct, enum, or union | ^ - not a struct, enum, or union
error[E0518]: attribute should be applied to function or closure error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-78957.rs:14:17 --> $DIR/issue-78957.rs:13:17
| |
LL | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>); LL | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>);
| ^^^^^^^^^ -- not a function or closure | ^^^^^^^^^ -- not a function or closure
error: attribute should be applied to a function error: attribute should be applied to a function
--> $DIR/issue-78957.rs:16:17 --> $DIR/issue-78957.rs:15:17
| |
LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>); LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>);
| ^^^^^^^ -- not a function | ^^^^^^^ -- not a function
@ -38,19 +38,19 @@ LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>);
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error[E0517]: attribute should be applied to a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-78957.rs:19:24 --> $DIR/issue-78957.rs:18:24
| |
LL | pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>); LL | pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>);
| ^ -- not a struct, enum, or union | ^ -- not a struct, enum, or union
error[E0518]: attribute should be applied to function or closure error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-78957.rs:22:17 --> $DIR/issue-78957.rs:21:17
| |
LL | pub struct Foo3<#[inline] T>(PhantomData<T>); LL | pub struct Foo3<#[inline] T>(PhantomData<T>);
| ^^^^^^^^^ - not a function or closure | ^^^^^^^^^ - not a function or closure
error: attribute should be applied to a function error: attribute should be applied to a function
--> $DIR/issue-78957.rs:24:17 --> $DIR/issue-78957.rs:23:17
| |
LL | pub struct Bar3<#[cold] T>(PhantomData<T>); LL | pub struct Bar3<#[cold] T>(PhantomData<T>);
| ^^^^^^^ - not a function | ^^^^^^^ - not a function
@ -58,7 +58,7 @@ LL | pub struct Bar3<#[cold] T>(PhantomData<T>);
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error[E0517]: attribute should be applied to a struct, enum, or union error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-78957.rs:27:24 --> $DIR/issue-78957.rs:26:24
| |
LL | pub struct Baz3<#[repr(C)] T>(PhantomData<T>); LL | pub struct Baz3<#[repr(C)] T>(PhantomData<T>);
| ^ - not a struct, enum, or union | ^ - not a struct, enum, or union

View file

@ -1,7 +1,5 @@
// Test for issue #50381: non-lifetime passed to :lifetime. // Test for issue #50381: non-lifetime passed to :lifetime.
#![feature(macro_lifetime_matcher)]
macro_rules! m { ($x:lifetime) => { } } macro_rules! m { ($x:lifetime) => { } }
fn main() { fn main() {

View file

@ -1,5 +1,5 @@
error: no rules expected the token `a` error: no rules expected the token `a`
--> $DIR/macro-non-lifetime.rs:8:8 --> $DIR/macro-non-lifetime.rs:6:8
| |
LL | macro_rules! m { ($x:lifetime) => { } } LL | macro_rules! m { ($x:lifetime) => { } }
| -------------- when calling this macro | -------------- when calling this macro

View file

@ -1,5 +1,3 @@
#![feature(extern_prelude)]
mod m { mod m {
fn check() { fn check() {
Vec::clone!(); //~ ERROR failed to resolve: `Vec` is a struct, not a module Vec::clone!(); //~ ERROR failed to resolve: `Vec` is a struct, not a module

View file

@ -1,11 +1,11 @@
error[E0433]: failed to resolve: `Vec` is a struct, not a module error[E0433]: failed to resolve: `Vec` is a struct, not a module
--> $DIR/macro-path-prelude-fail-1.rs:5:9 --> $DIR/macro-path-prelude-fail-1.rs:3:9
| |
LL | Vec::clone!(); LL | Vec::clone!();
| ^^^ `Vec` is a struct, not a module | ^^^ `Vec` is a struct, not a module
error[E0433]: failed to resolve: `u8` is a builtin type, not a module error[E0433]: failed to resolve: `u8` is a builtin type, not a module
--> $DIR/macro-path-prelude-fail-1.rs:6:9 --> $DIR/macro-path-prelude-fail-1.rs:4:9
| |
LL | u8::clone!(); LL | u8::clone!();
| ^^ `u8` is a builtin type, not a module | ^^ `u8` is a builtin type, not a module

View file

@ -1,6 +1,6 @@
// aux-build:macro-in-other-crate.rs // aux-build:macro-in-other-crate.rs
#![feature(decl_macro, extern_prelude)] #![feature(decl_macro)]
macro_rules! add_macro_expanded_things_to_macro_prelude {() => { macro_rules! add_macro_expanded_things_to_macro_prelude {() => {
#[macro_use] #[macro_use]

View file

@ -2,7 +2,10 @@
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(staged_api)] #![feature(staged_api)]
#[macro_use] extern crate unstable_macros; #![stable(feature = "rust1", since = "1.0.0")]
#[macro_use]
extern crate unstable_macros;
#[unstable(feature = "local_unstable", issue = "none")] #[unstable(feature = "local_unstable", issue = "none")]
macro_rules! local_unstable { () => () } macro_rules! local_unstable { () => () }

View file

@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'local_unstable' error[E0658]: use of unstable library feature 'local_unstable'
--> $DIR/macro-stability.rs:19:5 --> $DIR/macro-stability.rs:22:5
| |
LL | local_unstable!(); LL | local_unstable!();
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -7,7 +7,7 @@ LL | local_unstable!();
= help: add `#![feature(local_unstable)]` to the crate attributes to enable = help: add `#![feature(local_unstable)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'local_unstable' error[E0658]: use of unstable library feature 'local_unstable'
--> $DIR/macro-stability.rs:20:5 --> $DIR/macro-stability.rs:23:5
| |
LL | local_unstable_modern!(); LL | local_unstable_modern!();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
@ -15,7 +15,7 @@ LL | local_unstable_modern!();
= help: add `#![feature(local_unstable)]` to the crate attributes to enable = help: add `#![feature(local_unstable)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_macros' error[E0658]: use of unstable library feature 'unstable_macros'
--> $DIR/macro-stability.rs:21:5 --> $DIR/macro-stability.rs:24:5
| |
LL | unstable_macro!(); LL | unstable_macro!();
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL | unstable_macro!();
= help: add `#![feature(unstable_macros)]` to the crate attributes to enable = help: add `#![feature(unstable_macros)]` to the crate attributes to enable
warning: use of deprecated macro `deprecated_macro`: deprecation reason warning: use of deprecated macro `deprecated_macro`: deprecation reason
--> $DIR/macro-stability.rs:24:5 --> $DIR/macro-stability.rs:27:5
| |
LL | deprecated_macro!(); LL | deprecated_macro!();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
@ -31,7 +31,7 @@ LL | deprecated_macro!();
= note: `#[warn(deprecated)]` on by default = note: `#[warn(deprecated)]` on by default
warning: use of deprecated macro `local_deprecated`: local deprecation reason warning: use of deprecated macro `local_deprecated`: local deprecation reason
--> $DIR/macro-stability.rs:26:5 --> $DIR/macro-stability.rs:29:5
| |
LL | local_deprecated!(); LL | local_deprecated!();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^

View file

@ -3,7 +3,7 @@
#![no_std] #![no_std]
#![crate_type = "staticlib"] #![crate_type = "staticlib"]
#![feature(panic_handler, alloc_error_handler)] #![feature(alloc_error_handler)]
#[panic_handler] #[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! { fn panic(_: &core::panic::PanicInfo) -> ! {

View file

@ -3,7 +3,7 @@
#![no_std] #![no_std]
#![crate_type = "staticlib"] #![crate_type = "staticlib"]
#![feature(panic_handler, alloc_error_handler)] #![feature(alloc_error_handler)]
#[panic_handler] #[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! { fn panic(_: &core::panic::PanicInfo) -> ! {

View file

@ -1,5 +1,4 @@
#![allow(dead_code)] #![allow(dead_code)]
#![feature(recover)]
use std::panic::UnwindSafe; use std::panic::UnwindSafe;

View file

@ -1,5 +1,5 @@
error[E0277]: the type `&mut i32` may not be safely transferred across an unwind boundary error[E0277]: the type `&mut i32` may not be safely transferred across an unwind boundary
--> $DIR/not-panic-safe.rs:9:5 --> $DIR/not-panic-safe.rs:8:5
| |
LL | assert::<&mut i32>(); LL | assert::<&mut i32>();
| ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary | ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary
@ -7,7 +7,7 @@ LL | assert::<&mut i32>();
= help: the trait `UnwindSafe` is not implemented for `&mut i32` = help: the trait `UnwindSafe` is not implemented for `&mut i32`
= note: `UnwindSafe` is implemented for `&i32`, but not for `&mut i32` = note: `UnwindSafe` is implemented for `&i32`, but not for `&mut i32`
note: required by a bound in `assert` note: required by a bound in `assert`
--> $DIR/not-panic-safe.rs:6:14 --> $DIR/not-panic-safe.rs:5:14
| |
LL | fn assert<T: UnwindSafe + ?Sized>() {} LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ^^^^^^^^^^ required by this bound in `assert` | ^^^^^^^^^^ required by this bound in `assert`

View file

@ -1,5 +1,5 @@
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/object-lifetime-default-from-rptr-struct-error.rs:21:5 --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:5
| |
LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) { LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {
| -- lifetime `'a` defined here | -- lifetime `'a` defined here

View file

@ -2,7 +2,6 @@
// through the `MyBox` struct. // through the `MyBox` struct.
#![allow(dead_code)] #![allow(dead_code)]
#![feature(rustc_error)]
trait Test { trait Test {
fn foo(&self) { } fn foo(&self) { }

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/object-lifetime-default-from-rptr-struct-error.rs:21:12 --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:12
| |
LL | ss.t = t; LL | ss.t = t;
| ^ lifetime mismatch | ^ lifetime mismatch
@ -7,7 +7,7 @@ LL | ss.t = t;
= note: expected reference `&'a MyBox<(dyn Test + 'static)>` = note: expected reference `&'a MyBox<(dyn Test + 'static)>`
found reference `&'a MyBox<(dyn Test + 'a)>` found reference `&'a MyBox<(dyn Test + 'a)>`
note: the lifetime `'a` as defined here... note: the lifetime `'a` as defined here...
--> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:6 --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:19:6
| |
LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) { LL | fn c<'a>(t: &'a MyBox<dyn Test+'a>, mut ss: SomeStruct<'a>) {
| ^^ | ^^

View file

@ -1,7 +1,6 @@
// Testing guarantees provided by once functions. // Testing guarantees provided by once functions.
// This program would segfault if it were legal. // This program would segfault if it were legal.
#![feature(once_fns)]
use std::sync::Arc; use std::sync::Arc;
fn foo<F:FnOnce()>(blk: F) { fn foo<F:FnOnce()>(blk: F) {

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `blk` error[E0382]: use of moved value: `blk`
--> $DIR/once-cant-call-twice-on-heap.rs:9:5 --> $DIR/once-cant-call-twice-on-heap.rs:8:5
| |
LL | fn foo<F:FnOnce()>(blk: F) { LL | fn foo<F:FnOnce()>(blk: F) {
| --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait | --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait
@ -9,7 +9,7 @@ LL | blk();
| ^^^ value used here after move | ^^^ value used here after move
| |
note: this value implements `FnOnce`, which causes it to be moved when called note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/once-cant-call-twice-on-heap.rs:8:5 --> $DIR/once-cant-call-twice-on-heap.rs:7:5
| |
LL | blk(); LL | blk();
| ^^^ | ^^^

View file

@ -5,8 +5,6 @@
// types of patterns that allow undelimited subpatterns that could cause the same ambiguity. // types of patterns that allow undelimited subpatterns that could cause the same ambiguity.
// Currently, those should be impossible due to precedence rule. This test enforces that. // Currently, those should be impossible due to precedence rule. This test enforces that.
#![feature(or_patterns)]
enum E { enum E {
A, A,
B, B,

View file

@ -1,35 +1,35 @@
error: top-level or-patterns are not allowed in `let` bindings error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:21:9 --> $DIR/nested-undelimited-precedence.rs:19:9
| |
LL | let b @ A | B: E = A; LL | let b @ A | B: E = A;
| ^^^^^^^^^ help: wrap the pattern in parentheses: `(b @ A | B)` | ^^^^^^^^^ help: wrap the pattern in parentheses: `(b @ A | B)`
error: top-level or-patterns are not allowed in `let` bindings error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:36:9 --> $DIR/nested-undelimited-precedence.rs:34:9
| |
LL | let &A(_) | B(_): F = A(3); LL | let &A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&A(_) | B(_))` | ^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&A(_) | B(_))`
error: top-level or-patterns are not allowed in `let` bindings error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:38:9 --> $DIR/nested-undelimited-precedence.rs:36:9
| |
LL | let &&A(_) | B(_): F = A(3); LL | let &&A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&A(_) | B(_))` | ^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&A(_) | B(_))`
error: top-level or-patterns are not allowed in `let` bindings error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:40:9 --> $DIR/nested-undelimited-precedence.rs:38:9
| |
LL | let &mut A(_) | B(_): F = A(3); LL | let &mut A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&mut A(_) | B(_))` | ^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&mut A(_) | B(_))`
error: top-level or-patterns are not allowed in `let` bindings error: top-level or-patterns are not allowed in `let` bindings
--> $DIR/nested-undelimited-precedence.rs:42:9 --> $DIR/nested-undelimited-precedence.rs:40:9
| |
LL | let &&mut A(_) | B(_): F = A(3); LL | let &&mut A(_) | B(_): F = A(3);
| ^^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&mut A(_) | B(_))` | ^^^^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(&&mut A(_) | B(_))`
error[E0408]: variable `b` is not bound in all patterns error[E0408]: variable `b` is not bound in all patterns
--> $DIR/nested-undelimited-precedence.rs:21:17 --> $DIR/nested-undelimited-precedence.rs:19:17
| |
LL | let b @ A | B: E = A; LL | let b @ A | B: E = A;
| - ^ pattern doesn't bind `b` | - ^ pattern doesn't bind `b`
@ -37,7 +37,7 @@ LL | let b @ A | B: E = A;
| variable not in all patterns | variable not in all patterns
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/nested-undelimited-precedence.rs:36:9 --> $DIR/nested-undelimited-precedence.rs:34:9
| |
LL | let &A(_) | B(_): F = A(3); LL | let &A(_) | B(_): F = A(3);
| ^^^^^ - expected due to this | ^^^^^ - expected due to this
@ -48,7 +48,7 @@ LL | let &A(_) | B(_): F = A(3);
found reference `&_` found reference `&_`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/nested-undelimited-precedence.rs:38:9 --> $DIR/nested-undelimited-precedence.rs:36:9
| |
LL | let &&A(_) | B(_): F = A(3); LL | let &&A(_) | B(_): F = A(3);
| ^^^^^^ - expected due to this | ^^^^^^ - expected due to this
@ -59,7 +59,7 @@ LL | let &&A(_) | B(_): F = A(3);
found reference `&_` found reference `&_`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/nested-undelimited-precedence.rs:40:9 --> $DIR/nested-undelimited-precedence.rs:38:9
| |
LL | let &mut A(_) | B(_): F = A(3); LL | let &mut A(_) | B(_): F = A(3);
| ^^^^^^^^^ - expected due to this | ^^^^^^^^^ - expected due to this
@ -70,7 +70,7 @@ LL | let &mut A(_) | B(_): F = A(3);
found mutable reference `&mut _` found mutable reference `&mut _`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/nested-undelimited-precedence.rs:42:9 --> $DIR/nested-undelimited-precedence.rs:40:9
| |
LL | let &&mut A(_) | B(_): F = A(3); LL | let &&mut A(_) | B(_): F = A(3);
| ^^^^^^^^^^ - expected due to this | ^^^^^^^^^^ - expected due to this

View file

@ -2,8 +2,6 @@
// edition:2018 // edition:2018
#![feature(or_patterns)]
fn main() {} fn main() {}
// Test the `pat` macro fragment parser: // Test the `pat` macro fragment parser:

View file

@ -1,5 +1,5 @@
error: no rules expected the token `|` error: no rules expected the token `|`
--> $DIR/or-patterns-syntactic-fail-2018.rs:14:15 --> $DIR/or-patterns-syntactic-fail-2018.rs:12:15
| |
LL | macro_rules! accept_pat { LL | macro_rules! accept_pat {
| ----------------------- when calling this macro | ----------------------- when calling this macro
@ -8,7 +8,7 @@ LL | accept_pat!(p | q);
| ^ no rules expected this token in macro call | ^ no rules expected this token in macro call
error: no rules expected the token `|` error: no rules expected the token `|`
--> $DIR/or-patterns-syntactic-fail-2018.rs:15:13 --> $DIR/or-patterns-syntactic-fail-2018.rs:13:13
| |
LL | macro_rules! accept_pat { LL | macro_rules! accept_pat {
| ----------------------- when calling this macro | ----------------------- when calling this macro

View file

@ -1,5 +1,4 @@
#![feature(exclusive_range_pattern)] #![feature(exclusive_range_pattern)]
#![feature(assoc_char_consts)]
#![allow(overlapping_range_endpoints)] #![allow(overlapping_range_endpoints)]
#![deny(unreachable_patterns)] #![deny(unreachable_patterns)]

View file

@ -1,5 +1,5 @@
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/exhaustiveness.rs:48:8 --> $DIR/exhaustiveness.rs:47:8
| |
LL | m!(0u8, 0..255); LL | m!(0u8, 0..255);
| ^^^ pattern `u8::MAX` not covered | ^^^ pattern `u8::MAX` not covered
@ -8,7 +8,7 @@ LL | m!(0u8, 0..255);
= note: the matched value is of type `u8` = note: the matched value is of type `u8`
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/exhaustiveness.rs:49:8 --> $DIR/exhaustiveness.rs:48:8
| |
LL | m!(0u8, 0..=254); LL | m!(0u8, 0..=254);
| ^^^ pattern `u8::MAX` not covered | ^^^ pattern `u8::MAX` not covered
@ -17,7 +17,7 @@ LL | m!(0u8, 0..=254);
= note: the matched value is of type `u8` = note: the matched value is of type `u8`
error[E0004]: non-exhaustive patterns: `0_u8` not covered error[E0004]: non-exhaustive patterns: `0_u8` not covered
--> $DIR/exhaustiveness.rs:50:8 --> $DIR/exhaustiveness.rs:49:8
| |
LL | m!(0u8, 1..=255); LL | m!(0u8, 1..=255);
| ^^^ pattern `0_u8` not covered | ^^^ pattern `0_u8` not covered
@ -26,7 +26,7 @@ LL | m!(0u8, 1..=255);
= note: the matched value is of type `u8` = note: the matched value is of type `u8`
error[E0004]: non-exhaustive patterns: `42_u8` not covered error[E0004]: non-exhaustive patterns: `42_u8` not covered
--> $DIR/exhaustiveness.rs:51:8 --> $DIR/exhaustiveness.rs:50:8
| |
LL | m!(0u8, 0..42 | 43..=255); LL | m!(0u8, 0..42 | 43..=255);
| ^^^ pattern `42_u8` not covered | ^^^ pattern `42_u8` not covered
@ -35,7 +35,7 @@ LL | m!(0u8, 0..42 | 43..=255);
= note: the matched value is of type `u8` = note: the matched value is of type `u8`
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/exhaustiveness.rs:52:8 --> $DIR/exhaustiveness.rs:51:8
| |
LL | m!(0i8, -128..127); LL | m!(0i8, -128..127);
| ^^^ pattern `i8::MAX` not covered | ^^^ pattern `i8::MAX` not covered
@ -44,7 +44,7 @@ LL | m!(0i8, -128..127);
= note: the matched value is of type `i8` = note: the matched value is of type `i8`
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/exhaustiveness.rs:53:8 --> $DIR/exhaustiveness.rs:52:8
| |
LL | m!(0i8, -128..=126); LL | m!(0i8, -128..=126);
| ^^^ pattern `i8::MAX` not covered | ^^^ pattern `i8::MAX` not covered
@ -53,7 +53,7 @@ LL | m!(0i8, -128..=126);
= note: the matched value is of type `i8` = note: the matched value is of type `i8`
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
--> $DIR/exhaustiveness.rs:54:8 --> $DIR/exhaustiveness.rs:53:8
| |
LL | m!(0i8, -127..=127); LL | m!(0i8, -127..=127);
| ^^^ pattern `i8::MIN` not covered | ^^^ pattern `i8::MIN` not covered
@ -62,7 +62,7 @@ LL | m!(0i8, -127..=127);
= note: the matched value is of type `i8` = note: the matched value is of type `i8`
error[E0004]: non-exhaustive patterns: `0_i8` not covered error[E0004]: non-exhaustive patterns: `0_i8` not covered
--> $DIR/exhaustiveness.rs:55:11 --> $DIR/exhaustiveness.rs:54:11
| |
LL | match 0i8 { LL | match 0i8 {
| ^^^ pattern `0_i8` not covered | ^^^ pattern `0_i8` not covered
@ -71,7 +71,7 @@ LL | match 0i8 {
= note: the matched value is of type `i8` = note: the matched value is of type `i8`
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
--> $DIR/exhaustiveness.rs:60:8 --> $DIR/exhaustiveness.rs:59:8
| |
LL | m!(0u128, 0..=ALMOST_MAX); LL | m!(0u128, 0..=ALMOST_MAX);
| ^^^^^ pattern `u128::MAX` not covered | ^^^^^ pattern `u128::MAX` not covered
@ -80,7 +80,7 @@ LL | m!(0u128, 0..=ALMOST_MAX);
= note: the matched value is of type `u128` = note: the matched value is of type `u128`
error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered
--> $DIR/exhaustiveness.rs:61:8 --> $DIR/exhaustiveness.rs:60:8
| |
LL | m!(0u128, 0..=4); LL | m!(0u128, 0..=4);
| ^^^^^ pattern `5_u128..=u128::MAX` not covered | ^^^^^ pattern `5_u128..=u128::MAX` not covered
@ -89,7 +89,7 @@ LL | m!(0u128, 0..=4);
= note: the matched value is of type `u128` = note: the matched value is of type `u128`
error[E0004]: non-exhaustive patterns: `0_u128` not covered error[E0004]: non-exhaustive patterns: `0_u128` not covered
--> $DIR/exhaustiveness.rs:62:8 --> $DIR/exhaustiveness.rs:61:8
| |
LL | m!(0u128, 1..=u128::MAX); LL | m!(0u128, 1..=u128::MAX);
| ^^^^^ pattern `0_u128` not covered | ^^^^^ pattern `0_u128` not covered
@ -98,7 +98,7 @@ LL | m!(0u128, 1..=u128::MAX);
= note: the matched value is of type `u128` = note: the matched value is of type `u128`
error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
--> $DIR/exhaustiveness.rs:70:11 --> $DIR/exhaustiveness.rs:69:11
| |
LL | match (0u8, true) { LL | match (0u8, true) {
| ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered | ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered

View file

@ -1,5 +1,3 @@
#![feature(pub_restricted)]
struct Bar(pub(())); struct Bar(pub(()));
struct Foo { struct Foo {

View file

@ -1,5 +1,5 @@
error: expected identifier, found `(` error: expected identifier, found `(`
--> $DIR/pub-restricted-error.rs:6:16 --> $DIR/pub-restricted-error.rs:4:16
| |
LL | pub(crate) () foo: usize, LL | pub(crate) () foo: usize,
| ^ expected identifier | ^ expected identifier

View file

@ -1,5 +1,3 @@
#![feature(pub_restricted)]
mod a {} mod a {}
pub (a) fn afn() {} //~ incorrect visibility restriction pub (a) fn afn() {} //~ incorrect visibility restriction

View file

@ -1,5 +1,5 @@
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:5:6 --> $DIR/pub-restricted.rs:3:6
| |
LL | pub (a) fn afn() {} LL | pub (a) fn afn() {}
| ^ help: make this visible only to module `a` with `in`: `in a` | ^ help: make this visible only to module `a` with `in`: `in a`
@ -10,7 +10,7 @@ LL | pub (a) fn afn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:6:6 --> $DIR/pub-restricted.rs:4:6
| |
LL | pub (b) fn bfn() {} LL | pub (b) fn bfn() {}
| ^ help: make this visible only to module `b` with `in`: `in b` | ^ help: make this visible only to module `b` with `in`: `in b`
@ -21,7 +21,7 @@ LL | pub (b) fn bfn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:7:6 --> $DIR/pub-restricted.rs:5:6
| |
LL | pub (crate::a) fn cfn() {} LL | pub (crate::a) fn cfn() {}
| ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a` | ^^^^^^^^ help: make this visible only to module `crate::a` with `in`: `in crate::a`
@ -32,7 +32,7 @@ LL | pub (crate::a) fn cfn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:24:14 --> $DIR/pub-restricted.rs:22:14
| |
LL | pub (a) invalid: usize, LL | pub (a) invalid: usize,
| ^ help: make this visible only to module `a` with `in`: `in a` | ^ help: make this visible only to module `a` with `in`: `in a`
@ -43,7 +43,7 @@ LL | pub (a) invalid: usize,
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:33:6 --> $DIR/pub-restricted.rs:31:6
| |
LL | pub (xyz) fn xyz() {} LL | pub (xyz) fn xyz() {}
| ^^^ help: make this visible only to module `xyz` with `in`: `in xyz` | ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
@ -54,7 +54,7 @@ LL | pub (xyz) fn xyz() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
error[E0742]: visibilities can only be restricted to ancestor modules error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/pub-restricted.rs:25:17 --> $DIR/pub-restricted.rs:23:17
| |
LL | pub (in x) non_parent_invalid: usize, LL | pub (in x) non_parent_invalid: usize,
| ^ | ^

View file

@ -1,5 +1,3 @@
#![feature(repr_align)]
// See also repr-transparent.rs // See also repr-transparent.rs
#[repr(transparent, C)] //~ ERROR cannot have other repr #[repr(transparent, C)] //~ ERROR cannot have other repr

View file

@ -1,23 +1,23 @@
error[E0692]: transparent struct cannot have other repr hints error[E0692]: transparent struct cannot have other repr hints
--> $DIR/repr-transparent-other-reprs.rs:5:8 --> $DIR/repr-transparent-other-reprs.rs:3:8
| |
LL | #[repr(transparent, C)] LL | #[repr(transparent, C)]
| ^^^^^^^^^^^ ^ | ^^^^^^^^^^^ ^
error[E0692]: transparent struct cannot have other repr hints error[E0692]: transparent struct cannot have other repr hints
--> $DIR/repr-transparent-other-reprs.rs:10:8 --> $DIR/repr-transparent-other-reprs.rs:8:8
| |
LL | #[repr(transparent, packed)] LL | #[repr(transparent, packed)]
| ^^^^^^^^^^^ ^^^^^^ | ^^^^^^^^^^^ ^^^^^^
error[E0692]: transparent struct cannot have other repr hints error[E0692]: transparent struct cannot have other repr hints
--> $DIR/repr-transparent-other-reprs.rs:13:8 --> $DIR/repr-transparent-other-reprs.rs:11:8
| |
LL | #[repr(transparent, align(2))] LL | #[repr(transparent, align(2))]
| ^^^^^^^^^^^ ^^^^^^^^ | ^^^^^^^^^^^ ^^^^^^^^
error[E0692]: transparent struct cannot have other repr hints error[E0692]: transparent struct cannot have other repr hints
--> $DIR/repr-transparent-other-reprs.rs:16:8 --> $DIR/repr-transparent-other-reprs.rs:14:8
| |
LL | #[repr(transparent)] LL | #[repr(transparent)]
| ^^^^^^^^^^^ | ^^^^^^^^^^^

View file

@ -1,4 +1,3 @@
#![feature(dyn_trait)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
trait Trait<'x, T> where T: 'x { trait Trait<'x, T> where T: 'x {

View file

@ -1,5 +1,5 @@
error: rustc_outlives error: rustc_outlives
--> $DIR/explicit-dyn.rs:8:1 --> $DIR/explicit-dyn.rs:7:1
| |
LL | / struct Foo<'a, A> LL | / struct Foo<'a, A>
LL | | { LL | | {

Some files were not shown because too many files have changed in this diff Show more