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

Register ~const preds for Deref adjustments in HIR typeck #132275

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Oct 28, 2024

This doesn't do anything yet, since Deref and DerefMut aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing ~const in HIR typeck.

r? fee1-dead

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 28, 2024
@fee1-dead
Copy link
Member

Haven't looked at the code closely, but this could probably use a minicore test if possible.

@compiler-errors
Copy link
Member Author

I fixed up the existing minicore, moved it to an auxiliary dependency, so we can start adding real tests based off of that minicore that exercise its behavior.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 31, 2024

☔ The latest upstream changes (presumably #132301) made this pull request unmergeable. Please resolve the merge conflicts.

compiler/rustc_hir_typeck/src/place_op.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/adjustment.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2024
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 3, 2024
@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 3, 2024

📌 Commit 8ed8f22 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Nov 3, 2024
…ee1-dead

Register `~const` preds for `Deref` adjustments in HIR typeck

This doesn't *do* anything yet, since `Deref` and `DerefMut` aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing `~const` in HIR typeck.

r? fee1-dead
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
…kingjubilee

Rollup of 15 pull requests

Successful merges:

 - rust-lang#129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`)
 - rust-lang#131377 (Add LowerExp and UpperExp implementations to NonZero)
 - rust-lang#132275 (Register `~const` preds for `Deref` adjustments in HIR typeck)
 - rust-lang#132393 (Docs: added brief colon explanation)
 - rust-lang#132437 (coverage: Regression test for inlining into an uninstrumented crate)
 - rust-lang#132499 (unicode_data.rs: show command for generating file)
 - rust-lang#132503 (better test for const HashMap; remove const_hash leftovers)
 - rust-lang#132520 (NFC add known bug nr to test)
 - rust-lang#132522 (make codegen help output more consistent)
 - rust-lang#132523 (Added regression test for generics index out of bounds)
 - rust-lang#132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion)
 - rust-lang#132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d)
 - rust-lang#132540 (Do not format generic consts)
 - rust-lang#132543 (add and update some crashtests)
 - rust-lang#132550 (compiler: Continue introducing rustc_abi to the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

failed in #132551 (comment)


warning: function `const_eval_select` is never used
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs:465:10
   |
   |
LL | const fn const_eval_select<ARG: Tuple, F, G, RET>(

error: linking with `cc` failed: exit status: 1
   |
   |
   = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:/opt/homebrew/opt/ruby@3.0/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-exported_symbols_list" "-Wl,/var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/rustclDu9Z6/list" "/var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/rustclDu9Z6/symbols.o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/traits/const-traits/effects/minicore-works/auxiliary/minicore.minicore.356631b40ca0b657-cgu.0.rcgu.o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/traits/const-traits/effects/minicore-works/auxiliary/minicore.0lca3mr32tz9pvmmfm5apoe3h.rcgu.rmeta" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/traits/const-traits/effects/minicore-works/auxiliary" "-o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/traits/const-traits/effects/minicore-works/auxiliary/libminicore.dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-install_name" "-Wl,@rpath/libminicore.dylib" "-nodefaultlibs"
   = note: Undefined symbols for architecture arm64:
             "dyld_stub_binder", referenced from:
                 <initial-undefines>
           ld: symbol(s) not found for architecture arm64
           clang: error: linker command failed with exit code 1 (use -v to see invocation)

@bors r-

Uh can we get a doctor orchard farmer in the house?

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 3, 2024
@compiler-errors
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 3, 2024
Register `~const` preds for `Deref` adjustments in HIR typeck

This doesn't *do* anything yet, since `Deref` and `DerefMut` aren't constified, and we explicitly don't error on calling non-const trait methods in HIR yet -- presumably that will wait until std is re-constified. But I'm confident this logic is correct, and this (afaict?) is the only major hole left in enforcing `~const` in HIR typeck.

r? fee1-dead

try-job: aarch64-apple
@bors
Copy link
Contributor

bors commented Nov 3, 2024

⌛ Trying commit b9bab18 with merge 62916d6...

@bors
Copy link
Contributor

bors commented Nov 3, 2024

☀️ Try build successful - checks-actions
Build commit: 62916d6 (62916d6637a8068fbbe09d7733d71c845b998511)

@compiler-errors
Copy link
Member Author

cool, looks like i was just missing a no-prefer-dynamic on the minicore.

@compiler-errors
Copy link
Member Author

Rebased due to #132479.

@bors r=fee1-dead

@bors
Copy link
Contributor

bors commented Nov 4, 2024

📌 Commit d860c8b has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 4, 2024
@workingjubilee
Copy link
Member

@bors rollup=maybe

@compiler-errors
Copy link
Member Author

:( looks like there's still a conflict

@compiler-errors
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 4, 2024
@bors
Copy link
Contributor

bors commented Nov 4, 2024

☔ The latest upstream changes (presumably #132581) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member Author

re-rebased

@bors r=fee1-dead

@bors
Copy link
Contributor

bors commented Nov 4, 2024

📌 Commit e3bd6b2 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 4, 2024
@bors
Copy link
Contributor

bors commented Nov 4, 2024

⌛ Testing commit e3bd6b2 with merge 432972c...

@bors
Copy link
Contributor

bors commented Nov 4, 2024

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing 432972c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 4, 2024
@bors bors merged commit 432972c into rust-lang:master Nov 4, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 4, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (432972c): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -2.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 779.908s -> 777.534s (-0.30%)
Artifact size: 335.29 MiB -> 335.28 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants