Skip to content

Commit 03dcde0

Browse files
committedApr 29, 2024
Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=...
In the stabilization attempt of `#[unix_sigpipe = "sig_dfl"]`, a concern was raised related to using a language attribute for the feature: Long term, we want `fn lang_start()` to be definable by any crate, not just libstd. Having a special language attribute in that case becomes awkward. So as a first step towards towards the next stabilization attempt, this PR changes the `#[unix_sigpipe = "..."]` attribute to a compiler flag `-Zon-broken-pipe=...` to remove that concern, since now the language is not "contaminated" by this feature. Another point was also raised, namely that the ui should not leak **how** it does things, but rather what the **end effect** is. The new flag uses the proposed naming. This is of course something that can be iterated on further before stabilization.
1 parent e27af29 commit 03dcde0

File tree

64 files changed

+203
-372
lines changed

Some content is hidden

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

64 files changed

+203
-372
lines changed
 

‎compiler/rustc/src/main.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(unix_sigpipe)]
2-
31
// A note about jemalloc: rustc uses jemalloc when built for CI and
42
// distribution. The obvious way to do this is with the `#[global_allocator]`
53
// mechanism. However, for complicated reasons (see
@@ -34,7 +32,6 @@
3432
// https://github.com/rust-lang/rust/commit/b90cfc887c31c3e7a9e6d462e2464db1fe506175#diff-43914724af6e464c1da2171e4a9b6c7e607d5bc1203fa95c0ab85be4122605ef
3533
// for an example of how to do so.
3634

37-
#[unix_sigpipe = "sig_dfl"]
3835
fn main() {
3936
// See the comment at the top of this file for an explanation of this.
4037
#[cfg(feature = "jemalloc-sys")]

‎compiler/rustc_feature/src/builtin_attrs.rs

-4
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
396396
),
397397

398398
// Entry point:
399-
gated!(
400-
unix_sigpipe, Normal, template!(NameValueStr: "inherit|sig_ign|sig_dfl"), ErrorFollowing,
401-
EncodeCrossCrate::Yes, experimental!(unix_sigpipe)
402-
),
403399
ungated!(start, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
404400
ungated!(no_start, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::No),
405401
ungated!(no_main, CrateLevel, template!(Word), WarnFollowing, EncodeCrossCrate::No),

0 commit comments

Comments
 (0)