public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error
@ 2024-04-07 15:38 roland.illig at gmx dot de
  2024-04-07 19:11 ` [Bug rust/114629] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: roland.illig at gmx dot de @ 2024-04-07 15:38 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

            Bug ID: 114629
           Summary: rust-ast-resolve-expr contains bloated code for
                    funny_error
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rust
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland.illig at gmx dot de
                CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org
  Target Milestone: ---

The file contains funny_error, which unnecessarily bloats the executable in all
installations. That's a waste of resources.

The identifier funny_error should be removed, including everything that depends
on it.

(Background: As the German translator of GCC, I strictly oppose against
insulting the GCC users, therefore I have translated that message free of any
humor. There's enough code bloat already, I consider this one unnecessary.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
@ 2024-04-07 19:11 ` pinskia at gcc dot gnu.org
  2024-04-07 23:44 ` sjames at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-07 19:11 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-07
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |diagnostic

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

  else if (funny_error)
    {
      /* This was a "break rust" or "break gcc", and the identifier failed to
         resolve.  Emit a funny ICE.  We set the finalizer to our custom one,
         and use the lower-level emit_diagnostic () instead of the more common
         internal_error_no_backtrace () in order to pass our locus.  */
      diagnostic_finalizer (global_dc) = funny_ice_finalizer;
      emit_diagnostic (DK_ICE_NOBT, expr.get_locus (), -1,
                       "are you trying to break %s? how dare you?",
                       expr.as_string ().c_str ());

This is not even that funny.
I suggest to remove the idea of funny_error really.
          if (ident == "rust" || ident == "gcc")
            funny_error = true;

...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
  2024-04-07 19:11 ` [Bug rust/114629] " pinskia at gcc dot gnu.org
@ 2024-04-07 23:44 ` sjames at gcc dot gnu.org
  2024-04-08  7:58 ` pierre-emmanuel.patry at embecosm dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-04-07 23:44 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://github.com/Rust-GCC
                   |                            |/gccrs/issues/1996
                 CC|                            |sjames at gcc dot gnu.org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
  2024-04-07 19:11 ` [Bug rust/114629] " pinskia at gcc dot gnu.org
  2024-04-07 23:44 ` sjames at gcc dot gnu.org
@ 2024-04-08  7:58 ` pierre-emmanuel.patry at embecosm dot com
  2024-04-08  8:47 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pierre-emmanuel.patry at embecosm dot com @ 2024-04-08  7:58 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

Pierre-Emmanuel Patry <pierre-emmanuel.patry at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pierre-emmanuel.patry@embec
                   |                            |osm.com

--- Comment #2 from Pierre-Emmanuel Patry <pierre-emmanuel.patry at embecosm dot com> ---
I can see the problem with the message, but I don't think we can remove the
behavior as we have to match rustc's behavior. The compiler has to ICE when
meeting this identifier. I suggest changing the message to rustc's one "It
looks like you're trying to break rust; would you like some ICE?" and removing
the "gcc" identifier check.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (2 preceding siblings ...)
  2024-04-08  7:58 ` pierre-emmanuel.patry at embecosm dot com
@ 2024-04-08  8:47 ` rguenth at gcc dot gnu.org
  2024-04-08  9:45 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-08  8:47 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
is that part of the language standard?  I don't think we have to copy rustc
easter eggs - in fact I'd report this as a bug to them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (3 preceding siblings ...)
  2024-04-08  8:47 ` rguenth at gcc dot gnu.org
@ 2024-04-08  9:45 ` iains at gcc dot gnu.org
  2024-04-09  0:11 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: iains at gcc dot gnu.org @ 2024-04-08  9:45 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
since humour does not always translate - even between en_GB and en_US in some
cases...

I wonder if the better solution in the case of something that is clearly
intended to be humour (which is subjective as per the comments here) is to
leave the text in the original language (perhaps with surrounding quotation
marks correct for the target language).

That way if the (end user) reading the diagnostic can understand the original
language the joke should stand.  It seems a bit unreasonable to expect
translators to find an equivalent joke in the target language (transliteration
is not likely to work in most cases).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (4 preceding siblings ...)
  2024-04-08  9:45 ` iains at gcc dot gnu.org
@ 2024-04-09  0:11 ` pinskia at gcc dot gnu.org
  2024-04-09  7:18   ` Jakub Dupak
  2024-04-09  0:52 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-09  0:11 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Pierre-Emmanuel Patry from comment #2)
> I can see the problem with the message, but I don't think we can remove the
> behavior as we have to match rustc's behavior. The compiler has to ICE when
> meeting this identifier. I suggest changing the message to rustc's one "It
> looks like you're trying to break rust; would you like some ICE?" and
> removing the "gcc" identifier check.

