Skip to content

Commit 76863e3

Browse files
committed
Auto merge of #146282 - tgross35:rollup-0n5tjnm, r=tgross35
Rollup of 5 pull requests Successful merges: - #139524 (Add socket extensions for cygwin) - #145940 (single buffer for exponent fmt of integers) - #146206 (identity uses are ok, even if there are no defining uses) - #146272 (Update comment for `-Werror` on LLVM builds) - #146280 (Make `LetChainsPolicy` public for rustfmt usage) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1ed3cd7 + f338542 commit 76863e3

File tree

21 files changed

+446
-239
lines changed

21 files changed

+446
-239
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,16 @@ pub(crate) fn apply_computed_concrete_opaque_types<'tcx>(
503503
let mut errors = Vec::new();
504504
for &(key, hidden_type) in opaque_types {
505505
let Some(expected) = get_concrete_opaque_type(concrete_opaque_types, key.def_id) else {
506-
assert!(tcx.use_typing_mode_borrowck(), "non-defining use in defining scope");
506+
if !tcx.use_typing_mode_borrowck() {
507+
if let ty::Alias(ty::Opaque, alias_ty) = hidden_type.ty.kind()
508+
&& alias_ty.def_id == key.def_id.to_def_id()
509+
&& alias_ty.args == key.args
510+
{
511+
continue;
512+
} else {
513+
unreachable!("non-defining use in defining scope");
514+
}
515+
}
507516
errors.push(DeferredOpaqueTypeError::NonDefiningUseInDefiningScope {
508517
span: hidden_type.span,
509518
opaque_type_key: key,

compiler/rustc_llvm/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ fn main() {
174174

175175
// Prevent critical warnings when we're compiling from rust-lang/rust CI,
176176
// except on MSVC, as the compiler throws warnings that are only reported
177-
// for this platform. See https://github.com/rust-lang/rust/pull/145031#issuecomment-3162677202
178-
// FIXME(llvm22): It looks like the specific problem code has been removed
179-
// in https://github.com/llvm/llvm-project/commit/e8fc808bf8e78a3c80d1f8e293a92677b92366dd,
180-
// retry msvc once we bump our LLVM version.
177+
// for this platform. See https://github.com/rust-lang/rust/pull/145031#issuecomment-3162677202.
178+
// Moreover, LLVM generally guarantees warning-freedom only when building with Clang, as other
179+
// compilers have too many false positives. This is typically the case for MSVC, which throws
180+
// many false-positive warnings. We keep it excluded, for these reasons.
181181
if std::env::var_os("CI").is_some() && !target.contains("msvc") {
182182
cfg.warnings_into_errors(true);
183183
}

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,7 @@ impl<'a> Parser<'a> {
27422742
/// The specified `edition` in `let_chains_policy` should be that of the whole `if` construct,
27432743
/// i.e. the same span we use to later decide whether the drop behaviour should be that of
27442744
/// edition `..=2021` or that of `2024..`.
2745-
// Public because it is used in rustfmt forks such as https://github.com/tucant/rustfmt/blob/30c83df9e1db10007bdd16dafce8a86b404329b2/src/parse/macros/html.rs#L57 for custom if expressions.
2745+
// Public to use it for custom `if` expressions in rustfmt forks like https://github.com/tucant/rustfmt
27462746
pub fn parse_expr_cond(
27472747
&mut self,
27482748
let_chains_policy: LetChainsPolicy,

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ use std::{fmt, mem, slice};
2222
use attr_wrapper::{AttrWrapper, UsePreAttrPos};
2323
pub use diagnostics::AttemptLocalParseRecovery;
2424
pub(crate) use expr::ForbiddenLetReason;
25+
// Public to use it for custom `if` expressions in rustfmt forks like https://github.com/tucant/rustfmt
26+
pub use expr::LetChainsPolicy;
2527
pub(crate) use item::{FnContext, FnParseMode};
2628
pub use pat::{CommaRecoveryMode, RecoverColon, RecoverComma};
2729
pub use path::PathStyle;

0 commit comments

Comments
 (0)