Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,16 @@ pub(crate) fn apply_computed_concrete_opaque_types<'tcx>(
let mut errors = Vec::new();
for &(key, hidden_type) in opaque_types {
let Some(expected) = get_concrete_opaque_type(concrete_opaque_types, key.def_id) else {
assert!(tcx.use_typing_mode_borrowck(), "non-defining use in defining scope");
if !tcx.use_typing_mode_borrowck() {
if let ty::Alias(ty::Opaque, alias_ty) = hidden_type.ty.kind()
&& alias_ty.def_id == key.def_id.to_def_id()
&& alias_ty.args == key.args
{
continue;
} else {
unreachable!("non-defining use in defining scope");
}
}
errors.push(DeferredOpaqueTypeError::NonDefiningUseInDefiningScope {
span: hidden_type.span,
opaque_type_key: key,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ fn main() {

// Prevent critical warnings when we're compiling from rust-lang/rust CI,
// except on MSVC, as the compiler throws warnings that are only reported
// for this platform. See https://github.com/rust-lang/rust/pull/145031#issuecomment-3162677202
// FIXME(llvm22): It looks like the specific problem code has been removed
// in https://github.com/llvm/llvm-project/commit/e8fc808bf8e78a3c80d1f8e293a92677b92366dd,
// retry msvc once we bump our LLVM version.
// for this platform. See https://github.com/rust-lang/rust/pull/145031#issuecomment-3162677202.
// Moreover, LLVM generally guarantees warning-freedom only when building with Clang, as other
// compilers have too many false positives. This is typically the case for MSVC, which throws
// many false-positive warnings. We keep it excluded, for these reasons.
if std::env::var_os("CI").is_some() && !target.contains("msvc") {
cfg.warnings_into_errors(true);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2742,7 +2742,7 @@ impl<'a> Parser<'a> {
/// The specified `edition` in `let_chains_policy` should be that of the whole `if` construct,
/// i.e. the same span we use to later decide whether the drop behaviour should be that of
/// edition `..=2021` or that of `2024..`.
// 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.
// Public to use it for custom `if` expressions in rustfmt forks like https://github.com/tucant/rustfmt
pub fn parse_expr_cond(
&mut self,
let_chains_policy: LetChainsPolicy,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_parse/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use std::{fmt, mem, slice};
use attr_wrapper::{AttrWrapper, UsePreAttrPos};
pub use diagnostics::AttemptLocalParseRecovery;
pub(crate) use expr::ForbiddenLetReason;
// Public to use it for custom `if` expressions in rustfmt forks like https://github.com/tucant/rustfmt
pub use expr::LetChainsPolicy;
pub(crate) use item::{FnContext, FnParseMode};
pub use pat::{CommaRecoveryMode, RecoverColon, RecoverComma};
pub use path::PathStyle;
Expand Down
Loading
Loading