Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 77be7a3

Browse files
committedFeb 29, 2024
Auto merge of #121810 - matthiaskrgr:rollup-mawij2g, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #121326 (Detect empty leading where clauses on type aliases) - #121464 (rustc: Fix wasm64 metadata object files) - #121681 (Safe Transmute: Revise safety analysis) - #121753 (Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths) - #121782 (allow statics pointing to mutable statics) - #121798 (Fix links in rustc doc) - #121806 (add const test for ptr::metadata) - #121809 (Remove doc aliases to PATH) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 878c8a2 + b961f25 commit 77be7a3

File tree

172 files changed

+1805
-2504
lines changed

Some content is hidden

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

172 files changed

+1805
-2504
lines changed
 

‎Cargo.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3646,6 +3646,7 @@ dependencies = [
36463646
"thin-vec",
36473647
"thorin-dwp",
36483648
"tracing",
3649+
"wasm-encoder",
36493650
"windows",
36503651
]
36513652

@@ -6142,6 +6143,15 @@ version = "0.2.91"
61426143
source = "registry+https://github.com/rust-lang/crates.io-index"
61436144
checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838"
61446145

6146+
[[package]]
6147+
name = "wasm-encoder"
6148+
version = "0.200.0"
6149+
source = "registry+https://github.com/rust-lang/crates.io-index"
6150+
checksum = "b9e3fb0c8fbddd78aa6095b850dfeedbc7506cf5f81e633f69cf8f2333ab84b9"
6151+
dependencies = [
6152+
"leb128",
6153+
]
6154+
61456155
[[package]]
61466156
name = "wasmparser"
61476157
version = "0.118.2"

‎compiler/rustc_ast/src/ast.rs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,10 @@ impl Default for Generics {
403403
/// A where-clause in a definition.
404404
#[derive(Clone, Encodable, Decodable, Debug)]
405405
pub struct WhereClause {
406-
/// `true` if we ate a `where` token: this can happen
407-
/// if we parsed no predicates (e.g. `struct Foo where {}`).
408-
/// This allows us to pretty-print accurately.
406+
/// `true` if we ate a `where` token.
407+
///
408+
/// This can happen if we parsed no predicates, e.g., `struct Foo where {}`.
409+
/// This allows us to pretty-print accurately and provide correct suggestion diagnostics.
409410
pub has_where_token: bool,
410411
pub predicates: ThinVec<WherePredicate>,
411412
pub span: Span,
@@ -3007,18 +3008,29 @@ pub struct Trait {
30073008
///
30083009
/// If there is no where clause, then this is `false` with `DUMMY_SP`.
30093010
#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)]
3010-
pub struct TyAliasWhereClause(pub bool, pub Span);
3011+
pub struct TyAliasWhereClause {
3012+
pub has_where_token: bool,
3013+
pub span: Span,
3014+
}
3015+
3016+
/// The span information for the two where clauses on a `TyAlias`.
3017+
#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)]
3018+
pub struct TyAliasWhereClauses {
3019+
/// Before the equals sign.
3020+
pub before: TyAliasWhereClause,
3021+
/// After the equals sign.
3022+
pub after: TyAliasWhereClause,
3023+
/// The index in `TyAlias.generics.where_clause.predicates` that would split
3024+
/// into predicates from the where clause before the equals sign and the ones
3025+
/// from the where clause after the equals sign.
3026+
pub split: usize,
3027+
}
30113028

30123029
#[derive(Clone, Encodable, Decodable, Debug)]
30133030
pub struct TyAlias {
30143031
pub defaultness: Defaultness,
30153032
pub generics: Generics,
3016-
/// The span information for the two where clauses (before equals, after equals)
3017-
pub where_clauses: (TyAliasWhereClause, TyAliasWhereClause),
3018-
/// The index in `generics.where_clause.predicates` that would split into
3019-
/// predicates from the where clause before the equals and the predicates
3020-
/// from the where clause after the equals
3021-
pub where_predicates_split: usize,
3033+
pub where_clauses: TyAliasWhereClauses,
30223034
pub bounds: GenericBounds,
30233035
pub ty: Option<P<Ty>>,
30243036
}

0 commit comments

Comments
 (0)
Please sign in to comment.