Skip to content

Commit 76d18cf

Browse files
committed
Auto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se
Rollup of 14 pull requests Successful merges: - #88394 (Document `std::env::current_exe` possible rename behaviour) - #88406 (Tait nest infer test) - #88408 (Add inference cycle TAIT test) - #88409 (Add auto trait leakage TAIT test) - #88413 (Add weird return types TAIT test) - #88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`) - #88462 (rustdoc: Stop using resolver for macro loading) - #88465 (Adding examples to docs of `std::time` module) - #88486 (Remove unused arena macro args) - #88492 (Use MaybeUninit::write in functor.rs) - #88496 (Fix prelude collision lint suggestion for generics with lifetimes) - #88497 (Fix prelude collision suggestions for glob imported traits. ) - #88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. ) - #88509 (Don't suggest extra <> in dyn suggestion.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents fe37929 + feafda8 commit 76d18cf

Some content is hidden

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

46 files changed

+698
-89
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4405,6 +4405,7 @@ dependencies = [
44054405
"rustc_hir_pretty",
44064406
"rustc_index",
44074407
"rustc_infer",
4408+
"rustc_lint",
44084409
"rustc_macros",
44094410
"rustc_middle",
44104411
"rustc_session",

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ pub macro which_arena_for_type {
635635
}
636636

637637
#[rustc_macro_transparency = "semitransparent"]
638-
pub macro declare_arena([], [$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) {
638+
pub macro declare_arena([$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) {
639639
#[derive(Default)]
640640
pub struct Arena<$tcx> {
641641
pub dropless: $crate::DroplessArena,

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ mod path;
8484

8585
const HIR_ID_COUNTER_LOCKED: u32 = 0xFFFFFFFF;
8686

87-
rustc_hir::arena_types!(rustc_arena::declare_arena, [], 'tcx);
87+
rustc_hir::arena_types!(rustc_arena::declare_arena, 'tcx);
8888

8989
struct LoweringContext<'a, 'hir: 'a> {
9090
/// Used to assign IDs to HIR nodes that do not directly correspond to AST nodes.

compiler/rustc_data_structures/src/functor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<T> IdFunctor for Box<T> {
2626
// inverse of `Box::assume_init()` and should be safe.
2727
let mut raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
2828
// SAFETY: Write the mapped value back into the `Box`.
29-
ptr::write(raw.as_mut_ptr(), f(value));
29+
raw.write(f(value));
3030
// SAFETY: We just initialized `raw`.
3131
raw.assume_init()
3232
}

compiler/rustc_hir/src/arena.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
/// where `T` is the type listed. These impls will appear in the implement_ty_decoder! macro.
1010
#[macro_export]
1111
macro_rules! arena_types {
12-
($macro:path, $args:tt, $tcx:lifetime) => (
13-
$macro!($args, [
12+
($macro:path, $tcx:lifetime) => (
13+
$macro!([
1414
// HIR types
1515
[few] hir_krate: rustc_hir::Crate<$tcx>,
1616
[] arm: rustc_hir::Arm<$tcx>,

compiler/rustc_lint/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ mod traits;
6262
mod types;
6363
mod unused;
6464

65+
pub use array_into_iter::ARRAY_INTO_ITER;
66+
6567
use rustc_ast as ast;
6668
use rustc_hir as hir;
6769
use rustc_hir::def_id::LocalDefId;

compiler/rustc_middle/src/arena.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
/// listed. These impls will appear in the implement_ty_decoder! macro.
1010
#[macro_export]
1111
macro_rules! arena_types {
12-
($macro:path, $args:tt, $tcx:lifetime) => (
13-
$macro!($args, [
12+
($macro:path, $tcx:lifetime) => (
13+
$macro!([
1414
[] layouts: rustc_target::abi::Layout,
1515
// AdtDef are interned and compared by address
1616
[] adt_def: rustc_middle::ty::AdtDef,
@@ -109,4 +109,4 @@ macro_rules! arena_types {
109109
)
110110
}
111111

112-
arena_types!(rustc_arena::declare_arena, [], 'tcx);
112+
arena_types!(rustc_arena::declare_arena, 'tcx);

compiler/rustc_middle/src/ty/codec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,15 @@ macro_rules! impl_arena_allocatable_decoder {
437437
}
438438

439439
macro_rules! impl_arena_allocatable_decoders {
440-
([], [$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) => {
440+
([$($a:tt $name:ident: $ty:ty,)*], $tcx:lifetime) => {
441441
$(
442442
impl_arena_allocatable_decoder!($a [[$name: $ty], $tcx]);
443443
)*
444444
}
445445
}
446446

447-
rustc_hir::arena_types!(impl_arena_allocatable_decoders, [], 'tcx);
448-
arena_types!(impl_arena_allocatable_decoders, [], 'tcx);
447+
rustc_hir::arena_types!(impl_arena_allocatable_decoders, 'tcx);
448+
arena_types!(impl_arena_allocatable_decoders, 'tcx);
449449

450450
#[macro_export]
451451
macro_rules! implement_ty_decoder {

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ macro_rules! maybe_whole_expr {
4141
let path = path.clone();
4242
$p.bump();
4343
return Ok($p.mk_expr(
44-
$p.token.span,
44+
$p.prev_token.span,
4545
ExprKind::Path(None, path),
4646
AttrVec::new(),
4747
));
@@ -50,7 +50,7 @@ macro_rules! maybe_whole_expr {
5050
let block = block.clone();
5151
$p.bump();
5252
return Ok($p.mk_expr(
53-
$p.token.span,
53+
$p.prev_token.span,
5454
ExprKind::Block(block, None),
5555
AttrVec::new(),
5656
));

compiler/rustc_typeck/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ rustc_index = { path = "../rustc_index" }
2626
rustc_infer = { path = "../rustc_infer" }
2727
rustc_trait_selection = { path = "../rustc_trait_selection" }
2828
rustc_ty_utils = { path = "../rustc_ty_utils" }
29+
rustc_lint = { path = "../rustc_lint" }

0 commit comments

Comments
 (0)