Skip to content

Commit 54a791d

Browse files
authored
Merge branch 'master' into test-float-parse-fix
2 parents 0f52ff8 + fd17dea commit 54a791d

File tree

399 files changed

+11164
-5529
lines changed

Some content is hidden

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

399 files changed

+11164
-5529
lines changed

.github/workflows/ci.yml

-14
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,6 @@ jobs:
182182
- name: show the current environment
183183
run: src/ci/scripts/dump-environment.sh
184184

185-
# Temporary fix to unblock CI
186-
# Remove the latest Windows SDK for 32-bit Windows MSVC builds.
187-
# See issue https://github.com/rust-lang/rust/issues/137733 for more details.
188-
- name: Remove Windows SDK 10.0.26100.0
189-
shell: powershell
190-
if: ${{ matrix.name == 'i686-msvc-1' || matrix.name == 'i686-msvc-2' || matrix.name == 'dist-i686-msvc' }}
191-
run: |
192-
$kits = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots').KitsRoot10
193-
$sdk_version = "10.0.26100.0"
194-
195-
foreach ($kind in 'Bin', 'Lib', 'Include') {
196-
Remove-Item -Force -Recurse $kits\$kind\$sdk_version -ErrorAction Continue
197-
}
198-
199185
- name: run the build
200186
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
201187
run: src/ci/scripts/run-build-from-ci.sh 2>&1

compiler/rustc_ast/src/ast.rs

+2
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,11 @@ impl WhereClause {
417417
/// A single predicate in a where-clause.
418418
#[derive(Clone, Encodable, Decodable, Debug)]
419419
pub struct WherePredicate {
420+
pub attrs: AttrVec,
420421
pub kind: WherePredicateKind,
421422
pub id: NodeId,
422423
pub span: Span,
424+
pub is_placeholder: bool,
423425
}
424426

425427
/// Predicate kind in where-clause.

compiler/rustc_ast/src/ast_traits.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::tokenstream::LazyAttrTokenStream;
1111
use crate::{
1212
Arm, AssocItem, AttrItem, AttrKind, AttrVec, Attribute, Block, Crate, Expr, ExprField,
1313
FieldDef, ForeignItem, GenericParam, Item, NodeId, Param, Pat, PatField, Path, Stmt, StmtKind,
14-
Ty, Variant, Visibility,
14+
Ty, Variant, Visibility, WherePredicate,
1515
};
1616

1717
/// A utility trait to reduce boilerplate.
@@ -79,6 +79,7 @@ impl_has_node_id!(
7979
Stmt,
8080
Ty,
8181
Variant,
82+
WherePredicate,
8283
);
8384

8485
impl<T: AstDeref<Target: HasNodeId>> HasNodeId for T {
@@ -127,7 +128,16 @@ macro_rules! impl_has_tokens_none {
127128
}
128129

129130
impl_has_tokens!(AssocItem, AttrItem, Block, Expr, ForeignItem, Item, Pat, Path, Ty, Visibility);
130-
impl_has_tokens_none!(Arm, ExprField, FieldDef, GenericParam, Param, PatField, Variant);
131+
impl_has_tokens_none!(
132+
Arm,
133+
ExprField,
134+
FieldDef,
135+
GenericParam,
136+
Param,
137+
PatField,
138+
Variant,
139+
WherePredicate
140+
);
131141

132142
impl<T: AstDeref<Target: HasTokens>> HasTokens for T {
133143
fn tokens(&self) -> Option<&LazyAttrTokenStream> {
@@ -279,6 +289,7 @@ impl_has_attrs!(
279289
Param,
280290
PatField,
281291
Variant,
292+
WherePredicate,
282293
);
283294
impl_has_attrs_none!(Attribute, AttrItem, Block, Pat, Path, Ty, Visibility);
284295

compiler/rustc_ast/src/mut_visit.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,11 @@ pub trait MutVisitor: Sized {
338338
walk_where_clause(self, where_clause);
339339
}
340340

341-
fn visit_where_predicate(&mut self, where_predicate: &mut WherePredicate) {
342-
walk_where_predicate(self, where_predicate)
341+
fn flat_map_where_predicate(
342+
&mut self,
343+
where_predicate: WherePredicate,
344+
) -> SmallVec<[WherePredicate; 1]> {
345+
walk_flat_map_where_predicate(self, where_predicate)
343346
}
344347

345348
fn visit_where_predicate_kind(&mut self, kind: &mut WherePredicateKind) {
@@ -1097,15 +1100,20 @@ fn walk_ty_alias_where_clauses<T: MutVisitor>(vis: &mut T, tawcs: &mut TyAliasWh
10971100

10981101
fn walk_where_clause<T: MutVisitor>(vis: &mut T, wc: &mut WhereClause) {
10991102
let WhereClause { has_where_token: _, predicates, span } = wc;
1100-
visit_thin_vec(predicates, |predicate| vis.visit_where_predicate(predicate));
1103+
predicates.flat_map_in_place(|predicate| vis.flat_map_where_predicate(predicate));
11011104
vis.visit_span(span);
11021105
}
11031106

1104-
pub fn walk_where_predicate<T: MutVisitor>(vis: &mut T, pred: &mut WherePredicate) {
1105-
let WherePredicate { kind, id, span } = pred;
1107+
pub fn walk_flat_map_where_predicate<T: MutVisitor>(
1108+
vis: &mut T,
1109+
mut pred: WherePredicate,
1110+
) -> SmallVec<[WherePredicate; 1]> {
1111+
let WherePredicate { attrs, kind, id, span, is_placeholder: _ } = &mut pred;
11061112
vis.visit_id(id);
1113+
visit_attrs(vis, attrs);
11071114
vis.visit_where_predicate_kind(kind);
11081115
vis.visit_span(span);
1116+
smallvec![pred]
11091117
}
11101118

11111119
pub fn walk_where_predicate_kind<T: MutVisitor>(vis: &mut T, kind: &mut WherePredicateKind) {

0 commit comments

Comments
 (0)