Skip to content

Commit 04c99f2

Browse files
committed
Auto merge of #148593 - pietroalbini:ea-1.91.1, r=BoxyUwU
[stable] Prepare Rust 1.91.1 This PR prepares the artifacts for Rust 1.91.1, targeting next Monday with the following backports: * #148322 * #148363 cc `@rust-lang/release`
2 parents f8297e3 + e42a4ca commit 04c99f2

File tree

7 files changed

+55
-2
lines changed

7 files changed

+55
-2
lines changed

RELEASES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 1.91.1 (2025-11-10)
2+
===========================
3+
4+
<a id="1.91.1"></a>
5+
6+
- [Enable file locking support in illumos](https://github.com/rust-lang/rust/pull/148322). This fixes Cargo not locking the build directory on illumos.
7+
- [Fix `wasm_import_module` attribute cross-crate](https://github.com/rust-lang/rust/pull/148363). This fixes linker errors on WASM targets.
8+
19
Version 1.91.0 (2025-10-30)
210
==========================
311

compiler/rustc_symbol_mangling/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn compute_symbol_name<'tcx>(
228228
// However, we don't have the wasm import module map there yet.
229229
tcx.is_foreign_item(def_id)
230230
&& tcx.sess.target.is_like_wasm
231-
&& tcx.wasm_import_module_map(LOCAL_CRATE).contains_key(&def_id.into())
231+
&& tcx.wasm_import_module_map(def_id.krate).contains_key(&def_id.into())
232232
};
233233

234234
if !wasm_import_module_exception_force_mangling {

library/std/src/fs/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rand::RngCore;
55
target_os = "freebsd",
66
target_os = "linux",
77
target_os = "netbsd",
8+
target_os = "illumos",
89
target_vendor = "apple",
910
))]
1011
use crate::assert_matches::assert_matches;
@@ -14,6 +15,7 @@ use crate::char::MAX_LEN_UTF8;
1415
target_os = "freebsd",
1516
target_os = "linux",
1617
target_os = "netbsd",
18+
target_os = "illumos",
1719
target_vendor = "apple",
1820
))]
1921
use crate::fs::TryLockError;
@@ -227,6 +229,7 @@ fn file_test_io_seek_and_write() {
227229
target_os = "linux",
228230
target_os = "netbsd",
229231
target_os = "solaris",
232+
target_os = "illumos",
230233
target_vendor = "apple",
231234
))]
232235
fn file_lock_multiple_shared() {
@@ -251,6 +254,7 @@ fn file_lock_multiple_shared() {
251254
target_os = "linux",
252255
target_os = "netbsd",
253256
target_os = "solaris",
257+
target_os = "illumos",
254258
target_vendor = "apple",
255259
))]
256260
fn file_lock_blocking() {
@@ -276,6 +280,7 @@ fn file_lock_blocking() {
276280
target_os = "linux",
277281
target_os = "netbsd",
278282
target_os = "solaris",
283+
target_os = "illumos",
279284
target_vendor = "apple",
280285
))]
281286
fn file_lock_drop() {
@@ -298,6 +303,7 @@ fn file_lock_drop() {
298303
target_os = "linux",
299304
target_os = "netbsd",
300305
target_os = "solaris",
306+
target_os = "illumos",
301307
target_vendor = "apple",
302308
))]
303309
fn file_lock_dup() {

library/std/src/sys/fs/unix.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ impl File {
12861286
target_os = "netbsd",
12871287
target_os = "openbsd",
12881288
target_os = "cygwin",
1289+
target_os = "illumos",
12891290
target_vendor = "apple",
12901291
))]
12911292
pub fn lock(&self) -> io::Result<()> {
@@ -1310,6 +1311,7 @@ impl File {
13101311
target_os = "openbsd",
13111312
target_os = "cygwin",
13121313
target_os = "solaris",
1314+
target_os = "illumos",
13131315
target_vendor = "apple",
13141316
)))]
13151317
pub fn lock(&self) -> io::Result<()> {
@@ -1323,6 +1325,7 @@ impl File {
13231325
target_os = "netbsd",
13241326
target_os = "openbsd",
13251327
target_os = "cygwin",
1328+
target_os = "illumos",
13261329
target_vendor = "apple",
13271330
))]
13281331
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1347,6 +1350,7 @@ impl File {
13471350
target_os = "openbsd",
13481351
target_os = "cygwin",
13491352
target_os = "solaris",
1353+
target_os = "illumos",
13501354
target_vendor = "apple",
13511355
)))]
13521356
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1360,6 +1364,7 @@ impl File {
13601364
target_os = "netbsd",
13611365
target_os = "openbsd",
13621366
target_os = "cygwin",
1367+
target_os = "illumos",
13631368
target_vendor = "apple",
13641369
))]
13651370
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1400,6 +1405,7 @@ impl File {
14001405
target_os = "openbsd",
14011406
target_os = "cygwin",
14021407
target_os = "solaris",
1408+
target_os = "illumos",
14031409
target_vendor = "apple",
14041410
)))]
14051411
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1416,6 +1422,7 @@ impl File {
14161422
target_os = "netbsd",
14171423
target_os = "openbsd",
14181424
target_os = "cygwin",
1425+
target_os = "illumos",
14191426
target_vendor = "apple",
14201427
))]
14211428
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1456,6 +1463,7 @@ impl File {
14561463
target_os = "openbsd",
14571464
target_os = "cygwin",
14581465
target_os = "solaris",
1466+
target_os = "illumos",
14591467
target_vendor = "apple",
14601468
)))]
14611469
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1472,6 +1480,7 @@ impl File {
14721480
target_os = "netbsd",
14731481
target_os = "openbsd",
14741482
target_os = "cygwin",
1483+
target_os = "illumos",
14751484
target_vendor = "apple",
14761485
))]
14771486
pub fn unlock(&self) -> io::Result<()> {
@@ -1496,6 +1505,7 @@ impl File {
14961505
target_os = "openbsd",
14971506
target_os = "cygwin",
14981507
target_os = "solaris",
1508+
target_os = "illumos",
14991509
target_vendor = "apple",
15001510
)))]
15011511
pub fn unlock(&self) -> io::Result<()> {

src/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.91.0
1+
1.91.1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![no_std]
2+
3+
#[link(wasm_import_module = "test")]
4+
unsafe extern "C" {
5+
#[link_name = "close"]
6+
pub fn close(x: u32) -> u32;
7+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ only-wasm32
2+
//@ aux-build:link-name-in-foreign-crate.rs
3+
//@ compile-flags: --crate-type cdylib
4+
//@ build-pass
5+
//@ no-prefer-dynamic
6+
7+
extern crate link_name_in_foreign_crate;
8+
9+
// This test that the definition of a function named `close`, which collides
10+
// with the `close` function in libc in theory, is handled correctly in
11+
// cross-crate situations. The `link_name_in_foreign_crate` dependency declares
12+
// `close` from a non-`env` wasm import module and then this crate attempts to
13+
// use the symbol. This should properly ensure that the wasm module name is
14+
// tagged as `test` and the `close` symbol, to LLD, is mangled, to avoid
15+
// colliding with the `close` symbol in libc itself.
16+
17+
#[unsafe(no_mangle)]
18+
pub extern "C" fn foo() {
19+
unsafe {
20+
link_name_in_foreign_crate::close(1);
21+
}
22+
}

0 commit comments

Comments
 (0)