Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #135893

Merged
merged 22 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7bfcddf
byval parameter should have align 8 on aix
Dec 16, 2024
32f1c1d
Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C API
Zalathar Dec 7, 2024
d10bdaf
Note that cg_llvm's gimli should match the version used elsewhere
Zalathar Jan 6, 2025
ece8b0c
make UI tests that use `--test` work on panic=abort targets
japaric Jan 21, 2025
8600694
Update the `wasm-component-ld` tool
alexcrichton Jan 21, 2025
ff7cf14
rustdoc: Finalize dyn compatibility renaming
fmease Jan 22, 2025
3ef506f
Don't pick `T: FnPtr` nested goals
BoxyUwU Jan 22, 2025
513bfaa
Use `structurally_normalize` instead of manual `normalizes-to` goals
BoxyUwU Jan 21, 2025
b99f59b
Rename `structurally_normalize` to `structurally_normalize_ty`
BoxyUwU Jan 21, 2025
20ae3c0
Enforce that all spans are lowered in ast lowering
oli-obk Jan 22, 2025
921c226
Remove `Copy` bound from `enter_forall`
BoxyUwU Jan 22, 2025
d00d4df
Refactor dyn-compatibility error and suggestions
cramertj Nov 20, 2024
cd1f36b
Rollup merge of #133372 - cramertj:rework-dyn-suggestions, r=fmease
matthiaskrgr Jan 22, 2025
df01040
Rollup merge of #134396 - mustartt:byval-pointer-natural-alignment, r…
matthiaskrgr Jan 22, 2025
e0d74c0
Rollup merge of #135156 - Zalathar:debuginfo-flags, r=cuviper
matthiaskrgr Jan 22, 2025
ef0e686
Rollup merge of #135816 - BoxyUwU:root_normalizes_to_goal_ice, r=lcnr
matthiaskrgr Jan 22, 2025
e4c144b
Rollup merge of #135823 - ferrocene:ja-gh135819, r=jieyouxu
matthiaskrgr Jan 22, 2025
b0bb6e3
Rollup merge of #135850 - alexcrichton:update-wasm-component-ld, r=ji…
matthiaskrgr Jan 22, 2025
413f87a
Rollup merge of #135858 - fmease:rustdoc-mv-obj-save-dyn-compat-ii, r…
matthiaskrgr Jan 22, 2025
318466a
Rollup merge of #135866 - BoxyUwU:dont_pick_fnptr_nested_goals, r=lcnr
matthiaskrgr Jan 22, 2025
7235b1a
Rollup merge of #135874 - oli-obk:push-vrvyyrtyxkxm, r=compiler-errors
matthiaskrgr Jan 22, 2025
e0b4ba3
Rollup merge of #135875 - BoxyUwU:enter_forall_no_copy, r=lcnr
matthiaskrgr Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,6 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
dependencies = [
"ahash",
"allocator-api2",
"serde",
]

[[package]]
Expand All @@ -1535,6 +1534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
dependencies = [
"foldhash",
"serde",
]

[[package]]
Expand Down Expand Up @@ -5880,9 +5880,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "wasi-preview1-component-adapter-provider"
version = "24.0.1"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f76d9fa52234153eeb40b088de91a8c13dc28a912cf6f31cd89ca4bac9024e0"
checksum = "dcd9f21bbde82ba59e415a8725e6ad0d0d7e9e460b1a3ccbca5bdee952c1a324"

