Skip to content

Commit 29d7fc1

Browse files
committed
Auto merge of #48806 - alexcrichton:rollup, r=alexcrichton
Rollup of 9 pull requests - Successful merges: #48511, #48549, #48618, #48624, #48651, #48698, #48778, #48787, #48802 - Failed merges: #48669, #48710
2 parents 4cdbac6 + a752453 commit 29d7fc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+814
-918
lines changed

src/Cargo.lock

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

src/etc/ziggurat_tables.py

-127
This file was deleted.

src/libcore/option.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -829,14 +829,13 @@ impl<'a, T: Clone> Option<&'a mut T> {
829829
/// # Examples
830830
///
831831
/// ```
832-
/// #![feature(option_ref_mut_cloned)]
833832
/// let mut x = 12;
834833
/// let opt_x = Some(&mut x);
835834
/// assert_eq!(opt_x, Some(&mut 12));
836835
/// let cloned = opt_x.cloned();
837836
/// assert_eq!(cloned, Some(12));
838837
/// ```
839-
#[unstable(feature = "option_ref_mut_cloned", issue = "43738")]
838+
#[stable(since = "1.26.0", feature = "option_ref_mut_cloned")]
840839
pub fn cloned(self) -> Option<T> {
841840
self.map(|t| t.clone())
842841
}

src/librustc/dep_graph/dep_node.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ define_dep_nodes!( <'tcx>
559559
[] IsReachableNonGeneric(DefId),
560560
[] IsMirAvailable(DefId),
561561
[] ItemAttrs(DefId),
562+
[] TransFnAttrs(DefId),
562563
[] FnArgNames(DefId),
563564
[] DylibDepFormats(CrateNum),
564565
[] IsPanicRuntime(CrateNum),
@@ -626,8 +627,6 @@ define_dep_nodes!( <'tcx>
626627
[input] AllCrateNums,
627628
[] ExportedSymbols(CrateNum),
628629
[eval_always] CollectAndPartitionTranslationItems,
629-
[] ExportName(DefId),
630-
[] ContainsExternIndicator(DefId),
631630
[] IsTranslatedItem(DefId),
632631
[] CodegenUnit(InternedString),
633632
[] CompileCodegenUnit(InternedString),
@@ -637,7 +636,6 @@ define_dep_nodes!( <'tcx>
637636
[] SubstituteNormalizeAndTestPredicates { key: (DefId, &'tcx Substs<'tcx>) },
638637

639638
[input] TargetFeaturesWhitelist,
640-
[] TargetFeaturesEnabled(DefId),
641639

642640
[] InstanceDefSizeEstimate { instance_def: InstanceDef<'tcx> },
643641

src/librustc/hir/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct CheckAttrVisitor<'a, 'tcx: 'a> {
4747
impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
4848
/// Check any attribute.
4949
fn check_attributes(&self, item: &hir::Item, target: Target) {
50-
self.tcx.target_features_enabled(self.tcx.hir.local_def_id(item.id));
50+
self.tcx.trans_fn_attrs(self.tcx.hir.local_def_id(item.id));
5151

5252
for attr in &item.attrs {
5353
if let Some(name) = attr.name() {

src/librustc/hir/mod.rs

+50
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ pub use self::Visibility::{Public, Inherited};
3030
use hir::def::Def;
3131
use hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
3232
use util::nodemap::{NodeMap, FxHashSet};
33+
use mir::mono::Linkage;
3334

3435
use syntax_pos::{Span, DUMMY_SP};
3536
use syntax::codemap::{self, Spanned};
3637
use syntax::abi::Abi;
3738
use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID, AsmDialect};
3839
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem};
40+
use syntax::attr::InlineAttr;
3941
use syntax::ext::hygiene::SyntaxContext;
4042
use syntax::ptr::P;
4143
use syntax::symbol::{Symbol, keywords};
@@ -2210,3 +2212,51 @@ pub type GlobMap = NodeMap<FxHashSet<Name>>;
22102212
pub fn provide(providers: &mut Providers) {
22112213
providers.describe_def = map::describe_def;
22122214
}
2215+
2216+
#[derive(Clone, RustcEncodable, RustcDecodable, Hash)]
2217+
pub struct TransFnAttrs {
2218+
pub flags: TransFnAttrFlags,
2219+
pub inline: InlineAttr,
2220+
pub export_name: Option<Symbol>,
2221+
pub target_features: Vec<Symbol>,
2222+
pub linkage: Option<Linkage>,
2223+
}
2224+
2225+
bitflags! {
2226+
#[derive(RustcEncodable, RustcDecodable)]
2227+
pub struct TransFnAttrFlags: u8 {
2228+
const COLD = 0b0000_0001;
2229+
const ALLOCATOR = 0b0000_0010;
2230+
const UNWIND = 0b0000_0100;
2231+
const RUSTC_ALLOCATOR_NOUNWIND = 0b0000_1000;
2232+
const NAKED = 0b0001_0000;
2233+
const NO_MANGLE = 0b0010_0000;
2234+
const RUSTC_STD_INTERNAL_SYMBOL = 0b0100_0000;
2235+
}
2236+
}
2237+
2238+
impl TransFnAttrs {
2239+
pub fn new() -> TransFnAttrs {
2240+
TransFnAttrs {
2241+
flags: TransFnAttrFlags::empty(),
2242+
inline: InlineAttr::None,
2243+
export_name: None,
2244+
target_features: vec![],
2245+
linkage: None,
2246+
}
2247+
}
2248+
2249+
/// True if `#[inline]` or `#[inline(always)]` is present.
2250+
pub fn requests_inline(&self) -> bool {
2251+
match self.inline {
2252+
InlineAttr::Hint | InlineAttr::Always => true,
2253+
InlineAttr::None | InlineAttr::Never => false,
2254+
}
2255+
}
2256+
2257+
/// True if `#[no_mangle]` or `#[export_name(...)]` is present.
2258+
pub fn contains_extern_indicator(&self) -> bool {
2259+
self.flags.contains(TransFnAttrFlags::NO_MANGLE) || self.export_name.is_some()
2260+
}
2261+
}
2262+

0 commit comments

Comments
 (0)