Skip to content

Commit bd1ba78

Browse files
authored
Merge pull request #21786 from rust-lang/rustc-pull
minor: sync from downstream
2 parents aae1f07 + e911998 commit bd1ba78

834 files changed

Lines changed: 14949 additions & 12611 deletions

File tree

Some content is hidden

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

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ Ben Sago <ogham@users.noreply.github.com> <ogham@bsago.me>
8383
Ben Striegel <ben.striegel@gmail.com>
8484
Benjamin Jackman <ben@jackman.biz>
8585
Benoît Cortier <benoit.cortier@fried-world.eu>
86-
binarycat <binarycat@envs.net> lolbinarycat <dogedoge61+github@gmail.com> <dogedoge61@gmail.com>
86+
binarycat <binarycat@envs.net> lolbinarycat <dogedoge61+github@gmail.com>
87+
binarycat <binarycat@envs.net> lolbinarycat <dogedoge61@gmail.com>
8788
Bheesham Persaud <bheesham123@hotmail.com> Bheesham Persaud <bheesham.persaud@live.ca>
8889
bjorn3 <17426603+bjorn3@users.noreply.github.com> <bjorn3@users.noreply.github.com>
8990
bjorn3 <17426603+bjorn3@users.noreply.github.com> <bjorn3_gh@protonmail.com>

Cargo.lock

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
620620