[[package]]
name = "wasm-bindgen"
Expand Down Expand Up @@ -5944,17 +5944,17 @@ dependencies = [

[[package]]
name = "wasm-component-ld"
version = "0.5.11"
version = "0.5.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2b05c3820968b335f10e703218459e4fd2cc91fdfc8f7936a993f1aacaa0938"
checksum = "580305a8e3f1b7a79859a8db897de643533b2851c5eb080fe5800233f16dec88"
dependencies = [
"anyhow",
"clap",
"lexopt",
"libc",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.219.1",
"wasmparser 0.223.0",
"wat",
"windows-sys 0.59.0",
"winsplit",
Expand Down Expand Up @@ -5991,18 +5991,19 @@ dependencies = [

[[package]]
name = "wasm-metadata"
version = "0.219.1"
version = "0.223.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af5a8e37a5e996861e1813f8de30911c47609c9ff51a7284f7dbd754dc3a9f3"
checksum = "5c730c3379d3d20e5a0245b0724b924483e853588ca8fba547c1e21f19e7d735"
dependencies = [
"anyhow",
"indexmap",
"serde",
"serde_derive",
"serde_json",
"spdx",
"wasm-encoder 0.219.1",
"wasmparser 0.219.1",
"url",
"wasm-encoder 0.223.0",
"wasmparser 0.223.0",
]

[[package]]
Expand All @@ -6011,12 +6012,8 @@ version = "0.219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c771866898879073c53b565a6c7b49953795159836714ac56a5befb581227c5"
dependencies = [
"ahash",
"bitflags",
"hashbrown 0.14.5",
"indexmap",
"semver",
"serde",
]

[[package]]
Expand All @@ -6035,8 +6032,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5a99faceb1a5a84dd6084ec4bfa4b2ab153b5793b43fd8f58b89232634afc35"
dependencies = [
"bitflags",
"hashbrown 0.15.2",
"indexmap",
"semver",
"serde",
]

[[package]]
Expand Down Expand Up @@ -6476,9 +6475,9 @@ checksum = "3ab703352da6a72f35c39a533526393725640575bb211f61987a2748323ad956"

[[package]]
name = "wit-component"
version = "0.219.1"
version = "0.223.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1673163c0cb14a6a19ddbf44dd4efe6f015ec1ebb8156710ac32501f19fba2"
checksum = "c10ed2aeee4c8ec5715875f62f4a3de3608d6987165c116810d8c2908aa9d93b"
dependencies = [
"anyhow",
"bitflags",
Expand All @@ -6487,17 +6486,17 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.219.1",
"wasm-encoder 0.223.0",
"wasm-metadata",
"wasmparser 0.219.1",
"wasmparser 0.223.0",
"wit-parser",
]

[[package]]
name = "wit-parser"
version = "0.219.1"
version = "0.223.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a86f669283257e8e424b9a4fc3518e3ade0b95deb9fbc0f93a1876be3eda598"
checksum = "92772f4dcacb804b275981eea1d920b12b377993b53307f1e33d87404e080281"
dependencies = [
"anyhow",
"id-arena",
Expand All @@ -6508,7 +6507,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.219.1",
"wasmparser 0.223.0",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let path = hir::ExprKind::Path(hir::QPath::TypeRelative(
self.arena.alloc(self.ty(span, hir::TyKind::Path(qpath))),
self.arena.alloc(hir::PathSegment::new(
Ident::new(name, span),
Ident::new(name, self.lower_span(span)),
self.next_id(),
Res::Err,
)),
Expand Down
41 changes: 24 additions & 17 deletions compiler/rustc_ast_lowering/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,31 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {

// Make sure that the DepNode of some node coincides with the HirId
// owner of that node.
if cfg!(debug_assertions) && hir_id.owner != self.owner {
span_bug!(
span,
"inconsistent HirId at `{:?}` for `{:?}`: \
if cfg!(debug_assertions) {
if hir_id.owner != self.owner {
span_bug!(
span,
"inconsistent HirId at `{:?}` for `{node:?}`: \
current_dep_node_owner={} ({:?}), hir_id.owner={} ({:?})",
self.tcx.sess.source_map().span_to_diagnostic_string(span),
node,
self.tcx
.definitions_untracked()
.def_path(self.owner.def_id)
.to_string_no_crate_verbose(),
self.owner,
self.tcx
.definitions_untracked()
.def_path(hir_id.owner.def_id)
.to_string_no_crate_verbose(),
hir_id.owner,
)
self.tcx.sess.source_map().span_to_diagnostic_string(span),
self.tcx
.definitions_untracked()
.def_path(self.owner.def_id)
.to_string_no_crate_verbose(),
self.owner,
self.tcx
.definitions_untracked()
.def_path(hir_id.owner.def_id)
.to_string_no_crate_verbose(),
hir_id.owner,
)
}
if self.tcx.sess.opts.incremental.is_some()
&& span.parent().is_none()
&& !span.is_dummy()
{
span_bug!(span, "span without a parent: {:#?}, {node:?}", span.data())
}
}

self.nodes[hir_id.local_id] = ParentedNode { parent: self.parent_node, node };
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
// this as a special case.
return self.lower_fn_body(decl, |this| {
if attrs.iter().any(|a| a.name_or_empty() == sym::rustc_intrinsic) {
let span = this.lower_span(span);
let empty_block = hir::Block {
hir_id: this.next_id(),
stmts: &[],
Expand Down
24 changes: 10 additions & 14 deletions compiler/rustc_ast_lowering/src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,24 +375,24 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
expr: &Expr,
allow_paths: bool,
) -> &'hir hir::PatExpr<'hir> {
let span = self.lower_span(expr.span);
let err = |guar| hir::PatExprKind::Lit {
lit: self.arena.alloc(respan(self.lower_span(expr.span), LitKind::Err(guar))),
lit: self.arena.alloc(respan(span, LitKind::Err(guar))),
negated: false,
};
let kind = match &expr.kind {
ExprKind::Lit(lit) => {
hir::PatExprKind::Lit { lit: self.lower_lit(lit, expr.span), negated: false }
hir::PatExprKind::Lit { lit: self.lower_lit(lit, span), negated: false }
}
ExprKind::ConstBlock(c) => hir::PatExprKind::ConstBlock(self.lower_const_block(c)),
ExprKind::IncludedBytes(bytes) => hir::PatExprKind::Lit {
lit: self.arena.alloc(respan(
self.lower_span(expr.span),
LitKind::ByteStr(Arc::clone(bytes), StrStyle::Cooked),
)),
lit: self
.arena
.alloc(respan(span, LitKind::ByteStr(Arc::clone(bytes), StrStyle::Cooked))),
negated: false,
},
ExprKind::Err(guar) => err(*guar),
ExprKind::Dummy => span_bug!(expr.span, "lowered ExprKind::Dummy"),
ExprKind::Dummy => span_bug!(span, "lowered ExprKind::Dummy"),
ExprKind::Path(qself, path) if allow_paths => hir::PatExprKind::Path(self.lower_qpath(
expr.id,
qself,
Expand All @@ -403,21 +403,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
None,
)),
ExprKind::Unary(UnOp::Neg, inner) if let ExprKind::Lit(lit) = &inner.kind => {
hir::PatExprKind::Lit { lit: self.lower_lit(lit, expr.span), negated: true }
hir::PatExprKind::Lit { lit: self.lower_lit(lit, span), negated: true }
}
_ => {
let pattern_from_macro = expr.is_approximately_pattern();
let guar = self.dcx().emit_err(ArbitraryExpressionInPattern {
span: expr.span,
span,
pattern_from_macro_note: pattern_from_macro,
});
err(guar)
}
};
self.arena.alloc(hir::PatExpr {
hir_id: self.lower_node_id(expr.id),
span: expr.span,
kind,
})
self.arena.alloc(hir::PatExpr { hir_id: self.lower_node_id(expr.id), span, kind })
}
}
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/type_check/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
CustomTypeOp::new(
|ocx| {
let structurally_normalize = |ty| {
ocx.structurally_normalize(
ocx.structurally_normalize_ty(
&ObligationCause::misc(
location.to_locations().span(body),
body.source.def_id().expect_local(),
Expand Down Expand Up @@ -230,7 +230,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
ConstraintCategory::Boring,
CustomTypeOp::new(
|ocx| {
ocx.structurally_normalize(
ocx.structurally_normalize_ty(
&ObligationCause::misc(
location.to_locations().span(body),
body.source.def_id().expect_local(),
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ test = false
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
# To avoid duplicate dependencies, this should match the version of gimli used
# by `rustc_codegen_ssa` via its `thorin-dwp` dependency.
gimli = "0.30"
itertools = "0.12"
libc = "0.2"
Expand Down
20 changes: 17 additions & 3 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,11 @@ pub mod debuginfo {
pub type DIEnumerator = DIDescriptor;
pub type DITemplateTypeParameter = DIDescriptor;

// These values **must** match with LLVMRustDIFlags!!
bitflags! {
/// Must match the layout of `LLVMDIFlags` in the LLVM-C API.
///
/// Each value declared here must also be covered by the static
/// assertions in `RustWrapper.cpp` used by `fromRust(LLVMDIFlags)`.
#[repr(transparent)]
#[derive(Clone, Copy, Default)]
pub struct DIFlags: u32 {
Expand All @@ -752,7 +755,7 @@ pub mod debuginfo {
const FlagPublic = 3;
const FlagFwdDecl = (1 << 2);
const FlagAppleBlock = (1 << 3);
const FlagBlockByrefStruct = (1 << 4);
const FlagReservedBit4 = (1 << 4);
const FlagVirtual = (1 << 5);
const FlagArtificial = (1 << 6);
const FlagExplicit = (1 << 7);
Expand All @@ -763,10 +766,21 @@ pub mod debuginfo {
const FlagStaticMember = (1 << 12);
const FlagLValueReference = (1 << 13);
const FlagRValueReference = (1 << 14);
const FlagExternalTypeRef = (1 << 15);
const FlagReserved = (1 << 15);
const FlagSingleInheritance = (1 << 16);
const FlagMultipleInheritance = (2 << 16);
const FlagVirtualInheritance = (3 << 16);
const FlagIntroducedVirtual = (1 << 18);
const FlagBitField = (1 << 19);
const FlagNoReturn = (1 << 20);
// The bit at (1 << 21) is unused, but was `LLVMDIFlagMainSubprogram`.
const FlagTypePassByValue = (1 << 22);
const FlagTypePassByReference = (1 << 23);
const FlagEnumClass = (1 << 24);
const FlagThunk = (1 << 25);
const FlagNonTrivial = (1 << 26);
const FlagBigEndian = (1 << 27);
const FlagLittleEndian = (1 << 28);
}
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_error_codes/src/error_codes/E0038.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ trait Foo {
### Trait contains associated constants

Just like static functions, associated constants aren't stored on the method
table. If the trait or any subtrait contain an associated constant, they cannot
be made into an object.
table. If the trait or any subtrait contain an associated constant, they are not
dyn compatible.

```compile_fail,E0038
trait Foo {
const X: i32;
}

impl Foo {}
impl dyn Foo {}
```

A simple workaround is to use a helper method instead:
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ declare_features! (
/// then removed. But there was no utility storing it separately, so now
/// it's in this list.
(removed, no_stack_check, "1.0.0", None, None),
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn-compatible (object safe).
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn compatible (object safe).
/// Renamed to `dyn_compatible_for_dispatch`.
(removed, object_safe_for_dispatch, "1.83.0", Some(43561),
Some("renamed to `dyn_compatible_for_dispatch`")),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ declare_features! (
(unstable, doc_notable_trait, "1.52.0", Some(45040)),
/// Allows using the `may_dangle` attribute (RFC 1327).
(unstable, dropck_eyepatch, "1.10.0", Some(34761)),
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn-compatible[^1].
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn compatible[^1].
/// In that case, `dyn Trait: Trait` does not hold. Moreover, coercions and
/// casts in safe Rust to `dyn Trait` for such a `Trait` is also forbidden.
///
Expand Down
Loading
Loading