Skip to content

Commit d8e8166

Browse files
Auto merge of #144738 - bjorn3:remove_omit_gdb_pretty_printer_section, r=<try>
Remove the omit_gdb_pretty_printer_section attribute try-job: aarch64-apple
2 parents 4b55fe1 + cd8ad69 commit d8e8166

File tree

120 files changed

+210
-387
lines changed

Some content is hidden

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

120 files changed

+210
-387
lines changed

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,3 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
374374
features
375375
}
376376
}
377-
378-
pub(crate) struct OmitGdbPrettyPrinterSectionParser;
379-
380-
impl<S: Stage> NoArgsAttributeParser<S> for OmitGdbPrettyPrinterSectionParser {
381-
const PATH: &[Symbol] = &[sym::omit_gdb_pretty_printer_section];
382-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
383-
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::OmitGdbPrettyPrinterSection;
384-
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ use crate::attributes::allow_unstable::{
1717
AllowConstFnUnstableParser, AllowInternalUnstableParser, UnstableFeatureBoundParser,
1818
};
1919
use crate::attributes::codegen_attrs::{
20-
ColdParser, CoverageParser, ExportNameParser, NakedParser, NoMangleParser,
21-
OmitGdbPrettyPrinterSectionParser, OptimizeParser, TargetFeatureParser, TrackCallerParser,
22-
UsedParser,
20+
ColdParser, CoverageParser, ExportNameParser, NakedParser, NoMangleParser, OptimizeParser,
21+
TargetFeatureParser, TrackCallerParser, UsedParser,
2322
};
2423
use crate::attributes::confusables::ConfusablesParser;
2524
use crate::attributes::deprecation::DeprecationParser;
@@ -187,7 +186,6 @@ attribute_parsers!(
187186
Single<WithoutArgs<NoImplicitPreludeParser>>,
188187
Single<WithoutArgs<NoMangleParser>>,
189188
Single<WithoutArgs<NonExhaustiveParser>>,
190-
Single<WithoutArgs<OmitGdbPrettyPrinterSectionParser>>,
191189
Single<WithoutArgs<ParenSugarParser>>,
192190
Single<WithoutArgs<PassByValueParser>>,
193191
Single<WithoutArgs<PointeeParser>>,

compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
use rustc_codegen_ssa::base::collect_debugger_visualizers_transitive;
44
use rustc_codegen_ssa::traits::*;
5-
use rustc_hir::attrs::AttributeKind;
65
use rustc_hir::def_id::LOCAL_CRATE;
7-
use rustc_hir::find_attr;
86
use rustc_middle::bug;
97
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerType;
108
use rustc_session::config::{CrateType, DebugInfo};
@@ -86,9 +84,6 @@ pub(crate) fn get_or_insert_gdb_debug_scripts_section_global<'ll>(
8684
}
8785

8886
pub(crate) fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
89-
let omit_gdb_pretty_printer_section =
90-
find_attr!(cx.tcx.hir_krate_attrs(), AttributeKind::OmitGdbPrettyPrinterSection);
91-
9287
// To ensure the section `__rustc_debug_gdb_scripts_section__` will not create
9388
// ODR violations at link time, this section will not be emitted for rlibs since
9489
// each rlib could produce a different set of visualizers that would be embedded
@@ -117,8 +112,7 @@ pub(crate) fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
117112
}
118113
});
119114

120-
!omit_gdb_pretty_printer_section
121-
&& cx.sess().opts.debuginfo != DebugInfo::None
115+
cx.sess().opts.debuginfo != DebugInfo::None
122116
&& cx.sess().target.emit_debug_gdb_scripts
123117
&& embed_visualizers
124118
}

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,11 +1257,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
12571257
TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/),
12581258
DuplicatesOk, EncodeCrossCrate::No
12591259
),
1260-
gated!(
1261-
omit_gdb_pretty_printer_section, Normal, template!(Word),
1262-
WarnFollowing, EncodeCrossCrate::No,
1263-
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
1264-
),
12651260
rustc_attr!(
12661261
TEST, pattern_complexity_limit, CrateLevel, template!(NameValueStr: "N"),
12671262
ErrorFollowing, EncodeCrossCrate::No,

compiler/rustc_feature/src/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ declare_features! (
199199
/// Renamed to `dyn_compatible_for_dispatch`.
200200
(removed, object_safe_for_dispatch, "1.83.0", Some(43561),
201201
Some("renamed to `dyn_compatible_for_dispatch`"), 131511),
202+
/// Allows using `#[omit_gdb_pretty_printer_section]`.
203+
(removed, omit_gdb_pretty_printer_section, "CURRENT_RUSTC_VERSION", None, None, 144738),
202204
/// Allows using `#[on_unimplemented(..)]` on traits.
203205
/// (Moved to `rustc_attrs`.)
204206
(removed, on_unimplemented, "1.40.0", None, None, 65794),

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ declare_features! (
225225
(unstable, multiple_supertrait_upcastable, "1.69.0", None),
226226
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
227227
(internal, negative_bounds, "1.71.0", None),
228-
/// Allows using `#[omit_gdb_pretty_printer_section]`.
229-
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
230228
/// Set the maximum pattern complexity allowed (not limited by default).
231229
(internal, pattern_complexity_limit, "1.78.0", None),
232230
/// Allows using pattern types.

compiler/rustc_hir/src/attrs/data_structures.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ pub enum AttributeKind {
391391
/// Represents `#[non_exhaustive]`
392392
NonExhaustive(Span),
393393

394-
/// Represents `#[omit_gdb_pretty_printer_section]`
395-
OmitGdbPrettyPrinterSection,
396-
397394
/// Represents `#[optimize(size|speed)]`
398395
Optimize(OptimizeAttr, Span),
399396

compiler/rustc_hir/src/attrs/encode_cross_crate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ impl AttributeKind {
5555
NoImplicitPrelude(..) => No,
5656
NoMangle(..) => Yes, // Needed for rustdoc
5757
NonExhaustive(..) => Yes, // Needed for rustdoc
58-
OmitGdbPrettyPrinterSection => No,
5958
Optimize(..) => No,
6059
ParenSugar(..) => No,
6160
PassByValue(..) => Yes,

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
289289
| AttributeKind::MacroTransparency(_)
290290
| AttributeKind::Pointee(..)
291291
| AttributeKind::Dummy
292-
| AttributeKind::RustcBuiltinMacro { .. }
293-
| AttributeKind::OmitGdbPrettyPrinterSection,
292+
| AttributeKind::RustcBuiltinMacro { .. },
294293
) => { /* do nothing */ }
295294
Attribute::Parsed(AttributeKind::AsPtr(attr_span)) => {
296295
self.check_applied_to_fn_or_method(hir_id, *attr_span, span, target)

src/doc/rustc-dev-guide/src/tests/directives.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ See [Pretty-printer](compiletest.md#pretty-printer-tests).
298298
- [`should-ice`](compiletest.md#incremental-tests) — incremental cfail should
299299
ICE
300300
- [`reference`] — an annotation linking to a rule in the reference
301+
- `no-debug-pretty-printers` — disable pretty printers for debuginfo tests
301302

302303
[`reference`]: https://github.com/rust-lang/reference/blob/master/docs/authoring.md#test-rule-annotations
303304

0 commit comments

Comments
 (0)