Skip to content

Commit 87937d3

Browse files
committed
Auto merge of #96548 - Dylan-DPC:rollup-m3xkqxg, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #96477 (Update data layout string for wasm64-unknown-unknown) - #96481 (HashMap doc: Don't use monospace font for 'Entry Api') - #96492 (Revert "Re-export core::ffi types from std::ffi") - #96516 (Revert diagnostic duplication and accidental stabilization) - #96523 (Add ``@feat.00`` symbol to symbols.o for COFF) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5560c51 + 48199e0 commit 87937d3

File tree

54 files changed

+158
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+158
-587
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,29 @@ fn add_linked_symbol_object(
17001700
// We handle the name decoration of COFF targets in `symbol_export.rs`, so disable the
17011701
// default mangler in `object` crate.
17021702
file.set_mangling(object::write::Mangling::None);
1703+
1704+
// Add feature flags to the object file. On MSVC this is optional but LLD will complain if
1705+
// not present.
1706+
let mut feature = 0;
1707+
1708+
if file.architecture() == object::Architecture::I386 {
1709+
// Indicate that all SEH handlers are registered in .sxdata section.
1710+
// We don't have generate any code, so we don't need .sxdata section but LLD still
1711+
// expects us to set this bit (see #96498).
1712+
// Reference: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
1713+
feature |= 1;
1714+
}
1715+
1716+
file.add_symbol(object::write::Symbol {
1717+
name: "@feat.00".into(),
1718+
value: feature,
1719+
size: 0,
1720+
kind: object::SymbolKind::Data,
1721+
scope: object::SymbolScope::Compilation,
1722+
weak: false,
1723+
section: object::write::SymbolSection::Absolute,
1724+
flags: object::SymbolFlags::None,
1725+
});
17031726
}
17041727

17051728
for (sym, kind) in symbols.iter() {

compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn target() -> Target {
3636
Target {
3737
llvm_target: "wasm64-unknown-unknown".into(),
3838
pointer_width: 64,
39-
data_layout: "e-m:e-p:64:64-i64:64-n32:64-S128-ni:1:10:20".into(),
39+
data_layout: "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20".into(),
4040
arch: "wasm64".into(),
4141
options,
4242
}

compiler/rustc_typeck/src/check/check.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ pub(super) fn check_fn<'a, 'tcx>(
102102
DUMMY_SP,
103103
param_env,
104104
));
105+
// HACK(oli-obk): we rewrite the declared return type, too, so that we don't end up inferring all
106+
// unconstrained RPIT to have `()` as their hidden type. This would happen because further down we
107+
// compare the ret_coercion with declared_ret_ty, and anything uninferred would be inferred to the
108+
// opaque type itself. That again would cause writeback to assume we have a recursive call site
109+
// and do the sadly stabilized fallback to `()`.
110+
let declared_ret_ty = ret_ty;
105111
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(ret_ty)));
106112
fcx.ret_type_span = Some(decl.output.span());
107113

library/alloc/tests/c_str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::borrow::Cow::{Borrowed, Owned};
2-
use std::ffi::{c_char, CStr};
2+
use std::ffi::CStr;
3+
use std::os::raw::c_char;
34

45
#[test]
56
fn to_str() {

library/std/src/collections/hash/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ use crate::sys;
136136
/// ]);
137137
/// ```
138138
///
139-
/// `HashMap` implements an [`Entry API`](#method.entry), which allows
139+
/// `HashMap` implements an [`Entry` API](#method.entry), which allows
140140
/// for complex methods of getting, setting, updating and removing keys and
141141
/// their values:
142142
///

library/std/src/ffi/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,6 @@ pub use self::os_str::{OsStr, OsString};
171171
#[stable(feature = "core_c_void", since = "1.30.0")]
172172
pub use core::ffi::c_void;
173173

174-
#[unstable(feature = "core_ffi_c", issue = "94501")]
175-
pub use core::ffi::{
176-
c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint,
177-
c_ulong, c_ulonglong, c_ushort,
178-
};
179-
180-
#[unstable(feature = "c_size_t", issue = "88345")]
181-
pub use core::ffi::{c_ptrdiff_t, c_size_t, c_ssize_t};
182-
183174
#[unstable(
184175
feature = "c_variadic",
185176
reason = "the `c_variadic` feature has not been properly tested on \

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@
307307
// Only for re-exporting:
308308
#![feature(assert_matches)]
309309
#![feature(async_iterator)]
310-
#![feature(c_size_t)]
311310
#![feature(c_variadic)]
312311
#![feature(cfg_accessible)]
313312
#![feature(cfg_eval)]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# only-windows
2+
# needs-rust-lld
3+
4+
-include ../../run-make-fulldeps/tools.mk
5+
6+
# Ensure that LLD can link
7+
all:
8+
$(RUSTC) -C linker=rust-lld foo.rs

src/test/run-make/issue-96498/foo.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#![crate_type = "cdylib"]
2+
3+
#[no_mangle]
4+
extern "C" fn foo() {}

src/test/ui/associated-types/impl-trait-return-missing-constraint.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn bar() -> impl Bar {
2424

2525
fn baz() -> impl Bar<Item = i32> {
2626
//~^ ERROR type mismatch resolving `<impl Bar as Foo>::Item == i32`
27-
//~| ERROR type mismatch resolving `<impl Bar as Foo>::Item == i32`
2827
bar()
2928
}
3029

0 commit comments

Comments
 (0)