Skip to content

Commit 87293c9

Browse files
committed
Auto merge of #124910 - matthiaskrgr:rollup-lo1uvdn, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #123344 (Remove braces when fixing a nested use tree into a single item) - #124587 (Generic `NonZero` post-stabilization changes.) - #124775 (crashes: add lastest batch of crash tests) - #124869 (Make sure we don't deny macro vars w keyword names) - #124876 (Simplify `use crate::rustc_foo::bar` occurrences.) - #124892 (Update cc crate to v1.0.97) - #124903 (Ignore empty RUSTC_WRAPPER in bootstrap) - #124909 (Reapply the part of #124548 that bors forgot) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ec1b698 + 782ef18 commit 87293c9

File tree

86 files changed

+850
-579
lines changed

Some content is hidden

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

86 files changed

+850
-579
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ version = "0.1.0"
479479

480480
[[package]]
481481
name = "cc"
482-
version = "1.0.92"
482+
version = "1.0.97"
483483
source = "registry+https://github.com/rust-lang/crates.io-index"
484-
checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
484+
checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4"
485485

486486
[[package]]
487487
name = "cfg-if"
@@ -2219,7 +2219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
22192219
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
22202220
dependencies = [
22212221
"cfg-if",
2222-
"windows-targets 0.48.5",
2222+
"windows-targets 0.52.4",
22232223
]
22242224

22252225
[[package]]

compiler/rustc_abi/src/layout.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::borrow::{Borrow, Cow};
22
use std::cmp;
33
use std::fmt::{self, Write};
44
use std::iter;
5+
use std::num::NonZero;
56
use std::ops::Bound;
67
use std::ops::Deref;
78

@@ -10,8 +11,8 @@ use tracing::debug;
1011

1112
use crate::{
1213
Abi, AbiAndPrefAlign, Align, FieldsShape, IndexSlice, IndexVec, Integer, LayoutS, Niche,
13-
NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding, TargetDataLayout,
14-
Variants, WrappingRange,
14+
Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding, TargetDataLayout, Variants,
15+
WrappingRange,
1516
};
1617