621621
[[package]]
622622
name = "clippy"
623-
version = "0.1.95"
623+
version = "0.1.96"
624624
dependencies = [
625625
"anstream",
626626
"askama",
@@ -647,7 +647,7 @@ dependencies = [
647647

648648
[[package]]
649649
name = "clippy_config"
650-
version = "0.1.95"
650+
version = "0.1.96"
651651
dependencies = [
652652
"clippy_utils",
653653
"itertools",
@@ -671,7 +671,7 @@ dependencies = [
671671

672672
[[package]]
673673
name = "clippy_lints"
674-
version = "0.1.95"
674+
version = "0.1.96"
675675
dependencies = [
676676
"arrayvec",
677677
"cargo_metadata 0.18.1",
@@ -703,7 +703,7 @@ dependencies = [
703703

704704
[[package]]
705705
name = "clippy_utils"
706-
version = "0.1.95"
706+
version = "0.1.96"
707707
dependencies = [
708708
"arrayvec",
709709
"itertools",
@@ -1107,7 +1107,7 @@ dependencies = [
11071107

11081108
[[package]]
11091109
name = "declare_clippy_lint"
1110-
version = "0.1.95"
1110+
version = "0.1.96"
11111111

11121112
[[package]]
11131113
name = "derive-where"
@@ -1217,9 +1217,9 @@ dependencies = [
12171217

12181218
[[package]]
12191219
name = "dispatch2"
1220-
version = "0.3.0"
1220+
version = "0.3.1"
12211221
source = "registry+https://github.com/rust-lang/crates.io-index"
1222-
checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
1222+
checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
12231223
dependencies = [
12241224
"bitflags",
12251225
"block2",
@@ -4121,7 +4121,7 @@ version = "0.0.0"
41214121
dependencies = [
41224122
"cc",
41234123
"libc",
4124-
"shell-words",
4124+
"shlex",
41254125
]
41264126

41274127
[[package]]
@@ -5116,12 +5116,6 @@ dependencies = [
51165116
"lazy_static",
51175117
]
51185118

5119-
[[package]]
5120-
name = "shell-words"
5121-
version = "1.1.1"
5122-
source = "registry+https://github.com/rust-lang/crates.io-index"
5123-
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
5124-
51255119
[[package]]
51265120
name = "shlex"
51275121
version = "1.3.0"

compiler/rustc_abi/src/extern_abi/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
use std::assert_matches;
12
use std::str::FromStr;
23

3-
use rustc_data_structures::assert_matches;
4-
54
use super::*;
65

76
#[allow(non_snake_case)]

compiler/rustc_abi/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// tidy-alphabetical-start
2-
#![cfg_attr(all(feature = "nightly", bootstrap, test), feature(assert_matches))]
32
#![cfg_attr(feature = "nightly", allow(internal_features))]
43
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
54
#![cfg_attr(feature = "nightly", feature(step_trait))]
@@ -2145,21 +2144,22 @@ pub enum PointerKind {
21452144
}
21462145

21472146
/// Encodes extra information we have about a pointer.
2147+
///
21482148
/// Note that this information is advisory only, and backends are free to ignore it:
21492149
/// if the information is wrong, that can cause UB, but if the information is absent,
21502150
/// that must always be okay.
21512151
#[derive(Copy, Clone, Debug)]
21522152
pub struct PointeeInfo {
2153-
/// If this is `None`, then this is a raw pointer, so size and alignment are not guaranteed to
2154-
/// be reliable.
2153+
/// If this is `None`, then this is a raw pointer.
21552154
pub safe: Option<PointerKind>,
2156-
/// If `safe` is `Some`, then the pointer is either null or dereferenceable for this many bytes.
2155+
/// If `size` is not zero, then the pointer is either null or dereferenceable for this many bytes
2156+
/// (independent of `safe`).
2157+
///
21572158
/// On a function argument, "dereferenceable" here means "dereferenceable for the entire duration
21582159
/// of this function call", i.e. it is UB for the memory that this pointer points to be freed
21592160
/// while this function is still running.
2160-
/// The size can be zero if the pointer is not dereferenceable.
21612161
pub size: Size,
2162-
/// If `safe` is `Some`, then the pointer is aligned as indicated.
2162+
/// The pointer is guaranteed to be aligned this much (independent of `safe`).
21632163
pub align: Align,
21642164
}
21652165

compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! This API is completely unstable and subject to change.
66
77
// tidy-alphabetical-start
8-
#![cfg_attr(bootstrap, feature(if_let_guard))]
98
#![doc(test(attr(deny(warnings), allow(internal_features))))]
109
#![feature(associated_type_defaults)]
1110
#![feature(box_patterns)]

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,7 @@ macro_rules! common_visitor_and_walkers {
762762
// This is only used by the MutVisitor. We include this symmetry here to make writing other
763763
// functions easier.
764764
$(${ignore($lt)}
765-
#[cfg_attr(not(bootstrap), expect(unused, rustc::disallowed_pass_by_ref))]
766-
#[cfg_attr(bootstrap, expect(unused, rustc::pass_by_value))]
765+
#[expect(unused, rustc::disallowed_pass_by_ref)]
767766
#[inline]
768767
)?
769768
fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result {

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ use ast::visit::Visitor;
4242
use hir::def::{DefKind, PartialRes, Res};
4343
use hir::{BodyId, HirId};
4444
use rustc_abi::ExternAbi;
45+
use rustc_ast as ast;
4546
use rustc_ast::*;
4647
use rustc_attr_parsing::{AttributeParser, ShouldEmit};
4748
use rustc_data_structures::fx::FxHashSet;
4849
use rustc_errors::ErrorGuaranteed;
50+
use rustc_hir as hir;
4951
use rustc_hir::attrs::{AttributeKind, InlineAttr};
5052
use rustc_hir::def_id::{DefId, LocalDefId};
5153
use rustc_middle::span_bug;
5254
use rustc_middle::ty::{Asyncness, DelegationAttrs, DelegationFnSigAttrs, ResolverAstLowering};
5355
use rustc_span::symbol::kw;
5456
use rustc_span::{DUMMY_SP, Ident, Span, Symbol};
5557
use smallvec::SmallVec;
56-
use {rustc_ast as ast, rustc_hir as hir};
5758

5859
use crate::delegation::generics::{GenericsGenerationResult, GenericsGenerationResults};
5960
use crate::errors::{CycleInDelegationSignatureResolution, UnresolvedDelegationCallee};
@@ -815,13 +816,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
815816
}
816817
}
817818

818-
struct SelfResolver<'a> {
819-
resolver: &'a mut ResolverAstLowering,
819+
struct SelfResolver<'a, 'tcx> {
820+
resolver: &'a mut ResolverAstLowering<'tcx>,
820821
path_id: NodeId,
821822
self_param_id: NodeId,
822823
}
823824

824-
impl<'a> SelfResolver<'a> {
825+
impl SelfResolver<'_, '_> {
825826
fn try_replace_id(&mut self, id: NodeId) {
826827
if let Some(res) = self.resolver.partial_res_map.get(&id)
827828
&& let Some(Res::Local(sig_id)) = res.full_res()
@@ -833,7 +834,7 @@ impl<'a> SelfResolver<'a> {
833834
}
834835
}
835836

836-
impl<'ast, 'a> Visitor<'ast> for SelfResolver<'a> {
837+
impl<'ast, 'a> Visitor<'ast> for SelfResolver<'a, '_> {
837838
fn visit_id(&mut self, id: NodeId) {
838839
self.try_replace_id(id);
839840
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use super::{
2727

2828
pub(super) struct ItemLowerer<'a, 'hir> {
2929
pub(super) tcx: TyCtxt<'hir>,
30-
pub(super) resolver: &'a mut ResolverAstLowering,
30+
pub(super) resolver: &'a mut ResolverAstLowering<'hir>,
3131
pub(super) ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
3232
pub(super) owners: &'a mut IndexVec<LocalDefId, hir::MaybeOwner<'hir>>,
3333
}

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
//! in the HIR, especially for multiple identifiers.
3232
3333
// tidy-alphabetical-start
34-
#![cfg_attr(bootstrap, feature(if_let_guard))]
3534
#![feature(box_patterns)]
3635
#![recursion_limit = "256"]
3736
// tidy-alphabetical-end
@@ -99,7 +98,7 @@ struct LoweringContext<'a, 'hir> {
9998
// will be in AST index.
10099
ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
101100

102-
resolver: &'a mut ResolverAstLowering,
101+
resolver: &'a mut ResolverAstLowering<'hir>,
103102
disambiguator: DisambiguatorState,
104103

105104
/// Used to allocate HIR nodes.
@@ -133,7 +132,7 @@ struct LoweringContext<'a, 'hir> {
133132

134133
current_hir_id_owner: hir::OwnerId,
135134
item_local_id_counter: hir::ItemLocalId,
136-
trait_map: ItemLocalMap<Box<[TraitCandidate]>>,
135+
trait_map: ItemLocalMap<&'hir [TraitCandidate<'hir>]>,
137136

138137
impl_trait_defs: Vec<hir::GenericParam<'hir>>,
139138
impl_trait_bounds: Vec<hir::WherePredicate<'hir>>,
@@ -162,7 +161,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
162161
fn new(
163162
tcx: TyCtxt<'hir>,
164163
ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
165-
resolver: &'a mut ResolverAstLowering,
164+
resolver: &'a mut ResolverAstLowering<'hir>,
166165
) -> Self {
167166
let registered_tools = tcx.registered_tools(()).iter().map(|x| x.name).collect();
168167
Self {
@@ -248,7 +247,7 @@ impl SpanLowerer {
248247
}
249248

250249
#[extension(trait ResolverAstLoweringExt)]
251-
impl ResolverAstLowering {
250+
impl ResolverAstLowering<'_> {
252251
fn legacy_const_generic_args(&self, expr: &Expr, tcx: TyCtxt<'_>) -> Option<Vec<usize>> {
253252
let ExprKind::Path(None, path) = &expr.kind else {
254253
return None;
@@ -748,8 +747,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
748747
self.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id)));
749748
}
750749

751-
if let Some(traits) = self.resolver.trait_map.remove(&ast_node_id) {
752-
self.trait_map.insert(hir_id.local_id, traits.into_boxed_slice());
750+
if let Some(&traits) = self.resolver.trait_map.get(&ast_node_id) {
751+
self.trait_map.insert(hir_id.local_id, traits);
753752
}
754753

755754
// Check whether the same `NodeId` is lowered more than once.

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! by `rustc_ast_lowering`.
44
55
// tidy-alphabetical-start
6-
#![cfg_attr(bootstrap, feature(if_let_guard))]
76
#![feature(box_patterns)]
87
#![feature(iter_intersperse)]
98
#![feature(iter_is_partitioned)]

0 commit comments

Comments
 (0)