From c724a4e35d67e75bccae0c120f6fd79f39b8875d Mon Sep 17 00:00:00 2001 From: joshua-spacetime Date: Mon, 20 Oct 2025 19:03:07 -0700 Subject: [PATCH] add rust-src to the toolchain and update trybuild test output (#3440) # Description of Changes Adds `rust-src` to the toolchain and updates the expected output of the `trybuild` tests. `rust-src` places the entire source code of the rust stdlib under the local toolchain directory. `rust-analyzer` uses it for "go to definition" (among other things) in the stdlib. When included in the toolchain, rustc can provide code frames that it can't otherwise. The reason for its addition is that if anyone includes it in their local toolchain, the error messages produced by rustc when running the `ui` tests will be slightly different (have some more information) than when run in CI. Hence those tests will fail locally but not in CI. Rather than removing `rust-src` locally so that the tests will pass, I've opted to just add it to the toolchain so that everyone runs with it by default, including in CI. # API and ABI breaking changes None # Expected complexity level and risk 0 # Testing - [x] Updated rustc tests --- crates/bindings/tests/ui/views.stderr | 6 ++++++ rust-toolchain.toml | 1 + 2 files changed, 7 insertions(+) diff --git a/crates/bindings/tests/ui/views.stderr b/crates/bindings/tests/ui/views.stderr index 86a53c154..95108add0 100644 --- a/crates/bindings/tests/ui/views.stderr +++ b/crates/bindings/tests/ui/views.stderr @@ -25,6 +25,9 @@ error[E0599]: `&test__ViewHandle` is not an iterator which is required by `&mut test__ViewHandle: Iterator` note: the trait `Iterator` must be implemented --> $RUST/core/src/iter/traits/iterator.rs + | + | pub trait Iterator { + | ^^^^^^^^^^^^^^^^^^ = help: items from traits can only be used if the trait is implemented and in scope = note: the following traits define an item `count`, perhaps you need to implement one of them: candidate #1: `Table` @@ -54,6 +57,9 @@ error[E0599]: no method named `try_insert` found for reference `&test__ViewHandl candidate #1: `Table` help: there is a method `try_into` with a similar name, but with different arguments --> $RUST/core/src/convert/mod.rs + | + | fn try_into(self) -> Result; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0599]: no method named `delete` found for reference `&test__ViewHandle` in the current scope --> tests/ui/views.rs:43:25 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index db1f035c4..c8bfee792 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -5,3 +5,4 @@ channel = "1.90.0" profile = "default" targets = ["wasm32-unknown-unknown"] +components = ["rust-src"]