mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
add check and don't encode #[inline]
This commit is contained in:
parent
b618cdb224
commit
fc128b6764
@ -377,7 +377,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||
ungated!(panic_handler, Normal, template!(Word), WarnFollowing), // RFC 2070
|
||||
|
||||
// Code generation:
|
||||
ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing),
|
||||
ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing, @only_local: true),
|
||||
ungated!(cold, Normal, template!(Word), WarnFollowing),
|
||||
ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing),
|
||||
ungated!(target_feature, Normal, template!(List: r#"enable = "name""#), DuplicatesOk),
|
||||
|
@ -2201,6 +2201,9 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
|
||||
/// Determines whether an item is annotated with an attribute.
|
||||
pub fn has_attr(self, did: DefId, attr: Symbol) -> bool {
|
||||
if cfg!(debug_assertions) && !did.is_local() && rustc_feature::is_builtin_only_local(attr) {
|
||||
bug!("tried to access the `only_local` attribute `{}` from an extern crate", attr);
|
||||
}
|
||||
self.sess.contains_name(&self.get_attrs(did), attr)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user