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

Migrate to numeric associated consts #72906

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Jun 2, 2020

The deprecation PR is #72885

cc #68490
cc rust-lang/rfcs#2700

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2020
@tesuji tesuji force-pushed the migrate-numeric-assoc-consts branch 2 times, most recently from ffa2681 to dda4edc Compare June 2, 2020 06:52
@tesuji tesuji marked this pull request as ready for review June 2, 2020 06:52
src/libcore/num/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/tests/ui/checked_conversions.rs Outdated Show resolved Hide resolved
src/tools/clippy/tests/ui/checked_conversions.stderr Outdated Show resolved Hide resolved
@tesuji tesuji force-pushed the migrate-numeric-assoc-consts branch 3 times, most recently from 54635e2 to 2111399 Compare June 2, 2020 08:17
@bors
Copy link
Contributor

bors commented Jun 5, 2020

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

@dtolnay dtolnay added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 8, 2020
@dtolnay
Copy link
Member

dtolnay commented Jun 8, 2020

Labeling as blocked on #72972.

@tesuji tesuji force-pushed the migrate-numeric-assoc-consts branch from 2111399 to 7647d02 Compare June 10, 2020 01:28
@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
##[section]Starting: Linux mingw-check
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 9'
Agent machine name: 'fv-az578'
Current agent version: '2.170.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200517.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200517.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.3)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/cd5c4646-1978-4a2b-ba54-1ba81af20674.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72906/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72906/merge:refs/remotes/pull/72906/merge
---
 ---> 3adb0605cc65
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 28dbc326cb7f
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 537a01811900
Successfully built 537a01811900
Successfully tagged rust-ci:latest
Built container sha256:537a018119009dc218456238dec90b5530050db1e2a1e166550c218003f6159d
---
    Checking alloc v0.0.0 (/checkout/src/liballoc)
error: this file contains an unclosed delimiter
    --> src/liballoc/rc.rs:2121:3
     |
2021 | trait RcBoxPtr<T: ?Sized> {
...
...
2030 |     fn inc_strong(&self) {
...
...
2037 |         if strong == 0 || strong == usize::MAX {
...
2040 |     }
     |     - ...as it matches this but it has different indentation
...
---

error: `self` parameter is only allowed in associated functions
    --> src/liballoc/rc.rs:2048:13
     |
2048 |     fn weak(&self) -> usize {
     |
     = note: associated functions are those in `impl` or `trait` definitions

error: `self` parameter is only allowed in associated functions
error: `self` parameter is only allowed in associated functions
    --> src/liballoc/rc.rs:2053:17
     |
2053 |     fn inc_weak(&self) {
     |
     = note: associated functions are those in `impl` or `trait` definitions

error: `self` parameter is only allowed in associated functions
error: `self` parameter is only allowed in associated functions
    --> src/liballoc/rc.rs:2066:17
     |
2066 |     fn dec_weak(&self) {
     |
     = note: associated functions are those in `impl` or `trait` definitions

error[E0401]: can't use generic parameters from outer function
---

error[E0401]: can't use generic parameters from outer function
    --> src/liballoc/rc.rs:2048:13
     |
2048 |     fn weak(&self) -> usize {
     |             |
     |             use of generic parameter from outer function
     |             can't use `Self` here


error[E0401]: can't use generic parameters from outer function
    --> src/liballoc/rc.rs:2053:17
     |
2053 |     fn inc_weak(&self) {
     |                 |
     |                 use of generic parameter from outer function
     |                 can't use `Self` here


error[E0401]: can't use generic parameters from outer function
    --> src/liballoc/rc.rs:2066:17
     |
2066 |     fn dec_weak(&self) {
     |                 |
     |                 use of generic parameter from outer function
     |                 can't use `Self` here


error[E0425]: cannot find function `data_offset` in this scope
   --> src/liballoc/rc.rs:602:26
    |
602 |             let offset = data_offset(&(*ptr).value);
    |
help: consider importing this function
    |
233 | use crate::sync::data_offset;
---
    Checking rustc-demangle v0.1.16
error[E0599]: no method named `dec_strong` found for struct `rc::Rc<T>` in the current scope
   --> src/liballoc/rc.rs:430:22
    |
285 | pub struct Rc<T: ?Sized> {
    | ------------------------ method `dec_strong` not found for this
...
430 |                 this.dec_strong();
    |                      ^^^^^^^^^^ method not found in `rc::Rc<T>`

error[E0599]: no method named `inc_weak` found for reference `&rc::Rc<T>` in the current scope
   --> src/liballoc/rc.rs:693:14
    |
693 |         this.inc_weak();
    |              ^^^^^^^^ method not found in `&rc::Rc<T>`
error[E0599]: no method named `weak` found for reference `&rc::Rc<T>` in the current scope
   --> src/liballoc/rc.rs:716:14
    |
    |
716 |         this.weak() - 1
    |              ^^^^ method not found in `&rc::Rc<T>`
error[E0599]: no method named `dec_strong` found for struct `rc::Rc<T>` in the current scope
   --> src/liballoc/rc.rs:896:22
    |
    |
285 | pub struct Rc<T: ?Sized> {
    | ------------------------ method `dec_strong` not found for this
...
896 |                 swap.dec_strong();
    |                      ^^^^^^^^^^ method not found in `rc::Rc<T>`

error[E0599]: no method named `dec_weak` found for struct `rc::Rc<T>` in the current scope
   --> src/liballoc/rc.rs:899:22
    |
285 | pub struct Rc<T: ?Sized> {
    | ------------------------ method `dec_weak` not found for this
...
899 |                 swap.dec_weak();
    |                      ^^^^^^^^ method not found in `rc::Rc<T>`
error[E0599]: no method named `dec_strong` found for mutable reference `&mut rc::Rc<T>` in the current scope
    --> src/liballoc/rc.rs:1146:18
     |
1146 |             self.dec_strong();
1146 |             self.dec_strong();
     |                  ^^^^^^^^^^ method not found in `&mut rc::Rc<T>`

error[E0599]: no method named `dec_weak` found for mutable reference `&mut rc::Rc<T>` in the current scope
    --> src/liballoc/rc.rs:1153:22
     |
1153 |                 self.dec_weak();
     |                      ^^^^^^^^ method not found in `&mut rc::Rc<T>`
error[E0599]: no method named `weak` found for mutable reference `&mut rc::Rc<T>` in the current scope
    --> src/liballoc/rc.rs:1155:25
     |
     |
1155 |                 if self.weak() == 0 {
     |                         ^^^^ method not found in `&mut rc::Rc<T>`

error[E0599]: no method named `weak` found for reference `&rc::RcBox<T>` in the current scope
    --> src/liballoc/rc.rs:1858:27
     |
1858 |                     inner.weak() - 1 // subtract the implicit weak ptr
     |                           |
     |                           field, not a method


error[E0599]: no method named `dec_weak` found for reference `&rc::RcBox<T>` in the current scope
    --> src/liballoc/rc.rs:1949:19
     |
1949 |             inner.dec_weak();
     |                   ^^^^^^^^ method not found in `&rc::RcBox<T>`

error[E0599]: no method named `weak` found for reference `&rc::RcBox<T>` in the current scope
    --> src/liballoc/rc.rs:1952:22
     |
1952 |             if inner.weak() == 0 {
     |                      |
     |                      field, not a method


error[E0599]: no method named `inc_weak` found for reference `&rc::RcBox<T>` in the current scope
    --> src/liballoc/rc.rs:1977:19
     |
1977 |             inner.inc_weak()
     |                   ^^^^^^^^ method not found in `&rc::RcBox<T>`
error: unreachable statement
    --> src/liballoc/rc.rs:2039:9
     |
2038 |             abort();
2038 |             abort();
     |             ------- any code following this expression is unreachable
2039 |         self.inner().strong.set(strong + 1);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
     = note: `-D unreachable-code` implied by `-D warnings`

error: unreachable statement
    --> src/liballoc/rc.rs:2062:9
    --> src/liballoc/rc.rs:2062:9
     |
2061 |             abort();
     |             ------- any code following this expression is unreachable
2062 |         self.inner().weak.set(weak + 1);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
    Checking panic_abort v0.0.0 (/checkout/src/libpanic_abort)
error: aborting due to 27 previous errors

Some errors have detailed explanations: E0401, E0425, E0599.
---
  local time: Wed Jun 10 01:34:15 UTC 2020
  network time: Wed, 10 Jun 2020 01:34:15 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72906/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72906/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3557) (python)
##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@tesuji tesuji force-pushed the migrate-numeric-assoc-consts branch from 7647d02 to fff822f Compare June 10, 2020 01:35
@tesuji tesuji requested a review from dtolnay June 10, 2020 01:37
@dtolnay dtolnay removed the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Jun 10, 2020
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Jun 10, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jun 10, 2020

📌 Commit fff822f has been approved by dtolnay

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 10, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 11, 2020
…, r=dtolnay

Migrate to numeric associated consts

The deprecation PR is rust-lang#72885

cc rust-lang#68490
cc rust-lang/rfcs#2700
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 12, 2020
…, r=dtolnay

Migrate to numeric associated consts

The deprecation PR is rust-lang#72885

cc rust-lang#68490
cc rust-lang/rfcs#2700
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#72906 (Migrate to numeric associated consts)
 - rust-lang#73178 (expand: More precise locations for expansion-time lints)
 - rust-lang#73225 (Allow inference regions when relating consts)
 - rust-lang#73236 (Clean up E0666 explanation)
 - rust-lang#73273 (Fix Zulip pings)

Failed merges:

r? @ghost
@bors bors merged commit c06799e into rust-lang:master Jun 12, 2020
@tesuji tesuji deleted the migrate-numeric-assoc-consts branch June 13, 2020 00:57
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 23, 2020
…, r=dtolnay

Migrate to numeric associated consts

The deprecation PR is rust-lang#72885

cc rust-lang#68490
cc rust-lang/rfcs#2700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants