Closed mejrs closed 2 years ago
I think this is a duplicate of #103539. In your branch, the Fluent message is incorrect (using {foo}
rather than {$foo}
which tries to interpolate another message which doesn't exist, rather than a variable/argument). All that's happening here is that it causes the translation to ICE, which in this specific case is hard for us to catch (see https://github.com/rust-lang/rust/issues/103539#issuecomment-1307566388), but also due to the nature of what caused this - shouldn't affect users. This will happen regardless of whether you are running with --bless
, it's just that because the compiler invocation failed with an ICE, --bless
didn't save the output.
Code
See https://github.com/mejrs/rust/tree/translation_ice (most notably, the "oops" commit).
Meta
Error output
``` PS C:\Users\bruno\Rust\rust> python x.py test src/test/ui/suggestions/inner_type.rs --bless Building rustbuild Finished dev [unoptimized] target(s) in 0.08s Building stage0 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 0.27s Copying stage0 std from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc) Building stage0 compiler artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 0.42s Copying stage0 rustc from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc) Assembling stage1 compiler (x86_64-pc-windows-msvc) Building stage1 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 0.30s Copying stage1 std from stage1 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc) Building stage0 tool compiletest (x86_64-pc-windows-msvc) Finished release [optimized] target(s) in 0.29s Check compiletest suite=ui mode=ui (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc) running 1 test F failures: ---- [ui] src/test\ui\suggestions\inner_type.rs stdout ---- error: Error: expected failure status (Some(1)) but received status Some(101). status: exit code: 101 command: PATH="C:\Users\bruno\Rust\rust\build\x86_64-pc-windows-msvc\stage1\bin;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64;C:\Users\bruno\Rust\rust\build\x86_64-pc-windows-msvc\stage0-bootstrap-tools\x86_64-pc-windows-msvc\release\deps;C:\Users\bruno\Rust\rust\build\x86_64-pc-windows-msvc\stage0\bin;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.2.6.0_x64__8wekyb3d8bbwe;C:\Users\bruno\.cargo\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\dotnet\;c:\Program Files\Git\bin;C:\Users\bruno\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\bruno\AppData\Local\Programs\Python\Python310\;C:\Users\bruno\AppData\Local\Microsoft\WindowsApps;C:\Users\bruno\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\bruno\.dotnet\tools" "C:\\Users\\bruno\\Rust\\rust\\build\\x86_64-pc-windows-msvc\\stage1\\bin\\rustc.exe" "C:\\Users\\bruno\\Rust\\rust\\src/test\\ui\\suggestions\\inner_type.rs" "-Zthreads=1" "--target=x86_64-pc-windows-msvc" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "C:\\Users\\bruno\\Rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\suggestions\\inner_type" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=C:\\Users\\bruno\\Rust\\rust\\build\\x86_64-pc-windows-msvc\\native\\rust-test-helpers" "--edition=2021" "-L" "C:\\Users\\bruno\\Rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\suggestions\\inner_type\\auxiliary" stdout: none --- stderr ------------------------------- error[E0599]: no method named `method` found for struct `RefCell` in the current scope --> C:\Users\bruno\Rust\rust\src/test\ui\suggestions\inner_type.rs:17:16 | LL | other_item.method(); | ^^^^^^ method not found in `RefCell>`
|
note: the method `method` exists on the type `Struct`
--> C:\Users\bruno\Rust\rust\src/test\ui\suggestions\inner_type.rs:9:5
|
LL | pub fn method(&self) {}
| ^^^^^^^^^^^^^^^^^^^^
help: use `.borrow()` to borrow the `Struct`, panicking if any outstanding mutable borrows exist.
|
LL | other_item.borrow().method();
| +++++++++
error[E0599]: no method named `some_mutable_method` found for struct `RefCell` in the current scope
--> C:\Users\bruno\Rust\rust\src/test\ui\suggestions\inner_type.rs:21:16
|
LL | other_item.some_mutable_method();
| ^^^^^^^^^^^^^^^^^^^ method not found in `RefCell>`
|
note: the method `some_mutable_method` exists on the type `Struct`
--> C:\Users\bruno\Rust\rust\src/test\ui\suggestions\inner_type.rs:11:5
|
LL | pub fn some_mutable_method(&mut self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: use `.borrow_mut()` to mutably borrow the `Struct`, panicking if any outstanding borrows exist.
|
LL | other_item.borrow_mut().some_mutable_method();
| +++++++++++++
thread 'rustc' panicked at 'identifier: "typeck_method_present_on_inner_type", attr: None, args: FluentArgs([("borrow_kind", String("mutably borrow")), ("borrow_method", String("lock().unwrap()")), ("inner_type_name", String("Struct"))]), errors: [ResolverError(Reference(Message { id: "borrow_method", attribute: None })), ResolverError(Reference(Message { id: "borrow_kind", attribute: None })), ResolverError(Reference(Message { id: "inner_type_name", attribute: None }))]', compiler\rustc_errors\src\translation.rs:91:17
stack backtrace:
0: 0x7ffbe79fa585 - std::backtrace_rs::backtrace::trace_unsynchronized::he88606f6dc7550c6
1: 0x7ffbe79d40a9 - ::fmt::he076d275eafbc118
2: 0x7ffbe7a2c30b - core::fmt::write::hba0b669278d9c5d4
3: 0x7ffbe7a00c4a - std::io::Write::write_fmt::h8b983e7f0a346fbc
4: 0x7ffbe79fe5d4 - std::panicking::default_hook::h246939068f78b9b9
5: 0x7ffbe79fe174 - std::panicking::default_hook::h246939068f78b9b9
6: 0x7ffba26d626d - rustc_driver[6b2af9691b3371e6]::handle_options
7: 0x7ffbe79ff420 - std::panicking::rust_panic_with_hook::ha5ecf9138fb50366
8: 0x7ffbe79d485d - std::sys_common::backtrace::output_filename::h6c89a58e876d7cef
9: 0x7ffbe79d44ef - std::sys_common::backtrace::__rust_end_short_backtrace::h27316d87cc948b7f
10: 0x7ffbe79fef60 - rust_begin_unwind
11: 0x7ffbe7a603e5 - core::panicking::panic_fmt::h0cf1c422f3226b39
12: 0x7ffba554a619 - ::translate_message
13: 0x7ffba553b8de - ::get_multispan_max_line_num
14: 0x7ffba5540c53 - ::emit_messages_default
15: 0x7ffba553970c - ::emit_diagnostic
16: 0x7ffba55319e6 - ::from_errors_diagnostic
17: 0x7ffba552fe3d - ::emit_diagnostic
18: 0x7ffba5527a05 - ::emit_diagnostic
19: 0x7ffba5521d8a - ::diagnostic_builder_emit_producing_guarantee
20: 0x7ffba32c0e74 - ::emit_err::
21: 0x7ffba31865cd - ::report_method_error
22: 0x7ffba31b8140 - ::check_expr_kind
23: 0x7ffba314f92c - ::check_expr_with_expectation_and_args
24: 0x7ffba316b4ed - ::check_stmt
25: 0x7ffba316bbfb - ::check_block_no_value
26: 0x7ffba31b609a - ::check_expr_kind
27: 0x7ffba314f92c - ::check_expr_with_expectation_and_args
28: 0x7ffba31508e7 - ::check_return_expr
29: 0x7ffba312443c - rustc_hir_analysis[6de03e271f472c37]::check::check::check_fn
30: 0x7ffba3237a6f - ::enter::::{closure#1}, &rustc_middle[f39f220e5d25ccac]::ty::context::TypeckResults>
31: 0x7ffba326357d - rustc_hir_analysis[6de03e271f472c37]::check::typeck
32: 0x7ffba442a27d - RINvNtNtCs4PWNCSeCmjD_18rustc_query_system5query8plumbing17try_execute_queryNtNtCsccXh3wGVe3b_16rustc_query_impl8plumbing9QueryCtxtINtNtB4_6caches12DefaultCacheNtNtCsgLXSqfT5oQe_10rustc_span6def_id10LocalDefIdRNtNtNtCskUN6X8gc694_12rustc_middle2ty7context
33: 0x7ffba4576906 - rustc_query_system[3859892e38f9270b]::query::plumbing::get_query::
34: 0x7ffba3260b55 - RNvXsl_NtNtCsckzBuFJ6fEy_4core5panic11unwind_safeINtB5_16AssertUnwindSafeNCNCINvNtCsaGlIXQSCW4V_21rustc_data_structures4sync15par_for_each_inRSNtNtCsgLXSqfT5oQe_10rustc_span6def_id10LocalDefIdNCINvMs0_NtNtCskUN6X8gc694_12rustc_middle3hir3mapNtB3d_3Map15pa
35: 0x7ffba328346c - RINvNtCsaGlIXQSCW4V_21rustc_data_structures4sync15par_for_each_inRSNtNtCsgLXSqfT5oQe_10rustc_span6def_id10LocalDefIdNCINvMs0_NtNtCskUN6X8gc694_12rustc_middle3hir3mapNtB1Z_3Map15par_body_ownersNCNvNtCs9qRL70CdlzL_18rustc_hir_analysis5check18typeck_item_bod
36: 0x7ffba3269365 - rustc_hir_analysis[6de03e271f472c37]::check::typeck_item_bodies
37: 0x7ffba45061ac - rustc_query_system[3859892e38f9270b]::query::plumbing::try_execute_query::>
38: 0x7ffba456a6ff - rustc_query_system[3859892e38f9270b]::query::plumbing::get_query::
39: 0x7ffba32bddd6 - ::time::<(), rustc_hir_analysis[6de03e271f472c37]::check_crate::{closure#7}>
40: 0x7ffba308d119 - rustc_hir_analysis[6de03e271f472c37]::check_crate
41: 0x7ffba28639f2 - rustc_interface[1333b70366473588]::passes::analysis
42: 0x7ffba44f0f3c - rustc_query_system[3859892e38f9270b]::query::plumbing::try_execute_query::>>.
43: 0x7ffba4576d0f - rustc_query_system[3859892e38f9270b]::query::plumbing::get_query::
44: 0x7ffba271a9ac - ::enter::>
45: 0x7ffba26dcc36 - RINvMs2_NtCs1Ed8n81gOTs_15rustc_interface7queriesNtNtB8_9interface8Compiler5enterNCNCNvCs9cs1FDsEeX2_12rustc_driver12run_compilers_0s0_0INtNtCsckzBuFJ6fEy_4core6result6ResultINtNtB2f_6option6OptionNtB6_6LinkerENtCs7V0M0OscWiS_12rustc_errors15ErrorGuarante
46: 0x7ffba2778535 - RINvCsgLXSqfT5oQe_10rustc_span15with_source_mapINtNtCsckzBuFJ6fEy_4core6result6ResultuNtCs7V0M0OscWiS_12rustc_errors15ErrorGuaranteedENCINvNtCs1Ed8n81gOTs_15rustc_interface9interface23create_compiler_and_runBJ_NCNvCs9cs1FDsEeX2_12rustc_driver12run_compile
47: 0x7ffba26de563 - rustc_interface[1333b70366473588]::interface::create_compiler_and_run::, rustc_driver[6b2af9691b3371e6]::run_compiler::{closure#1}>
48: 0x7ffba2763ef7 - RINvMs_Cs4XKhvDowuxM_10scoped_tlsINtB5_9ScopedKeyNtCsgLXSqfT5oQe_10rustc_span14SessionGlobalsE3setNCINvNtCs1Ed8n81gOTs_15rustc_interface9interface12run_compilerINtNtCsckzBuFJ6fEy_4core6result6ResultuNtCs7V0M0OscWiS_12rustc_errors15ErrorGuaranteedENCNvCs9c
49: 0x7ffba271e2c6 - RINvNtNtCs8TzYDGvlNYf_3std10sys_common9backtrace28___rust_begin_short_backtraceNCINvNtCs1Ed8n81gOTs_15rustc_interface4util31run_in_thread_pool_with_globalsNCINvNtB1m_9interface12run_compilerINtNtCsckzBuFJ6fEy_4core6result6ResultuNtCs7V0M0OscWiS_12rustc_er
50: 0x7ffba2723823 - RNCINvNvXsh_NtNtNtCsckzBuFJ6fEy_4core4iter8adapters7flattenINtBa_13FlattenCompatppENtNtNtBe_6traits8iterator8Iterator8try_fold7flattenINtNtNtBg_5slice4iter4IterNtNtCsgLXSqfT5oQe_10rustc_span13span_encoding4SpanEuINtNtNtBg_3ops12control_flow11ControlFlowTN
51: 0x7ffbe79e3c3c - std::sys::windows::thread::Thread::new::thread_start::hbe27a24c4d0b544b
52: 0x7ffc8bd954e0 - BaseThreadInitThunk
53: 0x7ffc8cfe485b - RtlUserThreadStart
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.66.0-dev running on x86_64-pc-windows-msvc
note: compiler flags: -Z threads=1 -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0599`.
```
@rustbot label +A-diagnostics +A-translation