1718
// A variant is absent if it's uninhabited and only has ZST fields.
@@ -327,7 +328,7 @@ pub trait LayoutCalculator {
327328

328329
Some(LayoutS {
329330
variants: Variants::Single { index: VariantIdx::new(0) },
330-
fields: FieldsShape::Union(NonZeroUsize::new(only_variant.len())?),
331+
fields: FieldsShape::Union(NonZero::new(only_variant.len())?),
331332
abi,
332333
largest_niche: None,
333334
align,

compiler/rustc_abi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
55

66
use std::fmt;
7-
use std::num::{NonZeroUsize, ParseIntError};
7+
use std::num::{NonZero, ParseIntError};
88
use std::ops::{Add, AddAssign, Mul, RangeInclusive, Sub};
99
use std::str::FromStr;
1010

@@ -1149,7 +1149,7 @@ pub enum FieldsShape<FieldIdx: Idx> {
11491149
Primitive,
11501150

11511151
/// All fields start at no offset. The `usize` is the field count.
1152-
Union(NonZeroUsize),
1152+
Union(NonZero<usize>),
11531153

11541154
/// Array/vector-like placement, with all fields of identical types.
11551155
Array { stride: Size, count: u64 },

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ pub enum TyKind {
21642164
MacCall(P<MacCall>),
21652165
/// Placeholder for a `va_list`.
21662166
CVarArgs,
2167-
/// Pattern types like `pattern_type!(u32 is 1..=)`, which is the same as `NonZeroU32`,
2167+
/// Pattern types like `pattern_type!(u32 is 1..=)`, which is the same as `NonZero<u32>`,
21682168
/// just as part of the type system.
21692169
Pat(P<Ty>, P<Pat>),
21702170
/// Sometimes we need a dummy value when no error has occurred.
@@ -2729,7 +2729,7 @@ pub enum UseTreeKind {
27292729
/// `use prefix` or `use prefix as rename`
27302730
Simple(Option<Ident>),
27312731
/// `use prefix::{...}`
2732-
Nested(ThinVec<(UseTree, NodeId)>),
2732+
Nested { items: ThinVec<(UseTree, NodeId)>, span: Span },
27332733
/// `use prefix::*`
27342734
Glob,
27352735
}

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ fn noop_visit_use_tree<T: MutVisitor>(use_tree: &mut UseTree, vis: &mut T) {
441441
vis.visit_path(prefix);
442442
match kind {
443443
UseTreeKind::Simple(rename) => visit_opt(rename, |rename| vis.visit_ident(rename)),
444-
UseTreeKind::Nested(items) => {
444+
UseTreeKind::Nested { items, .. } => {
445445
for (tree, id) in items {
446446
vis.visit_use_tree(tree);
447447
vis.visit_id(id);

compiler/rustc_ast/src/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ pub fn walk_use_tree<'a, V: Visitor<'a>>(
517517
visit_opt!(visitor, visit_ident, rename);
518518
}
519519
UseTreeKind::Glob => {}
520-
UseTreeKind::Nested(ref use_trees) => {
521-
for &(ref nested_tree, nested_id) in use_trees {
520+
UseTreeKind::Nested { ref items, .. } => {
521+
for &(ref nested_tree, nested_id) in items {
522522
try_visit!(visitor.visit_use_tree(nested_tree, nested_id, true));
523523
}
524524
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
135135

136136
fn lower_item_id_use_tree(&mut self, tree: &UseTree, vec: &mut SmallVec<[hir::ItemId; 1]>) {
137137
match &tree.kind {
138-
UseTreeKind::Nested(nested_vec) => {
139-
for &(ref nested, id) in nested_vec {
138+
UseTreeKind::Nested { items, .. } => {
139+
for &(ref nested, id) in items {
140140
vec.push(hir::ItemId {
141141
owner_id: hir::OwnerId { def_id: self.local_def_id(id) },
142142
});
@@ -518,7 +518,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
518518
let path = self.lower_use_path(res, &path, ParamMode::Explicit);
519519
hir::ItemKind::Use(path, hir::UseKind::Glob)
520520
}
521-
UseTreeKind::Nested(ref trees) => {
521+
UseTreeKind::Nested { items: ref trees, .. } => {
522522
// Nested imports are desugared into simple imports.
523523
// So, if we start with
524524
//

compiler/rustc_ast_pretty/src/pprust/state/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ impl<'a> State<'a> {
715715
}
716716
self.word("*");
717717
}
718-
ast::UseTreeKind::Nested(items) => {
718+
ast::UseTreeKind::Nested { items, .. } => {
719719
if !tree.prefix.segments.is_empty() {
720720
self.print_path(&tree.prefix, false, 0);
721721
self.word("::");
@@ -734,7 +734,7 @@ impl<'a> State<'a> {
734734
self.print_use_tree(&use_tree.0);
735735
if !is_last {
736736
self.word(",");
737-
if let ast::UseTreeKind::Nested(_) = use_tree.0.kind {
737+
if let ast::UseTreeKind::Nested { .. } = use_tree.0.kind {
738738
self.hardbreak();
739739
} else {
740740
self.space();

compiler/rustc_builtin_macros/src/assert/context.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ impl<'cx, 'a> Context<'cx, 'a> {
120120
thin_vec![self.cx.attr_nested_word(sym::allow, sym::unused_imports, self.span)],
121121
ItemKind::Use(UseTree {
122122
prefix: self.cx.path(self.span, self.cx.std_path(&[sym::asserting])),
123-
kind: UseTreeKind::Nested(thin_vec![
124-
nested_tree(self, sym::TryCaptureGeneric),
125-
nested_tree(self, sym::TryCapturePrintable),
126-
]),
123+
kind: UseTreeKind::Nested {
124+
items: thin_vec![
125+
nested_tree(self, sym::TryCaptureGeneric),
126+
nested_tree(self, sym::TryCapturePrintable),
127+
],
128+
span: self.span,
129+
},
127130
span: self.span,
128131
}),
129132
),

compiler/rustc_codegen_gcc/src/debuginfo.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use crate::rustc_index::Idx;
21
use gccjit::{Location, RValue};
32
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
43
use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoMethods};
54
use rustc_data_structures::sync::Lrc;
65
use rustc_index::bit_set::BitSet;
7-
use rustc_index::IndexVec;
6+
use rustc_index::{Idx, IndexVec};
87
use rustc_middle::mir::{self, Body, SourceScope};
98
use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty};
109
use rustc_session::config::DebugInfo;

0 commit comments

Comments
 (0)