Really this sounds like a bad idea to copy 100% of what rustc does. Instead we
should follow the rust language specification (hopefully that actually exists).

While you are at it, it would be useful to add a link to the rust langauge
specification (like there is for almost all other languages [I see objective-C
is not listed]) to https://gcc.gnu.org/readings.html .

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (5 preceding siblings ...)
  2024-04-09  0:11 ` pinskia at gcc dot gnu.org
@ 2024-04-09  0:52 ` pinskia at gcc dot gnu.org
  2024-04-09  7:07 ` dkm at gcc dot gnu.org
  2024-04-09 10:57 ` iains at gcc dot gnu.org
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-09  0:52 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> While you are at it, it would be useful to add a link to the rust langauge
> specification (like there is for almost all other languages [I see
> objective-C is not listed]) to https://gcc.gnu.org/readings.html .

Also it would be useful to update https://gcc.gnu.org/frontends.html too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (6 preceding siblings ...)
  2024-04-09  0:52 ` pinskia at gcc dot gnu.org
@ 2024-04-09  7:07 ` dkm at gcc dot gnu.org
  2024-04-09 10:57 ` iains at gcc dot gnu.org
  8 siblings, 0 replies; 11+ messages in thread
From: dkm at gcc dot gnu.org @ 2024-04-09  7:07 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

--- Comment #7 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
There's no language spec yet, it's WIP:
https://github.com/rust-lang/rust/issues/113527

Currently, the reference is rustc and the goal is to match its current
behavior.

I think the frontend is not listed because it's currently not
enabled/working-enough.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-09  0:11 ` pinskia at gcc dot gnu.org
@ 2024-04-09  7:18   ` Jakub Dupak
  0 siblings, 0 replies; 11+ messages in thread
From: Jakub Dupak @ 2024-04-09  7:18 UTC (permalink / raw)
  To: gcc-rust

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

There is no specification right now. Just reference implementation. The rustc team is working on it, but it will take a long time and it is not a priority.
There is a language reference, but it is far from the completeness you would need from specification.

BTW, I think it is funny.

On Tue, 9 Apr 2024, at 02:11, pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629
> 
> --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> (In reply to Pierre-Emmanuel Patry from comment #2)
> > I can see the problem with the message, but I don't think we can remove the
> > behavior as we have to match rustc's behavior. The compiler has to ICE when
> > meeting this identifier. I suggest changing the message to rustc's one "It
> > looks like you're trying to break rust; would you like some ICE?" and
> > removing the "gcc" identifier check.
> 
> Really this sounds like a bad idea to copy 100% of what rustc does. Instead we
> should follow the rust language specification (hopefully that actually exists).
> 
> While you are at it, it would be useful to add a link to the rust langauge
> specification (like there is for almost all other languages [I see objective-C
> is not listed]) to https://gcc.gnu.org/readings.html .
> 
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rust/114629] rust-ast-resolve-expr contains bloated code for funny_error
  2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
                   ` (7 preceding siblings ...)
  2024-04-09  7:07 ` dkm at gcc dot gnu.org
@ 2024-04-09 10:57 ` iains at gcc dot gnu.org
  8 siblings, 0 replies; 11+ messages in thread
From: iains at gcc dot gnu.org @ 2024-04-09 10:57 UTC (permalink / raw)
  To: gcc-rust

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114629

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> (In reply to Pierre-Emmanuel Patry from comment #2)


> While you are at it, it would be useful to add a link to the rust langauge
> specification (like there is for almost all other languages [I see
> objective-C is not listed]) to https://gcc.gnu.org/readings.html .

This is getting a bit off-topic for the current PR - but, for the record, I am
not aware of any formal spec for Objective-C/C++ - the API is described in
Apple's developer documentation and compliance is assessed (at least by me) in
terms of "do we implement the things that we claim, in the same way as the
system compiler"?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-04-09 10:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-07 15:38 [Bug rust/114629] New: rust-ast-resolve-expr contains bloated code for funny_error roland.illig at gmx dot de
2024-04-07 19:11 ` [Bug rust/114629] " pinskia at gcc dot gnu.org
2024-04-07 23:44 ` sjames at gcc dot gnu.org
2024-04-08  7:58 ` pierre-emmanuel.patry at embecosm dot com
2024-04-08  8:47 ` rguenth at gcc dot gnu.org
2024-04-08  9:45 ` iains at gcc dot gnu.org
2024-04-09  0:11 ` pinskia at gcc dot gnu.org
2024-04-09  7:18   ` Jakub Dupak
2024-04-09  0:52 ` pinskia at gcc dot gnu.org
2024-04-09  7:07 ` dkm at gcc dot gnu.org
2024-04-09 10:57 ` iains at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).