<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_errors/src, branch 1.68.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.68.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.68.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-01-17T08:09:33+00:00</updated>
<entry>
<title>Remove double spaces after dots in comments</title>
<updated>2023-01-17T08:09:33+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2022-11-16T20:34:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6a28fb42a8b8f1f67fe854c2206148171e434d73'/>
<id>urn:sha1:6a28fb42a8b8f1f67fe854c2206148171e434d73</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco</title>
<updated>2023-01-11T16:30:54+00:00</updated>
<author>
<name>nils</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-01-11T16:30:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73476554e9f89245be50195d5ff8e66cc5e64c82'/>
<id>urn:sha1:73476554e9f89245be50195d5ff8e66cc5e64c82</id>
<content type='text'>
Improve fluent error messages

These have been really frustrating me while migrating diagnostics.
</content>
</entry>
<entry>
<title>Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb</title>
<updated>2023-01-11T16:30:53+00:00</updated>
<author>
<name>nils</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-01-11T16:30:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0681a9652eaaaefb5bada3be3c5303318e5f69b8'/>
<id>urn:sha1:0681a9652eaaaefb5bada3be3c5303318e5f69b8</id>
<content type='text'>
Collect and emit proper backtraces for `delay_span_bug`s

This is a follow-up to #106317, which addresses this comment (https://github.com/rust-lang/rust/issues/106267#issuecomment-1367507507) which notes that `delay_span_bug`s' backtraces are nonsense.

Captures and emits the backtrace of the delayed span bug when it's *created*, rather than using the backtrace of the place where delayed bugs are flushed.

---

To test, I delayed a span bug during HIR typeck, specifically in `typeck_with_fallback`...

Before, note `flush_delayed` on frame 18. This is at the end of the compilation session, far from where the bug is being delayed.

