Skip to content

Commit e77e254

Browse files
committed
Auto merge of #147087 - GuillaumeGomez:rollup-9wg2ej3, r=GuillaumeGomez
Rollup of 9 pull requests Successful merges: - #140482 (std::net: update tcp deferaccept delay type to Duration.) - #146037 (Introduce CoerceShared lang item and trait, and basic Reborrow tests) - #146732 (tests: relax expectations after llvm change 902ddda120a5) - #147018 (re-order normalizations in run-make linker-warning test) - #147032 (Fix doctest compilation time display) - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`) - #147050 (PassWrapper: update for new PGOOptions args in LLVM 22) - #147075 (Make `def_path_hash_to_def_id` not panic when passed an invalid hash) - #147076 (update issue number for more_float_constants) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c0ee51f + bd7e79f commit e77e254

Some content is hidden

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

58 files changed

+602
-131
lines changed

bootstrap.example.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,16 +768,15 @@
768768
# make this default to false.
769769
#rust.lld = false in all cases, except on `x86_64-unknown-linux-gnu` as described above, where it is true
770770

771-
# Indicates whether LLD will be used to link Rust crates during bootstrap on
772-
# supported platforms.
771+
# Indicates if we should override the linker used to link Rust crates during bootstrap to be LLD.
773772
# If set to `true` or `"external"`, a global `lld` binary that has to be in $PATH
774773
# will be used.
775774
# If set to `"self-contained"`, rust-lld from the snapshot compiler will be used.
776775
#
777776
# On MSVC, LLD will not be used if we're cross linking.
778777
#
779778
# Explicitly setting the linker for a target will override this option when targeting MSVC.
780-
#rust.use-lld = false
779+
#rust.bootstrap-override-lld = false
781780

782781
# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
783782
# sysroot.
@@ -950,7 +949,7 @@
950949
# Linker to be used to bootstrap Rust code. Note that the
951950
# default value is platform specific, and if not specified it may also depend on
952951
# what platform is crossing to what platform.
953-
# Setting this will override the `use-lld` option for Rust code when targeting MSVC.
952+
# Setting this will override the `bootstrap-override-lld` option for Rust code when targeting MSVC.
954953
#linker = "cc" (path)
955954

956955
# Should rustc and the standard library be built with split debuginfo? Default

compiler/rustc_hir/src/lang_items.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ language_item_table! {
440440

441441
// Reborrowing related lang-items
442442
Reborrow, sym::reborrow, reborrow, Target::Trait, GenericRequirement::Exact(0);
443+
CoerceShared, sym::coerce_shared, coerce_shared, Target::Trait, GenericRequirement::Exact(0);
443444
}
444445

445446
/// The requirement imposed on the generics of a lang item

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,25 +569,43 @@ extern "C" LLVMRustResult LLVMRustOptimize(
569569
}
570570

