Skip to content

Commit 7b5b87d

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents dfb552e + d97ec97 commit 7b5b87d

File tree

229 files changed

+1699
-541
lines changed

Some content is hidden

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

229 files changed

+1699
-541
lines changed

Cargo.lock

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,6 +3488,7 @@ dependencies = [
34883488
"rustc_trait_selection",
34893489
"rustc_ty_utils",
34903490
"serde_json",
3491+
"time",
34913492
"tracing",
34923493
"windows",
34933494
]
@@ -5142,6 +5143,33 @@ dependencies = [
51425143
name = "tier-check"
51435144
version = "0.1.0"
51445145

5146+
[[package]]
5147+
name = "time"
5148+
version = "0.3.22"
5149+
source = "registry+https://github.com/rust-lang/crates.io-index"
5150+
checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
5151+
dependencies = [
5152+
"itoa",
5153+
"serde",
5154+
"time-core",
5155+
"time-macros",
5156+
]
5157+
5158+
[[package]]
5159+
name = "time-core"
5160+
version = "0.1.1"
5161+
source = "registry+https://github.com/rust-lang/crates.io-index"
5162+
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
5163+
5164+
[[package]]
5165+
name = "time-macros"
5166+
version = "0.2.9"
5167+
source = "registry+https://github.com/rust-lang/crates.io-index"
5168+
checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
5169+
dependencies = [
5170+
"time-core",
5171+
]
5172+
51455173
[[package]]
51465174
name = "tinystr"
51475175
version = "0.7.1"

RELEASES.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Cargo
9292
-----
9393
- [Allow named debuginfo options in `Cargo.toml`.](https://github.com/rust-lang/cargo/pull/11958/)
9494
- [Add `workspace_default_members` to the output of `cargo metadata`.](https://github.com/rust-lang/cargo/pull/11978/)
95-
- [`cargo add` now considers `rust-version` when selecting packages.](https://github.com/rust-lang/cargo/pull/12078/)
9695
- [Automatically inherit workspace fields when running `cargo new`/`cargo init`.](https://github.com/rust-lang/cargo/pull/12069/)
9796

9897
<a id="1.71.0-Rustdoc"></a>

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,13 +1619,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16191619
debug!(?hir_bounds);
16201620

16211621
let lifetime_mapping = if in_trait {
1622-
self.arena.alloc_from_iter(
1623-
collected_lifetime_mapping
1624-
.iter()
1625-
.map(|(lifetime, def_id)| (**lifetime, *def_id)),
1622+
Some(
1623+
&*self.arena.alloc_from_iter(
1624+
collected_lifetime_mapping
1625+
.iter()
1626+
.map(|(lifetime, def_id)| (**lifetime, *def_id)),
1627+
),
16261628
)
16271629
} else {
1628-
&mut []
1630+
None
16291631
};
16301632

16311633
let opaque_ty_item = hir::OpaqueTy {
@@ -2090,13 +2092,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20902092
debug!("lower_async_fn_ret_ty: generic_params={:#?}", generic_params);
20912093

20922094
let lifetime_mapping = if in_trait {
2093-
self.arena.alloc_from_iter(
2094-
collected_lifetime_mapping
2095-
.iter()
2096-
.map(|(lifetime, def_id)| (**lifetime, *def_id)),
2095+
Some(
2096+
&*self.arena.alloc_from_iter(
2097+
collected_lifetime_mapping
2098+
.iter()
2099+
.map(|(lifetime, def_id)| (**lifetime, *def_id)),
2100+
),
20972101
)
20982102
} else {
2099-
&mut []
2103+
None
21002104
};
21012105

21022106
let opaque_ty_item = hir::OpaqueTy {

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
695695
.find_map(find_fn_kind_from_did),
696696
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => tcx
697697
.explicit_item_bounds(def_id)
698-
.arg_iter_copied(tcx, args)
698+
.iter_instantiated_copied(tcx, args)
699699
.find_map(|(clause, span)| find_fn_kind_from_did((clause, span))),
700700
ty::Closure(_, args) => match args.as_closure().kind() {
701701
ty::ClosureKind::Fn => Some(hir::Mutability::Not),

compiler/rustc_codegen_cranelift/example/float-minmax-pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222

2323
#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
2424
let nan = f32::NAN;
25-
// MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
25+
// MIPS hardware except MIPS R6 treats f32::NAN as SNAN. Clear the signaling bit.
2626
// See https://github.com/rust-lang/rust/issues/52746.
2727
#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
2828
let nan = f32::from_bits(f32::NAN.to_bits() - 1);

compiler/rustc_codegen_gcc/example/alloc_system.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
#[cfg(any(target_arch = "x86",
1111
target_arch = "arm",
1212
target_arch = "mips",
13+
target_arch = "mips32r6",
1314
target_arch = "powerpc",
1415
target_arch = "powerpc64"))]
1516
const MIN_ALIGN: usize = 8;
1617
#[cfg(any(target_arch = "x86_64",
1718
target_arch = "aarch64",
1819
target_arch = "loongarch64",
1920
target_arch = "mips64",
21+
target_arch = "mips64r6",
2022
target_arch = "s390x",
2123
target_arch = "sparc64"))]
2224
const MIN_ALIGN: usize = 16;

compiler/rustc_codegen_llvm/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
codegen_llvm_copy_bitcode = failed to copy bitcode to object file: {$err}
22
33
codegen_llvm_dlltool_fail_import_library =
4-
Dlltool could not create import library: {$stdout}
4+
Dlltool could not create import library with {$dlltool_path} {$dlltool_args}:
5+
{$stdout}
56
{$stderr}
67
78
codegen_llvm_dynamic_linking_with_lto =

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ pub fn from_fn_attrs<'ll, 'tcx>(
335335
to_add.extend(probestack_attr(cx));
336336
to_add.extend(stackprotector_attr(cx));
337337

338+
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NO_BUILTINS) {
339+
to_add.push(llvm::CreateAttrString(cx.llcx, "no-builtins"));
340+
}
341+
338342
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) {
339343
to_add.push(AttributeKind::Cold.create_attr(cx.llcx));
340344
}

compiler/rustc_codegen_llvm/src/back/archive.rs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,24 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
198198
"arm" => ("arm", "--32"),
199199
_ => panic!("unsupported arch {}", sess.target.arch),
200200
};
201-
let result = std::process::Command::new(&dlltool)
202-
.args([
203-
"-d",
204-
def_file_path.to_str().unwrap(),
205-
"-D",
206-
lib_name,
207-
"-l",
208-
output_path.to_str().unwrap(),
209-
"-m",
210-
dlltool_target_arch,
211-
"-f",
212-
dlltool_target_bitness,
213-
"--no-leading-underscore",
214-
"--temp-prefix",
215-
temp_prefix.to_str().unwrap(),
216-
])
217-
.output();
218-
219-
match result {
201+
let mut dlltool_cmd = std::process::Command::new(&dlltool);
202+
dlltool_cmd.args([
203+
"-d",
204+
def_file_path.to_str().unwrap(),
205+
"-D",
206+
lib_name,
207+
"-l",
208+
output_path.to_str().unwrap(),
209+
"-m",
210+
dlltool_target_arch,
211+
"-f",
212+
dlltool_target_bitness,
213+
"--no-leading-underscore",
214+
"--temp-prefix",
215+
temp_prefix.to_str().unwrap(),
216+
]);
217+
218+
match dlltool_cmd.output() {
220219
Err(e) => {
221220
sess.emit_fatal(ErrorCallingDllTool {
222221
dlltool_path: dlltool.to_string_lossy(),
@@ -226,6 +225,12 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
226225
// dlltool returns '0' on failure, so check for error output instead.
227226
Ok(output) if !output.stderr.is_empty() => {
228227
sess.emit_fatal(DlltoolFailImportLibrary {
228+
dlltool_path: dlltool.to_string_lossy(),
229+
dlltool_args: dlltool_cmd
230+
.get_args()
231+
.map(|arg| arg.to_string_lossy())
232+
.collect::<Vec<_>>()
233+
.join(" "),
229234
stdout: String::from_utf8_lossy(&output.stdout),
230235
stderr: String::from_utf8_lossy(&output.stderr),
231236
})

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ pub(crate) struct ErrorCallingDllTool<'a> {
8181
#[derive(Diagnostic)]
8282
#[diag(codegen_llvm_dlltool_fail_import_library)]
8383
pub(crate) struct DlltoolFailImportLibrary<'a> {
84+
pub dlltool_path: Cow<'a, str>,
85+
pub dlltool_args: String,
8486
pub stdout: Cow<'a, str>,
8587
pub stderr: Cow<'a, str>,
8688
}

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
193193
}
194194
"x86" => Architecture::I386,
195195
"s390x" => Architecture::S390x,
196-
"mips" => Architecture::Mips,
197-
"mips64" => Architecture::Mips64,
196+
"mips" | "mips32r6" => Architecture::Mips,
197+
"mips64" | "mips64r6" => Architecture::Mips64,
198198
"x86_64" => {
199199
if sess.target.pointer_width == 32 {
200200
Architecture::X86_64_X32

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {
362362

363363
impl<B: WriteBackendMethods> CodegenContext<B> {
364364
pub fn create_diag_handler(&self) -> Handler {
365-
Handler::with_emitter(true, None, Box::new(self.diag_emitter.clone()))
365+
Handler::with_emitter(true, None, Box::new(self.diag_emitter.clone()), None)
366366
}
367367

368368
pub fn config(&self, kind: ModuleKind) -> &ModuleConfig {

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_ast::{ast, MetaItemKind, NestedMetaItem};
1+
use rustc_ast::{ast, attr, MetaItemKind, NestedMetaItem};
22
use rustc_attr::{list_contains_name, InlineAttr, InstructionSetAttr, OptimizeAttr};
33
use rustc_errors::struct_span_err;
44
use rustc_hir as hir;
@@ -60,6 +60,14 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
6060
codegen_fn_attrs.flags |= CodegenFnAttrFlags::TRACK_CALLER;
6161
}
6262

63+
// When `no_builtins` is applied at the crate level, we should add the
64+
// `no-builtins` attribute to each function to ensure it takes effect in LTO.
65+
let crate_attrs = tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
66+
let no_builtins = attr::contains_name(crate_attrs, sym::no_builtins);
67+
if no_builtins {
68+
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_BUILTINS;
69+
}
70+
6371
let supported_target_features = tcx.supported_target_features(LOCAL_CRATE);
6472

6573
let mut inline_span = None;

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Opt
321321
"aarch64" => AARCH64_ALLOWED_FEATURES,
322322
"x86" | "x86_64" => X86_ALLOWED_FEATURES,
323323
"hexagon" => HEXAGON_ALLOWED_FEATURES,
324-
"mips" | "mips64" => MIPS_ALLOWED_FEATURES,
324+
"mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_ALLOWED_FEATURES,
325325
"powerpc" | "powerpc64" => POWERPC_ALLOWED_FEATURES,
326326
"riscv32" | "riscv64" => RISCV_ALLOWED_FEATURES,
327327
"wasm32" | "wasm64" => WASM_ALLOWED_FEATURES,

compiler/rustc_driver_impl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66
[lib]
77

88
[dependencies]
9+
time = { version = "0.3", default-features = false, features = ["formatting", ] }
910
tracing = { version = "0.1.35" }
1011
serde_json = "1.0.59"
1112
rustc_log = { path = "../rustc_log" }

compiler/rustc_driver_impl/messages.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url}
33
driver_impl_ice_exclude_cargo_defaults = some of the compiler flags provided by cargo are hidden
44
55
driver_impl_ice_flags = compiler flags: {$flags}
6+
driver_impl_ice_path = please attach the file at `{$path}` to your bug report
7+
driver_impl_ice_path_error = the ICE couldn't be written to `{$path}`: {$error}
8+
driver_impl_ice_path_error_env = the environment variable `RUSTC_ICE` is set to `{$env_var}`
69
driver_impl_ice_version = rustc {$version} running on {$triple}
10+
711
driver_impl_rlink_empty_version_number = The input does not contain version number
812
913
driver_impl_rlink_encoding_version_mismatch = .rlink file was produced with encoding version `{$version_array}`, but the current version is `{$rlink_version}`

0 commit comments

Comments
 (0)