```
error: internal compiler error: test
 --&gt; /home/ubuntu/test.rs:1:1
  |
1 | fn main() {}
  | ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_hir_typeck/src/lib.rs:196:14

thread 'rustc' panicked at 'Box&lt;dyn Any&gt;', compiler/rustc_errors/src/lib.rs:1634:13
stack backtrace:
   0:     0x7f9c3ec69dd1 - std::backtrace_rs::backtrace::libunwind::trace::h26056f81198c6594
                               at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f9c3ec69dd1 - std::backtrace_rs::backtrace::trace_unsynchronized::hacfb345a0c6d5bb1
                               at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f9c3ec69dd1 - std::sys_common::backtrace::_print_fmt::h18ea6016ac8030f3
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f9c3ec69dd1 - &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt::he35dde201d0c2d09
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f9c3ecee308 - core::fmt::write::h094ad263467a053c
                               at /home/ubuntu/rust2/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f9c3ec8aaf1 - std::io::Write::write_fmt::hd47b4e2324b4d9b7
                               at /home/ubuntu/rust2/library/std/src/io/mod.rs:1682:15
   6:     0x7f9c3ec69bfa - std::sys_common::backtrace::_print::h43044162653a17fc
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f9c3ec69bfa - std::sys_common::backtrace::print::hc8605da258fa5aeb
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f9c3ec4db87 - std::panicking::default_hook::{{closure}}::h9e37f23f75122a15
   9:     0x7f9c3ec4d97b - std::panicking::default_hook::h602873a063f84da2
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:286:9
  10:     0x7f9c3f6672b2 - &lt;alloc[48d7b30605060536]::boxed::Box&lt;dyn for&lt;'a, 'b&gt; core[672e3947e150d6c6]::ops::function::Fn&lt;(&amp;'a core[672e3947e150d6c6]::panic::panic_info::PanicInfo&lt;'b&gt;,), Output = ()&gt; + core[672e3947e150d6c6]::marker::Send + core[672e3947e150d6c6]::marker::Sync&gt; as core[672e3947e150d6c6]::ops::function::Fn&lt;(&amp;core[672e3947e150d6c6]::panic::panic_info::PanicInfo,)&gt;&gt;::call
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
  11:     0x7f9c3f6672b2 - rustc_driver[f5b6d32d8905ecdd]::DEFAULT_HOOK::{closure#0}::{closure#0}
                               at /home/ubuntu/rust2/compiler/rustc_driver/src/lib.rs:1204:17
  12:     0x7f9c3ec4e0d3 - &lt;alloc::boxed::Box&lt;F,A&gt; as core::ops::function::Fn&lt;Args&gt;&gt;::call::hfd13333ca953ae8e
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
  13:     0x7f9c3ec4e0d3 - std::panicking::rust_panic_with_hook::h45753e10264ebe7e
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:692:13
  14:     0x7f9c422a1aa3 - std[3330b4673efabfce]::panicking::begin_panic::&lt;rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug&gt;::{closure#0}
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:608:9
  15:     0x7f9c422a1a46 - std[3330b4673efabfce]::sys_common::backtrace::__rust_end_short_backtrace::&lt;std[3330b4673efabfce]::panicking::begin_panic&lt;rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug&gt;::{closure#0}, !&gt;
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:137:18
  16:     0x7f9c3f63a996 - std[3330b4673efabfce]::panicking::begin_panic::&lt;rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug&gt;
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:607:12
  17:     0x7f9c4227a496 - std[3330b4673efabfce]::panic::panic_any::&lt;rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug&gt;
                               at /home/ubuntu/rust2/library/std/src/panic.rs:61:5
  18:     0x7f9c4227cdf7 - &lt;rustc_errors[1b15f4e7e49d1fd5]::HandlerInner&gt;::flush_delayed::&lt;alloc[48d7b30605060536]::vec::Vec&lt;rustc_errors[1b15f4e7e49d1fd5]::diagnostic::Diagnostic&gt;, &amp;str, rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug&gt;
                               at /home/ubuntu/rust2/compiler/rustc_errors/src/lib.rs:1634:13
  19:     0x7f9c422498cf - &lt;rustc_errors[1b15f4e7e49d1fd5]::Handler&gt;::flush_delayed
                               at /home/ubuntu/rust2/compiler/rustc_errors/src/lib.rs:1225:9

[ FRAMES INTENTIONALLY OMITTED ]

  44:     0x7f9c3f6f3584 - &lt;std[3330b4673efabfce]::thread::Builder&gt;::spawn_unchecked_::&lt;rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals&lt;rustc_interface[947706ead88047d0]::interface::run_compiler&lt;core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}&gt;::{closure#0}, core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;&gt;::{closure#1}
                               at /home/ubuntu/rust2/library/std/src/thread/mod.rs:549:30
  45:     0x7f9c3f6f3584 - &lt;&lt;std[3330b4673efabfce]::thread::Builder&gt;::spawn_unchecked_&lt;rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals&lt;rustc_interface[947706ead88047d0]::interface::run_compiler&lt;core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}&gt;::{closure#0}, core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result&lt;(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed&gt;&gt;::{closure#1} as core[672e3947e150d6c6]::ops::function::FnOnce&lt;()&gt;&gt;::call_once::{shim:vtable#0}
                               at /home/ubuntu/rust2/library/core/src/ops/function.rs:250:5
  46:     0x7f9c3ec81968 - &lt;alloc::boxed::Box&lt;F,A&gt; as core::ops::function::FnOnce&lt;Args&gt;&gt;::call_once::he8b26fc22c6f51ec
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
  47:     0x7f9c3ec81968 - &lt;alloc::boxed::Box&lt;F,A&gt; as core::ops::function::FnOnce&lt;Args&gt;&gt;::call_once::h5cf9cbe75a8c3ddc
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
  48:     0x7f9c3ec5f99c - std::sys::unix::thread::Thread::new::thread_start::h2d6dd4455e97d031
                               at /home/ubuntu/rust2/library/std/src/sys/unix/thread.rs:108:17
  49:     0x7f9c37c69609 - start_thread
  50:     0x7f9c3ead0133 - clone
  51:                0x0 - &lt;unknown&gt;
```

After, note `typeck_with_fallback` on the 5th frame, that's where we *actually* need to be pointed to:

```
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: test
 --&gt; /home/ubuntu/test.rs:1:1
  |
1 | fn main() {}
  | ^^^^^^^^^
  |
  = note: delayed at    0: &lt;rustc_errors::HandlerInner&gt;::emit_diagnostic
                       at ./compiler/rustc_errors/src/lib.rs:1279:29
             1: &lt;rustc_errors::HandlerInner&gt;::delay_span_bug::&lt;rustc_span::span_encoding::Span, &amp;str&gt;
                       at ./compiler/rustc_errors/src/lib.rs:1553:9
             2: &lt;rustc_errors::Handler&gt;::delay_span_bug::&lt;rustc_span::span_encoding::Span, &amp;str&gt;
                       at ./compiler/rustc_errors/src/lib.rs:995:9
             3: &lt;rustc_session::session::Session&gt;::delay_span_bug::&lt;rustc_span::span_encoding::Span, &amp;str&gt;
                       at ./compiler/rustc_session/src/session.rs:600:9
             4: rustc_hir_typeck::typeck_with_fallback::&lt;rustc_hir_typeck::typeck::{closure#0}&gt;::{closure#0}
                       at ./compiler/rustc_hir_typeck/src/lib.rs:196:5
             5: rustc_hir_typeck::typeck_with_fallback::&lt;rustc_hir_typeck::typeck::{closure#0}&gt;
                       at ./compiler/rustc_hir_typeck/src/lib.rs:185:36
             6: rustc_hir_typeck::typeck
                       at ./compiler/rustc_hir_typeck/src/lib.rs:166:9

[ FRAMES INTENTIONALLY OMITTED ]

           108: std::panicking::try::&lt;core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;, core::panic::unwind_safe::AssertUnwindSafe&lt;&lt;std::thread::Builder&gt;::spawn_unchecked_&lt;rustc_interface::util::run_in_thread_pool_with_globals&lt;rustc_interface::interface::run_compiler&lt;core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;, rustc_driver::run_compiler::{closure#1}&gt;::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#1}::{closure#0}&gt;&gt;
                       at ./library/std/src/panicking.rs:447:19
           109: std::panic::catch_unwind::&lt;core::panic::unwind_safe::AssertUnwindSafe&lt;&lt;std::thread::Builder&gt;::spawn_unchecked_&lt;rustc_interface::util::run_in_thread_pool_with_globals&lt;rustc_interface::interface::run_compiler&lt;core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;, rustc_driver::run_compiler::{closure#1}&gt;::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#1}::{closure#0}&gt;, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;
                       at ./library/std/src/panic.rs:140:14
           110: &lt;std::thread::Builder&gt;::spawn_unchecked_::&lt;rustc_interface::util::run_in_thread_pool_with_globals&lt;rustc_interface::interface::run_compiler&lt;core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;, rustc_driver::run_compiler::{closure#1}&gt;::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#1}
                       at ./library/std/src/thread/mod.rs:549:30
           111: &lt;&lt;std::thread::Builder&gt;::spawn_unchecked_&lt;rustc_interface::util::run_in_thread_pool_with_globals&lt;rustc_interface::interface::run_compiler&lt;core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;, rustc_driver::run_compiler::{closure#1}&gt;::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#0}::{closure#0}, core::result::Result&lt;(), rustc_errors::ErrorGuaranteed&gt;&gt;::{closure#1} as core::ops::function::FnOnce&lt;()&gt;&gt;::call_once::{shim:vtable#0}
                       at ./library/core/src/ops/function.rs:250:5
           112: &lt;alloc::boxed::Box&lt;F,A&gt; as core::ops::function::FnOnce&lt;Args&gt;&gt;::call_once
                       at ./library/alloc/src/boxed.rs:1988:9
           113: &lt;alloc::boxed::Box&lt;F,A&gt; as core::ops::function::FnOnce&lt;Args&gt;&gt;::call_once
                       at ./library/alloc/src/boxed.rs:1988:9
           114: std::sys::unix::thread::Thread::new::thread_start
                       at ./library/std/src/sys/unix/thread.rs:108:17
           115: start_thread
           116: clone
```
</content>
</entry>
<entry>
<title>create helper function for `rustc_lint_defs::Level` and remove it's duplicated code r=ozkanonur</title>
<updated>2023-01-10T07:56:17+00:00</updated>
<author>
<name>ozkanonur</name>
<email>work@onurozkan.dev</email>
</author>
<published>2023-01-10T07:56:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5fb9ca3c5e34a0ad4e4770ea475d75b26e201b61'/>
<id>urn:sha1:5fb9ca3c5e34a0ad4e4770ea475d75b26e201b61</id>
<content type='text'>
Signed-off-by: ozkanonur &lt;work@onurozkan.dev&gt;
</content>
</entry>
<entry>
<title>Collect backtraces for delayed span-bugs too</title>
<updated>2023-01-09T22:04:00+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2022-12-31T01:56:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=05c1ac0215ef282c9ed6df6a5f758d824ee1ace9'/>
<id>urn:sha1:05c1ac0215ef282c9ed6df6a5f758d824ee1ace9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix tests</title>
<updated>2023-01-08T23:23:27+00:00</updated>
<author>
<name>mejrs</name>
<email></email>
</author>
<published>2023-01-08T23:23:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4c0c32c895df28b762a61958b21cbe4d68f60238'/>
<id>urn:sha1:4c0c32c895df28b762a61958b21cbe4d68f60238</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make translate_message return result and add tests</title>
<updated>2023-01-08T22:35:43+00:00</updated>
<author>
<name>mejrs</name>
<email></email>
</author>
<published>2023-01-08T22:35:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=262ff86138730c1eb65f3ec39dd9c93222ed77e7'/>
<id>urn:sha1:262ff86138730c1eb65f3ec39dd9c93222ed77e7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco</title>
<updated>2023-01-07T19:43:19+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-01-07T19:43:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=771cfa5581fd245b0d45e839e791b10e01ebb8a7'/>
<id>urn:sha1:771cfa5581fd245b0d45e839e791b10e01ebb8a7</id>
<content type='text'>
Migrate `codegen_ssa` to diagnostics structs - [Part 3]

Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates:
1. [`rustc_middle::mir::interpret::InterpError`](https://github.com/rust-lang/rust/blob/b6097f2e1b2ca62e188ba53cf43bd66b06b36915/compiler/rustc_middle/src/mir/interpret/error.rs#L475): I saw `rustc_middle` is unassigned, I am open to take this work.

2.  `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](https://github.com/rust-lang/rust/commit/9a31b3cdda78a2c0891828254fe9886e0a1cfd16) of this PR, but would like to know the team's preference on how we should keep replacing the other macros:
2.1. Update macros to expect a `Diagnostic`
2.2. Remove macros and expand the code on each use.
See [some examples of the different options in this experimental commit](https://github.com/JhonnyBillM/rust/commit/64aee83e80857dcfa450f0c6e31d5f29c6d577e6)

_Part 2 - https://github.com/rust-lang/rust/pull/103792_

r? ``@davidtwco``
Cc ``@compiler-errors``
</content>
</entry>
<entry>
<title>Rollup merge of #106287 - Nilstrieb:its-bugging-me-how-we-dont-have-docs, r=jyn514</title>
<updated>2023-01-06T20:26:09+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-01-06T20:26:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7568c49bf0c11038635458cabb9661b6b4297d74'/>
<id>urn:sha1:7568c49bf0c11038635458cabb9661b6b4297d74</id>
<content type='text'>
Add some docs to `bug`, `span_bug` and `delay_span_bug`

cc `@mejrs` as you wanted me to do this, does this look good and understandable?
</content>
</entry>
<entry>
<title>Improve fluent error messages</title>
<updated>2023-01-05T02:39:07+00:00</updated>
<author>
<name>mejrs</name>
<email></email>
</author>
<published>2023-01-05T02:39:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0b5d6ae5dbbbe6b05a85bdcccc8aedbb96feedf4'/>
<id>urn:sha1:0b5d6ae5dbbbe6b05a85bdcccc8aedbb96feedf4</id>
<content type='text'>
</content>
</entry>
</feed>
