impl AssertModuleSource<'tcx> {
fn check_attr(&self, attr: &ast::Attribute) {
- let (expected_reuse, comp_kind) =
- if self.tcx.sess.check_name(attr, sym::rustc_partition_reused) {
- (CguReuse::PreLto, ComparisonKind::AtLeast)
- } else if self.tcx.sess.check_name(attr, sym::rustc_partition_codegened) {
- (CguReuse::No, ComparisonKind::Exact)
- } else if self.tcx.sess.check_name(attr, sym::rustc_expected_cgu_reuse) {
- match self.field(attr, sym::kind) {
- sym::no => (CguReuse::No, ComparisonKind::Exact),
- sym::pre_dash_lto => (CguReuse::PreLto, ComparisonKind::Exact),
- sym::post_dash_lto => (CguReuse::PostLto, ComparisonKind::Exact),
- sym::any => (CguReuse::PreLto, ComparisonKind::AtLeast),
- other => {
- self.tcx.sess.span_fatal(
- attr.span,
- &format!("unknown cgu-reuse-kind `{}` specified", other),
- );
- }
+ let (expected_reuse, comp_kind) = if attr.has_name(sym::rustc_partition_reused) {
+ (CguReuse::PreLto, ComparisonKind::AtLeast)
+ } else if attr.has_name(sym::rustc_partition_codegened) {
+ (CguReuse::No, ComparisonKind::Exact)
+ } else if attr.has_name(sym::rustc_expected_cgu_reuse) {
+ match self.field(attr, sym::kind) {
+ sym::no => (CguReuse::No, ComparisonKind::Exact),
+ sym::pre_dash_lto => (CguReuse::PreLto, ComparisonKind::Exact),
+ sym::post_dash_lto => (CguReuse::PostLto, ComparisonKind::Exact),
+ sym::any => (CguReuse::PreLto, ComparisonKind::AtLeast),
+ other => {
+ self.tcx.sess.span_fatal(
+ attr.span,
+ &format!("unknown cgu-reuse-kind `{}` specified", other),
+ );
}
- } else {
- return;
- };
+ }
+ } else {
+ return;
+ };
if !self.tcx.sess.opts.debugging_opts.query_dep_graph {
self.tcx.sess.span_fatal(