571571
std::optional<PGOOptions> PGOOpt;
572+
#if LLVM_VERSION_LT(22, 0)
572573
auto FS = vfs::getRealFileSystem();
574+
#endif
573575
if (PGOGenPath) {
574576
assert(!PGOUsePath && !PGOSampleUsePath);
575577
PGOOpt = PGOOptions(
578+
#if LLVM_VERSION_GE(22, 0)
579+
PGOGenPath, "", "", "", PGOOptions::IRInstr, PGOOptions::NoCSAction,
580+
#else
576581
PGOGenPath, "", "", "", FS, PGOOptions::IRInstr, PGOOptions::NoCSAction,
582+
#endif
577583
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
578584
} else if (PGOUsePath) {
579585
assert(!PGOSampleUsePath);
580586
PGOOpt = PGOOptions(
587+
#if LLVM_VERSION_GE(22, 0)
588+
PGOUsePath, "", "", "", PGOOptions::IRUse, PGOOptions::NoCSAction,
589+
#else
581590
PGOUsePath, "", "", "", FS, PGOOptions::IRUse, PGOOptions::NoCSAction,
591+
#endif
582592
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
583593
} else if (PGOSampleUsePath) {
584594
PGOOpt =
595+
#if LLVM_VERSION_GE(22, 0)
596+
PGOOptions(PGOSampleUsePath, "", "", "", PGOOptions::SampleUse,
597+
#else
585598
PGOOptions(PGOSampleUsePath, "", "", "", FS, PGOOptions::SampleUse,
599+
#endif
586600
PGOOptions::NoCSAction, PGOOptions::ColdFuncOpt::Default,
587601
DebugInfoForProfiling);
588602
} else if (DebugInfoForProfiling) {
589603
PGOOpt = PGOOptions(
604+
#if LLVM_VERSION_GE(22, 0)
605+
"", "", "", "", PGOOptions::NoAction, PGOOptions::NoCSAction,
606+
#else
590607
"", "", "", "", FS, PGOOptions::NoAction, PGOOptions::NoCSAction,
608+
#endif
591609
PGOOptions::ColdFuncOpt::Default, DebugInfoForProfiling);
592610
}
593611

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ impl<'a> CrateMetadataRef<'a> {
15551555
}
15561556

15571557
#[inline]
1558-
fn def_path_hash_to_def_index(self, hash: DefPathHash) -> DefIndex {
1558+
fn def_path_hash_to_def_index(self, hash: DefPathHash) -> Option<DefIndex> {
15591559
self.def_path_hash_map.def_path_hash_to_def_index(&hash)
15601560
}
15611561

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,8 @@ fn provide_cstore_hooks(providers: &mut Providers) {
691691
.get(&stable_crate_id)
692692
.unwrap_or_else(|| bug!("uninterned StableCrateId: {stable_crate_id:?}"));
693693
assert_ne!(cnum, LOCAL_CRATE);
694-
let def_index = cstore.get_crate_data(cnum).def_path_hash_to_def_index(hash);
695-
DefId { krate: cnum, index: def_index }
694+
let def_index = cstore.get_crate_data(cnum).def_path_hash_to_def_index(hash)?;
695+
Some(DefId { krate: cnum, index: def_index })
696696
};
697697

698698
providers.hooks.expn_hash_to_expn_id = |tcx, cnum, index_guess, hash| {

compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ pub(crate) enum DefPathHashMapRef<'tcx> {
1212

1313
impl DefPathHashMapRef<'_> {
1414
#[inline]
15-
pub(crate) fn def_path_hash_to_def_index(&self, def_path_hash: &DefPathHash) -> DefIndex {
15+
pub(crate) fn def_path_hash_to_def_index(
16+
&self,
17+
def_path_hash: &DefPathHash,
18+
) -> Option<DefIndex> {
1619
match *self {
17-
DefPathHashMapRef::OwnedFromMetadata(ref map) => {
18-
map.get(&def_path_hash.local_hash()).unwrap()
19-
}
20+
DefPathHashMapRef::OwnedFromMetadata(ref map) => map.get(&def_path_hash.local_hash()),
2021
DefPathHashMapRef::BorrowedFromTcx(_) => {
2122
panic!("DefPathHashMap::BorrowedFromTcx variant only exists for serialization")
2223
}

compiler/rustc_middle/src/hooks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ declare_hooks! {
7777
/// session, if it still exists. This is used during incremental compilation to
7878
/// turn a deserialized `DefPathHash` into its current `DefId`.
7979
/// Will fetch a DefId from a DefPathHash for a foreign crate.
80-
hook def_path_hash_to_def_id_extern(hash: DefPathHash, stable_crate_id: StableCrateId) -> DefId;
80+
hook def_path_hash_to_def_id_extern(hash: DefPathHash, stable_crate_id: StableCrateId) -> Option<DefId>;
8181

8282
/// Returns `true` if we should codegen an instance in the local crate, or returns `false` if we
8383
/// can just link to the upstream crate and therefore don't need a mono item.

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ impl<'tcx> TyCtxt<'tcx> {
20122012
if stable_crate_id == self.stable_crate_id(LOCAL_CRATE) {
20132013
Some(self.untracked.definitions.read().local_def_path_hash_to_def_id(hash)?.to_def_id())
20142014
} else {
2015-
Some(self.def_path_hash_to_def_id_extern(hash, stable_crate_id))
2015+
self.def_path_hash_to_def_id_extern(hash, stable_crate_id)
20162016
}
20172017
}
20182018

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ symbols! {
679679
cmpxchg16b_target_feature,
680680
cmse_nonsecure_entry,
681681
coerce_pointee_validated,
682+
coerce_shared,
682683
coerce_unsized,
683684
cold,
684685
cold_path,

library/core/src/marker.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,11 +1341,3 @@ pub macro CoercePointee($item:item) {
13411341
pub trait CoercePointeeValidated {
13421342
/* compiler built-in */
13431343
}
1344-
1345-
/// Allows value to be reborrowed as exclusive, creating a copy of the value
1346-
/// that disables the source for reads and writes for the lifetime of the copy.
1347-
#[lang = "reborrow"]
1348-
#[unstable(feature = "reborrow", issue = "145612")]
1349-
pub trait Reborrow {
1350-
// Empty.
1351-
}

0 commit comments

Comments
 (0)