Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fefc6d2
Show backtrace on allocation failures when possible
bjorn3 Oct 15, 2025
1f23b48
rustdoc: Properly highlight shebang and frontmatter
fmease Oct 29, 2025
a5f0713
rustdoc: Recognize more weak keywords when highlighting Rust code
fmease Oct 28, 2025
0582085
rustdoc: Refactor keyword highlighting and make metavars take precedence
fmease Oct 28, 2025
f3fe6ba
Fix rust-by-example spanish translation
ehuss Nov 6, 2025
91ed7a6
Move and update safety comment
bjorn3 Nov 6, 2025
1a9cc78
re-use `self.get_all_attrs` result for pass indirectly attribute
folkertdev Nov 6, 2025
12cde30
Add note for identifier with attempted hygiene violation
chenyukang Nov 7, 2025
c92ef47
Fix suggestion for returning async closures
chenyukang Nov 6, 2025
5ed01e9
Switch hexagon targets to rust-lld
androm3da Nov 7, 2025
b827732
Enable std locking functions on AIX
amy-kwan Nov 7, 2025
fc20a28
Modify contributor email entries in .mailmap
hkBst Oct 28, 2025
a7aedeb
implement SIMD funnel shifts in const-eval
sayantn Oct 9, 2025
f2794ce
Switch clean `print` methods into a function
GuillaumeGomez Nov 6, 2025
0f03429
Replace `Display::fmt` with `write_char`
GuillaumeGomez Nov 7, 2025
fdced17
[bootstrap] Make `--open` option work with `doc src/tools/error_index…
GuillaumeGomez Nov 7, 2025
c07f11a
don't completely reset `HeadUsages`
lcnr Nov 7, 2025
057127c
update isolate_highest_one for NonZero<T>
vrtgs Oct 14, 2025
eac0c5a
Remove eslint-js from npm dependencies
Kobzol Nov 7, 2025
67802e0
rustc_builtin_macros: rename bench parameter to avoid collisions with…
IntegralPilot Oct 30, 2025
7c37f3a
Rollup merge of #147534 - sayantn:simd-funnel-shifts, r=RalfJung
jhpratt Nov 8, 2025
7a01345
Rollup merge of #147686 - vrtgs:non-zero-isolate, r=joboet
jhpratt Nov 8, 2025
df60c4a
Rollup merge of #148020 - bjorn3:oom_backtrace, r=Mark-Simulacrum
jhpratt Nov 8, 2025
0c29587
Rollup merge of #148204 - hkBst:patch-5, r=nnethercote
jhpratt Nov 8, 2025
ae2001d
Rollup merge of #148230 - fmease:rustdoc-highlight-tweaks, r=Guillaum…
jhpratt Nov 8, 2025
0a4c6fe
Rollup merge of #148279 - IntegralPilot:master, r=hkBst
jhpratt Nov 8, 2025
7547886
Rollup merge of #148555 - ehuss:rust-by-example-es, r=Kobzol
jhpratt Nov 8, 2025
632e974
Rollup merge of #148556 - chenyukang:yukang-fix-148493-async-closure,…
jhpratt Nov 8, 2025
1d5c551
Rollup merge of #148585 - GuillaumeGomez:improve-format-code, r=yotam…
jhpratt Nov 8, 2025
95e4e04
Rollup merge of #148600 - folkertdev:pass-indirectly-reuse-attrs, r=J…
jhpratt Nov 8, 2025
59d1363
Rollup merge of #148612 - chenyukang:yukang-fix-148580-macro-hygiene-…
jhpratt Nov 8, 2025
de56dad
Rollup merge of #148613 - androm3da:bcain/hex_lld, r=JonathanBrouwer,…
jhpratt Nov 8, 2025
2a08e0b
Rollup merge of #148619 - amy-kwan:amyk/AddLockingFunctions_AIX, r=wo…
jhpratt Nov 8, 2025
bca91c6
Rollup merge of #148644 - GuillaumeGomez:error-index-index-open, r=Ko…
jhpratt Nov 8, 2025
9326ff3
Rollup merge of #148649 - lcnr:rarwwww, r=BoxyUwU
jhpratt Nov 8, 2025
896d190
Rollup merge of #148675 - Kobzol:eslint-js, r=yotamofek
jhpratt Nov 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Aaron Todd <github@opprobrio.us>
Abhishek Chanda <abhishek.becs@gmail.com> Abhishek Chanda <abhishek@cloudscaling.com>
Abhijeet Bhagat <abhijeet.bhagat@gmx.com>
Abroskin Alexander <arkweid@evilmartians.com>
Adolfo Ochagavía <aochagavia92@gmail.com>
Adolfo Ochagavía <aochagavia92@gmail.com> <github@adolfo.ochagavia.xyz>
Adrian Heine né Lang <mail@adrianheine.de>
Adrien Tétar <adri-from-59@hotmail.fr>
Ahmed Charles <ahmedcharles@gmail.com> <acharles@outlook.com>
Expand All @@ -36,6 +36,7 @@ Amanda Stjerna <mail@amandastjerna.se> <albin.stjerna@gmail.com>
Amanda Stjerna <mail@amandastjerna.se> <amanda.stjerna@it.uu.se>
Amanieu d'Antras <amanieu@gmail.com> <amanieu.dantras@huawei.com>
Amos Onn <amosonn@gmail.com>
Amos Wenger <amoswenger@gmail.com> <fasterthanlime@users.noreply.github.com>
Ana-Maria Mihalache <mihalacheana.maria@yahoo.com>
Anatoly Ikorsky <aikorsky@gmail.com>
Andre Bogus <bogusandre@gmail.com>
Expand Down Expand Up @@ -276,7 +277,8 @@ Irina Popa <irinagpopa@gmail.com>
Ivan Ivaschenko <defuz.net@gmail.com>
ivan tkachenko <me@ratijas.tk>
J. J. Weber <jjweber@gmail.com>
Jack Huey <jack.huey@umassmed.edu> <jackh726@gmail.com>
Jack Huey <jackh726@gmail.com> <jack.huey@umassmed.edu>
Jack Huey <jackh726@gmail.com> <31162821+jackh726@users.noreply.github.com>
Jacob <jacob.macritchie@gmail.com>
Jacob Hoffman-Andrews <rust@hoffman-andrews.com> <github@hoffman-andrews.com>
Jacob Greenfield <xales@naveria.com>
Expand All @@ -292,6 +294,8 @@ Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <ja.wieczorek@student.uw.edu.pl>
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <software@jacobadam.net>
Jakub Beránek <berykubik@gmail.com> <jakub.beranek@vsb.cz>
James [Undefined] <tpzker@thepuzzlemaker.info>
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
Expand All @@ -303,6 +307,7 @@ Jamie Hill-Daniel <jamie@hill-daniel.co.uk> <clubby789@gmail.com>
Jana Dönszelmann <jana@donsz.nl>
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
Jane Lusby <jlusby42@gmail.com> <jlusby@yaah.dev>
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
Jaro Fietz <jaro.fietz@gmx.de>
Jason Fager <jfager@gmail.com>
Expand All @@ -313,6 +318,7 @@ Jason Toffaletti <toffaletti@gmail.com> Jason Toffaletti <jason@topsy.com>
Jauhien Piatlicki <jauhien@gentoo.org> Jauhien Piatlicki <jpiatlicki@zertisa.com>
Jay True <glacjay@gmail.com>
Jeremy Letang <letang.jeremy@gmail.com>
Jeremy Soller <jackpot51@gmail.com> <jeremy@system76.com>
Jeremy Sorensen <jeremy.a.sorensen@gmail.com>
Jeremy Stucki <dev@jeremystucki.ch> <stucki.jeremy@gmail.com>
Jeremy Stucki <dev@jeremystucki.ch> <jeremy@myelin.ch>
Expand All @@ -336,6 +342,7 @@ John Kåre Alsaker <john.kare.alsaker@gmail.com>
John Kåre Alsaker <john.kare.alsaker@gmail.com> <zoxc32@gmail.com>
John Talling <inrustwetrust@users.noreply.github.com>
John Van Enk <vanenkj@gmail.com>
Jon Gjengset <jon@thesquareplanet.com> <jongje@amazon.com>
Jonas Tepe <jonasprogrammer@gmail.com>
Jonathan Bailey <jbailey@mozilla.com> <jbailey@jbailey-20809.local>
Jonathan Chan Kwan Yin <sofe2038@gmail.com>
Expand Down Expand Up @@ -424,7 +431,7 @@ Malo Jaffré <jaffre.malo@gmail.com>
Manish Goregaokar <manishsmail@gmail.com>
Mara Bos <m-ou.se@m-ou.se>
Marcell Pardavi <marcell.pardavi@gmail.com>
Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
Marco Ieni <marcoieni@rustfoundation.org> <11428655+MarcoIeni@users.noreply.github.com>
Marcus Klaas de Vries <mail@marcusklaas.nl>
Margaret Meyerhofer <mmeyerho@andrew.cmu.edu> <mmeyerho@andrew>
Marijn Schouten <mhkbst@gmail.com> <hkBst@users.noreply.github.com>
Expand Down Expand Up @@ -531,6 +538,7 @@ Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com> <rustc-contact@oli-obk.de>
Oliver Scherer <oli-obk@users.noreply.github.com>
Onur Özkan <onurozkan.dev@outlook.com> <contact@onurozkan.dev>
Onur Özkan <onurozkan.dev@outlook.com> <work@onurozkan.dev>
Onur Özkan <onurozkan.dev@outlook.com>
Ömer Sinan Ağacan <omeragacan@gmail.com>
Expand Down Expand Up @@ -591,6 +599,7 @@ Rusty Blitzerr <rusty.blitzerr@gmail.com>
RustyYato <krishna.sd.2012@gmail.com>
Ruud van Asseldonk <dev@veniogames.com> Ruud van Asseldonk <ruuda@google.com>
Ryan Leung <rleungx@gmail.com>
Ryan Levick <me@ryanlevick.com> <rylev@users.noreply.github.com>
Ryan Scheel <ryan.havvy@gmail.com>
Ryan Sullivant <rsulli55@gmail.com>
Ryan Wiedemann <Ryan1729@gmail.com>
Expand Down Expand Up @@ -686,6 +695,8 @@ Weihang Lo <me@weihanglo.tw>
Weihang Lo <me@weihanglo.tw> <weihanglo@users.noreply.github.com>
Wesley Wiser <wwiser@gmail.com> <wesleywiser@microsoft.com>
whitequark <whitequark@whitequark.org>
Will Crichton <crichton.will@gmail.com> <wcrichto@stanford.edu>
Will Crichton <crichton.will@gmail.com> <wcrichto@cs.stanford.edu>
William Ting <io@williamting.com> <william.h.ting@gmail.com>
Wim Looman <wim@nemo157.com> <rust-lang@nemo157.com>
Wim Looman <wim@nemo157.com> <git@nemo157.com>
Expand All @@ -695,6 +706,8 @@ Xinye Tao <xy.tao@outlook.com>
Xuefeng Wu <benewu@gmail.com> Xuefeng Wu <xfwu@thoughtworks.com>
Xuefeng Wu <benewu@gmail.com> XuefengWu <benewu@gmail.com>
York Xiang <bombless@126.com>
Yoshua Wuyts <yoshuawuyts@gmail.com> <yoshuawuyts+github@gmail.com>
Yoshua Wuyts <yoshuawuyts@gmail.com> <2467194+yoshuawuyts@users.noreply.github.com>
Yotam Ofek <yotam.ofek@gmail.com> <yotamofek@microsoft.com>
Youngsoo Son <ysson83@gmail.com> <ysoo.son@samsung.com>
Youngsuk Kim <joseph942010@gmail.com>
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,30 @@ pub(crate) fn expand_test_or_bench(
};

let test_fn = if is_bench {
// A simple ident for a lambda
let b = Ident::from_str_and_span("b", attr_sp);

// avoid name collisions by using the function name within the identifier, see bug #148275
let bencher_param =
Ident::from_str_and_span(&format!("__bench_{}", fn_.ident.name), attr_sp);
cx.expr_call(
sp,
cx.expr_path(test_path("StaticBenchFn")),
thin_vec![
// #[coverage(off)]
// |b| self::test::assert_test_result(
// |__bench_fn_name| self::test::assert_test_result(
coverage_off(cx.lambda1(
sp,
cx.expr_call(
sp,
cx.expr_path(test_path("assert_test_result")),
thin_vec![
// super::$test_fn(b)
// super::$test_fn(__bench_fn_name)
cx.expr_call(
ret_ty_sp,
cx.expr_path(cx.path(sp, vec![fn_.ident])),
thin_vec![cx.expr_ident(sp, b)],
thin_vec![cx.expr_ident(sp, bencher_param)],
),
],
),
b,
bencher_param,
)), // )
],
)
Expand Down
54 changes: 53 additions & 1 deletion compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc_abi::{BackendRepr, Endian};
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
use rustc_apfloat::{Float, Round};
use rustc_middle::mir::interpret::{InterpErrorKind, Pointer, UndefinedBehaviorInfo};
use rustc_middle::ty::{FloatTy, SimdAlign};
use rustc_middle::ty::{FloatTy, ScalarInt, SimdAlign};
use rustc_middle::{bug, err_ub_format, mir, span_bug, throw_unsup_format, ty};
use rustc_span::{Symbol, sym};
use tracing::trace;
Expand Down Expand Up @@ -744,6 +744,58 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
self.write_scalar(val, &dest)?;
}
}
sym::simd_funnel_shl | sym::simd_funnel_shr => {
let (left, _) = self.project_to_simd(&args[0])?;
let (right, _) = self.project_to_simd(&args[1])?;
let (shift, _) = self.project_to_simd(&args[2])?;
let (dest, _) = self.project_to_simd(&dest)?;

let (len, elem_ty) = args[0].layout.ty.simd_size_and_type(*self.tcx);
let (elem_size, _signed) = elem_ty.int_size_and_signed(*self.tcx);
let elem_size_bits = u128::from(elem_size.bits());

let is_left = intrinsic_name == sym::simd_funnel_shl;

for i in 0..len {
let left =
self.read_scalar(&self.project_index(&left, i)?)?.to_bits(elem_size)?;
let right =
self.read_scalar(&self.project_index(&right, i)?)?.to_bits(elem_size)?;
let shift_bits =
self.read_scalar(&self.project_index(&shift, i)?)?.to_bits(elem_size)?;

if shift_bits >= elem_size_bits {
throw_ub_format!(
"overflowing shift by {shift_bits} in `{intrinsic_name}` in lane {i}"
);
}
let inv_shift_bits = u32::try_from(elem_size_bits - shift_bits).unwrap();

// A funnel shift left by S can be implemented as `(x << S) | y.unbounded_shr(SIZE - S)`.
// The `unbounded_shr` is needed because otherwise if `S = 0`, it would be `x | y`
// when it should be `x`.
//
// This selects the least-significant `SIZE - S` bits of `x`, followed by the `S` most
// significant bits of `y`. As `left` and `right` both occupy the lower `SIZE` bits,
// we can treat the lower `SIZE` bits as an integer of the right width and use
// the same implementation, but on a zero-extended `x` and `y`. This works because
// `x << S` just pushes the `SIZE-S` MSBs out, and `y >> (SIZE - S)` shifts in
// zeros, as it is zero-extended. To the lower `SIZE` bits, this looks just like a
// funnel shift left.
//
// Note that the `unbounded_sh{l,r}`s are needed only in case we are using this on
// `u128xN` and `inv_shift_bits == 128`.
let result_bits = if is_left {
(left << shift_bits) | right.unbounded_shr(inv_shift_bits)
} else {
left.unbounded_shl(inv_shift_bits) | (right >> shift_bits)
};
let (result, _overflow) = ScalarInt::truncate_from_uint(result_bits, elem_size);

let dest = self.project_index(&dest, i)?;
self.write_scalar(result, &dest)?;
}
}

// Unsupported intrinsic: skip the return_to_block below.
_ => return interp_ok(false),
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_hir_analysis/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,21 @@ pub fn suggest_impl_trait<'tcx>(
infcx.tcx.lang_items().future_output(),
format_as_assoc,
),
(
infcx.tcx.lang_items().async_fn_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().async_fn_mut_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().async_fn_once_trait(),
infcx.tcx.lang_items().async_fn_once_output(),
format_as_parenthesized,
),
(
infcx.tcx.lang_items().fn_trait(),
infcx.tcx.lang_items().fn_once_output(),
Expand Down
10 changes: 3 additions & 7 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1512,9 +1512,8 @@ impl<'tcx> TyCtxt<'tcx> {
field_shuffle_seed ^= user_seed;
}

if let Some(reprs) =
find_attr!(self.get_all_attrs(did), AttributeKind::Repr { reprs, .. } => reprs)
{
let attributes = self.get_all_attrs(did);
if let Some(reprs) = find_attr!(attributes, AttributeKind::Repr { reprs, .. } => reprs) {
for (r, _) in reprs {
flags.insert(match *r {
attr::ReprRust => ReprFlags::empty(),
Expand Down Expand Up @@ -1574,10 +1573,7 @@ impl<'tcx> TyCtxt<'tcx> {
}

// See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details.
if find_attr!(
self.get_all_attrs(did),
AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)
) {
if find_attr!(attributes, AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)) {
flags.insert(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS);
}

Expand Down
24 changes: 24 additions & 0 deletions compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,8 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
}
}
}

self.suggest_ident_hidden_by_hygiene(err, path, span);
} else if err_code == E0412 {
if let Some(correct) = Self::likely_rust_type(path) {
err.span_suggestion(
Expand All @@ -1138,6 +1140,28 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
}
}

fn suggest_ident_hidden_by_hygiene(&self, err: &mut Diag<'_>, path: &[Segment], span: Span) {
let [segment] = path else { return };

let ident = segment.ident;
let callsite_span = span.source_callsite();
for rib in self.ribs[ValueNS].iter().rev() {
for (binding_ident, _) in &rib.bindings {
if binding_ident.name == ident.name
&& !binding_ident.span.eq_ctxt(span)
&& !binding_ident.span.from_expansion()
&& binding_ident.span.lo() < callsite_span.lo()
{
err.span_help(
binding_ident.span,
"an identifier with the same name exists, but is not accessible due to macro hygiene",
);
return;
}
}
}
}

/// Emit special messages for unresolved `Self` and `self`.
fn suggest_self_ty(
&self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub(crate) fn target() -> Target {
base.features = "-small-data,+hvx-length128b".into();

base.has_rpath = true;
base.linker = Some("rust-lld".into());
base.linker_flavor = LinkerFlavor::Unix(Cc::Yes);

base.c_enum_min_bits = Some(8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
max_atomic_width: Some(32),
emit_debug_gdb_scripts: false,
c_enum_min_bits: Some(8),
linker: Some("rust-lld".into()),
..Default::default()
},
}
Expand Down
17 changes: 14 additions & 3 deletions compiler/rustc_type_ir/src/search_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use derive_where::derive_where;
#[cfg(feature = "nightly")]
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext};
use rustc_type_ir::data_structures::HashMap;
use tracing::{debug, instrument};
use tracing::{debug, instrument, trace};

mod stack;
use stack::{Stack, StackDepth, StackEntry};
Expand Down Expand Up @@ -916,6 +916,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D> {
/// heads from the stack. This may not necessarily mean that we've actually
/// reached a fixpoint for that cycle head, which impacts the way we rebase
/// provisional cache entries.
#[derive_where(Debug; X: Cx)]
enum RebaseReason<X: Cx> {
NoCycleUsages,
Ambiguity(X::AmbiguityInfo),
Expand Down Expand Up @@ -950,6 +951,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
/// cache entries to also be ambiguous. This causes some undesirable ambiguity for nested
/// goals whose result doesn't actually depend on this cycle head, but that's acceptable
/// to me.
#[instrument(level = "trace", skip(self, cx))]
fn rebase_provisional_cache_entries(
&mut self,
cx: X,
Expand All @@ -969,6 +971,7 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
let popped_head = if heads.highest_cycle_head_index() == popped_head_index {
heads.remove_highest_cycle_head()
} else {
debug_assert!(heads.highest_cycle_head_index() < popped_head_index);
return true;
};

Expand Down Expand Up @@ -1057,6 +1060,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
new_highest_head_index,
));

trace!(?input, ?entry, "rebased provisional cache entry");

true
});
!entries.is_empty()
Expand Down Expand Up @@ -1379,7 +1384,8 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
}

// Clear all provisional cache entries which depend on a previous provisional
// result of this goal and rerun.
// result of this goal and rerun. This does not remove goals which accessed this
// goal without depending on its result.
self.clear_dependent_provisional_results_for_rerun();

debug!(?result, "fixpoint changed provisional results");
Expand All @@ -1399,7 +1405,12 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
// similar to the previous iterations when reevaluating, it's better
// for caching if the reevaluation also starts out with `false`.
encountered_overflow: false,
usages: None,
// We keep provisional cache entries around if they used this goal
// without depending on its result.
//
// We still need to drop or rebase these cache entries once we've
// finished evaluating this goal.
usages: Some(HeadUsages::default()),
candidate_usages: None,
});
}
Expand Down
9 changes: 6 additions & 3 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,15 @@ macro_rules! nonzero_integer {
without modifying the original"]
#[inline(always)]
pub const fn isolate_highest_one(self) -> Self {
let n = self.get() & (((1 as $Int) << (<$Int>::BITS - 1)).wrapping_shr(self.leading_zeros()));

// SAFETY:
// `self` is non-zero, so masking to preserve only the most
// significant set bit will result in a non-zero `n`.
unsafe { NonZero::new_unchecked(n) }
// and self.leading_zeros() is always < $INT::BITS since
// at least one of the bits in the number is not zero
unsafe {
let bit = (((1 as $Uint) << (<$Uint>::BITS - 1)).unchecked_shr(self.leading_zeros()));
NonZero::new_unchecked(bit as $Int)
}
}

/// Returns `self` with only the least significant bit set.
Expand Down
Loading
Loading