-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Check signature WF when lowering MIR body #137298
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors r+ rollup |
Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr
…kingjubilee Rollup of 14 pull requests Successful merges: - rust-lang#131651 (Create a generic AVR target: avr-none) - rust-lang#136473 (infer linker flavor by linker name if it's sufficiently specific) - rust-lang#136608 (Pass through of target features to llvm-bitcode-linker and handling them) - rust-lang#136985 (Do not ignore uninhabited types for function-call ABI purposes. (Remove BackendRepr::Uninhabited)) - rust-lang#137192 (Remove obsolete Windows ThinLTO+TLS workaround) - rust-lang#137204 (Clarify MIR dialects and phases) - rust-lang#137270 (Fix `*-win7-windows-msvc` target since 26eeac1) - rust-lang#137298 (Check signature WF when lowering MIR body) - rust-lang#137299 (Simplify `Postorder` customization.) - rust-lang#137312 (Update references to cc_detect.rs) - rust-lang#137313 (Some codegen_llvm cleanups) - rust-lang#137318 (Workaround Cranelift not yet properly supporting vectors smaller than 128bit) - rust-lang#137322 (Update docs for default features of wasm targets) - rust-lang#137324 (Make x86 QNX target name consistent with other Rust targets) r? `@ghost` `@rustbot` modify labels: rollup
#137339 (comment) |
Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr try-job: test-various
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Hm, the wasm tests may have symbol redefinition problems? 🤔 |
I think that's a proper error, we somehow depend on the value of a static when checking that it's well-formed 🤔 this is surprising to me (and even more surprising that we don't have a separate UI test which triggers this) |
bb7b912
to
eb94a63
Compare
@bors try |
Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr try-job: test-various
It's rust/compiler/rustc_hir_analysis/src/check/mod.rs Lines 148 to 195 in 71e06b9
I'll move that out of WF and into the regular "checks". |
eb94a63
to
2af99ef
Compare
@bors try |
Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr try-job: test-various
Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr try-job: test-various
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#135501 (Inject `compiler_builtins` during postprocessing and ensure it is made private) - rust-lang#136543 (intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic) - rust-lang#137121 (stabilize `(const_)ptr_sub_ptr`) - rust-lang#137180 (Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes) - rust-lang#137256 (compiler: untangle SIMD alignment assumptions) - rust-lang#137298 (Check signature WF when lowering MIR body) - rust-lang#137415 (Remove invalid suggestion of into_iter for extern macro) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
There was a bit of discussion on Zulip on what's going on here wasm-wise, and while it looks like you've diagnosed and solved it I wanted to lend a helping hand in that respect where if anything else wasm-related comes up here feel free to ping me and I can try to help discover what's going on if any extra help is needed |
0e9a6cc
to
a6f87fc
Compare
This comment has been minimized.
This comment has been minimized.
@@ -7,4 +7,5 @@ | |||
|
|||
struct A; | |||
struct B; | |||
const S: A = B; | |||
|
|||
pub const S: A = B; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A side-effect of this is that consts are only required to typeck if they're being documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in rustdoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh 💀 yes in roblox
@@ -2,4 +2,4 @@ | |||
|
|||
#![feature(const_transmute)] | |||
|
|||
const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; //~ ERROR cannot transmute between types of different sizes, or dependently-sized types | |||
pub const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; //~ ERROR cannot transmute between types of different sizes, or dependently-sized types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this pub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we can keep the error
@bors rü |
@bors r+ |
Rollup of 20 pull requests Successful merges: - rust-lang#134063 (dec2flt: Clean up float parsing modules) - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra) - rust-lang#136662 (Count char width at most once in `Formatter::pad`) - rust-lang#136764 (Make `ptr_cast_add_auto_to_object` lint into hard error) - rust-lang#136798 (Added documentation for flushing per rust-lang#74348) - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - rust-lang#136975 (Look for `python3` first on MacOS, not `py`) - rust-lang#136977 (Upload Datadog metrics with citool) - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - rust-lang#137298 (Check signature WF when lowering MIR body) - rust-lang#137463 ([illumos] attempt to use posix_spawn to spawn processes) - rust-lang#137477 (uefi: Add Service Binding Protocol abstraction) - rust-lang#137569 (Stabilize `string_extend_from_within`) - rust-lang#137633 (Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack) - rust-lang#137679 (Various coretests improvements) - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - rust-lang#137728 (Remove unsizing coercions for tuples) - rust-lang#137731 (Resume one waiter at once in deadlock handler) - rust-lang#137875 (mir_build: Integrate "simplification" steps into match-pair-tree creation) - rust-lang#138028 (compiler: add `ExternAbi::is_rustic_abi`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137298 - compiler-errors:mir-wf, r=lcnr Check signature WF when lowering MIR body Alternative to rust-lang#137233. rust-lang#137233 (comment) Fixes rust-lang#137186 We do this check in `mir_drops_elaborated_and_const_checked` and not during `mir_promoted` because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily. r? lcnr try-job: test-various
Since nobody excluded a beta backport, I'll nominate it myself (hope it's fine), this patch is fixing an ICE, I think it could be "a nice to have" but no particular urgency otherwise, afaics @rustbot label +beta-nominated |
Alternative to #137233.
#137233 (comment)
Fixes #137186
We do this check in
mir_drops_elaborated_and_const_checked
and not duringmir_promoted
because that may result in borrowck cycles if WF requires looking into an opaque hidden type. This causes some TAIT tests to fail unnecessarily.r? lcnr
try-job: test-various