Skip to content

Commit f02672c

Browse files
committed
Auto merge of #153116 - jhpratt:rollup-yjBVB1Y, r=jhpratt
Rollup of 13 pull requests Successful merges: - #148146 (CI: use alternative disks if available) - #151771 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup) - #153035 (rustc_target: callconv: powerpc64: Use llvm_abiname rather than target_abi for ABI determination) - #153075 (mGCA: Lower negated literals directly and reject non-integer negations) - #153078 (Remove `QuerySystemFns`) - #153089 (interpret: avoid dummy spans in the stacktrace) - #153111 (Refactor url_parts to return is_absolute instead of out param) - #149978 (deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls) - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.) - #153063 (`is_ty_must_use`: do not require a `span` argument) - #153071 (Update books) - #153092 (Remove redundant self usages) - #153094 (Simplify `AppendOnlyVec` iterators) Failed merges: - #153091 (Migration of `LintDiagnostic` - part 4)
2 parents 1ed4882 + efae53b commit f02672c

File tree

100 files changed

+669
-358
lines changed

Some content is hidden

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

100 files changed

+669
-358
lines changed

compiler/rustc_ast/src/visit.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,11 @@ macro_rules! common_visitor_and_walkers {
757757
) -> V::Result;
758758
}
759759

760-
// this is only used by the MutVisitor. We include this symmetry here to make writing other functions easier
760+
// This is only used by the MutVisitor. We include this symmetry here to make writing other
761+
// functions easier.
761762
$(${ignore($lt)}
762-
#[expect(unused, rustc::pass_by_value)]
763+
#[cfg_attr(not(bootstrap), expect(unused, rustc::disallowed_pass_by_ref))]
764+
#[cfg_attr(bootstrap, expect(unused, rustc::pass_by_value))]
763765
#[inline]
764766
)?
765767
fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result {

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,16 +2521,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25212521
ExprKind::Block(block, _) => {
25222522
if let [stmt] = block.stmts.as_slice()
25232523
&& let StmtKind::Expr(expr) = &stmt.kind
2524-
&& matches!(
2525-
expr.kind,
2526-
ExprKind::Block(..)
2527-
| ExprKind::Path(..)
2528-
| ExprKind::Struct(..)
2529-
| ExprKind::Call(..)
2530-
| ExprKind::Tup(..)
2531-
| ExprKind::Array(..)
2532-
| ExprKind::ConstBlock(..)
2533-
)
25342524
{
25352525
return self.lower_expr_to_const_arg_direct(expr);
25362526
}
@@ -2553,6 +2543,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25532543
let span = expr.span;
25542544
let literal = self.lower_lit(literal, span);
25552545

2546+
if !matches!(literal.node, LitKind::Int(..)) {
2547+
let err =
2548+
self.dcx().struct_span_err(expr.span, "negated literal must be an integer");
2549+
2550+
return ConstArg {
2551+
hir_id: self.next_id(),
2552+
kind: hir::ConstArgKind::Error(err.emit()),
2553+
span,
2554+
};
2555+
}
2556+
25562557
ConstArg {
25572558
hir_id: self.lower_node_id(expr.id),
25582559
kind: hir::ConstArgKind::Literal { lit: literal.node, negated: true },

compiler/rustc_attr_parsing/src/attributes/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir::{
99

1010
use super::prelude::*;
1111
use super::util::parse_version;
12-
use crate::session_diagnostics::{self};
12+
use crate::session_diagnostics;
1313

1414
macro_rules! reject_outside_std {
1515
($cx: ident) => {

compiler/rustc_attr_parsing/src/session_diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::num::IntErrorKind;
22

3-
use rustc_ast::{self as ast};
3+
use rustc_ast as ast;
44
use rustc_errors::codes::*;
55
use rustc_errors::{
66
Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level,

compiler/rustc_builtin_macros/src/cmdline_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
22
3-
use rustc_ast::{self as ast};
3+
use rustc_ast as ast;
44
use rustc_errors::Diag;
55
use rustc_parse::parser::attr::InnerAttrPolicy;
66
use rustc_parse::{parse_in, source_str_to_stream};

compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ pub(crate) fn expand_deriving_eq(
2626
additional_bounds: Vec::new(),
2727
supports_unions: true,
2828
methods: vec![MethodDef {
29-
name: sym::assert_receiver_is_total_eq,
29+
name: sym::assert_fields_are_eq,
3030
generics: Bounds::empty(),
3131
explicit_self: true,
3232
nonself_args: vec![],
3333
ret_ty: Unit,
3434
attributes: thin_vec![
35-
cx.attr_word(sym::inline, span),
3635
cx.attr_nested_word(sym::doc, sym::hidden, span),
37-
cx.attr_nested_word(sym::coverage, sym::off, span)
36+
cx.attr_nested_word(sym::coverage, sym::off, span),
3837
],
3938
fieldless_variants_strategy: FieldlessVariantsStrategy::Unify,
4039
combine_substructure: combine_substructure(Box::new(|a, b, c| {

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,10 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
16551655
unimplemented!();
16561656
}
16571657

1658+
fn get_funclet_cleanuppad(&self, _funclet: &Funclet) -> RValue<'gcc> {
1659+
unimplemented!();
1660+
}
1661+
16581662
// Atomic Operations
16591663
fn atomic_cmpxchg(
16601664
&mut self,

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,10 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
12961296
ret
12971297
}
12981298

1299+
fn get_funclet_cleanuppad(&self, funclet: &Funclet<'ll>) -> &'ll Value {
1300+
funclet.cleanuppad()
1301+
}
1302+
12991303
// Atomic Operations
13001304
fn atomic_cmpxchg(
13011305
&mut self,

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
2121
size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags,
2222
};
2323
use crate::debuginfo::utils::DIB;
24+
use crate::llvm;
2425
use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};
25-
use crate::llvm::{self};
2626

2727
// The names of the associated constants in each variant wrapper struct.
2828
// These have to match up with the names being used in `intrinsic.natvis`.

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
2121
file_metadata_from_def_id, type_di_node, unknown_file_metadata,
2222
};
2323
use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item};
24+
use crate::llvm;
2425
use crate::llvm::debuginfo::{DIFlags, DIType};
25-
use crate::llvm::{self};
2626

2727
mod cpp_like;
2828
mod native;

0 commit comments

Comments
 (0)