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

correctly lower impl const to bind to host effect param #114545

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

fee1-dead
Copy link
Member

@fee1-dead fee1-dead commented Aug 6, 2023

@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 Aug 6, 2023
@fee1-dead fee1-dead changed the title correctly impl const to bind to host effect param correctly lower impl const to bind to host effect param Aug 6, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

if !infer_args && has_default {
if !infer_args
&& has_default
&& !tcx.has_attr(param.def_id, sym::rustc_host)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work for desugared params?

Copy link
Member Author

Choose a reason for hiding this comment

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

desugared params get this attribute as well: link

@oli-obk
Copy link
Contributor

oli-obk commented Aug 6, 2023

r=me with tidy happy

@fee1-dead
Copy link
Member Author

r=me with tidy happy

a review of this commit which fixes the ICE would be nice

let mut path_segments = ast_trait_ref.path.segments.to_vec();
let last_segment = path_segments.len() - 1;
let mut args = path_segments[last_segment].args().clone();
args.args = &args.args[..args.args.len() - 1];
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe assert that you are actually removing the host param, and not something else that snuck in

Copy link
Member Author

Choose a reason for hiding this comment

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

This turns out to be a bit more complicated and I didn't want to look inside bodies, so I just added the attr to all automatically generated bodies and asserted that the attr exists instead.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 7, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Aug 7, 2023

📌 Commit 057be38 has been approved by oli-obk

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 Aug 7, 2023
@bors
Copy link
Contributor

bors commented Aug 8, 2023

⌛ Testing commit 057be38 with merge 6069c503450c448e96bd0ebbd98fcfb5087b3304...

@bors
Copy link
Contributor

bors commented Aug 8, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 8, 2023
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#11 8.895 
#11 8.895 gzip: stdin: unexpected end of file
#11 8.896 tar: Child returned status 1
#11 8.896 tar: Error is not recoverable: exiting now
#11 ERROR: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
 > [6/8] RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh:
0.296 + mkdir netbsd

 97  197M   97  193M    0     0  22.4M      0  0:00:08  0:00:08 --:--:-- 25.2M
---
8.896 tar: Error is not recoverable: exiting now
------
Dockerfile:11
--------------------
   9 |     # GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
  10 |     # /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
  11 | >>> RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
  13 |     COPY scripts/sccache.sh /scripts/
--------------------
--------------------
ERROR: failed to solve: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
---
#10 9.062 
#10 9.062 gzip: stdin: unexpected end of file
#10 9.063 tar: Child returned status 1
#10 9.063 tar: Error is not recoverable: exiting now
#10 ERROR: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
 > [6/8] RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh:
0.268 + mkdir netbsd

 97  197M   97  192M    0     0  21.9M      0  0:00:08  0:00:08 --:--:-- 24.1M
---
9.063 tar: Error is not recoverable: exiting now
------
Dockerfile:11
--------------------
   9 |     # GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
  10 |     # /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
  11 | >>> RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
  13 |     COPY scripts/sccache.sh /scripts/
--------------------
--------------------
ERROR: failed to solve: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
---
#10 9.360 
#10 9.360 gzip: stdin: unexpected end of file
#10 9.361 tar: Child returned status 1
#10 9.361 tar: Error is not recoverable: exiting now
#10 ERROR: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
 > [6/8] RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh:
0.245 + mkdir netbsd

 97  197M   97  192M    0     0  21.1M      0  0:00:09  0:00:09 --:--:-- 24.2M
---
9.361 tar: Error is not recoverable: exiting now
------
Dockerfile:11
--------------------
   9 |     # GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
  10 |     # /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
  11 | >>> RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
  13 |     COPY scripts/sccache.sh /scripts/
--------------------
--------------------
ERROR: failed to solve: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
---
#10 8.558 
#10 8.558 gzip: stdin: unexpected end of file
#10 8.559 tar: Child returned status 1
#10 8.560 tar: Error is not recoverable: exiting now
#10 ERROR: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
 > [6/8] RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh:
0.279 + mkdir netbsd

 97  197M   97  193M    0     0  23.3M      0  0:00:08  0:00:08 --:--:-- 24.7M
---
8.560 tar: Error is not recoverable: exiting now
------
Dockerfile:11
--------------------
   9 |     # GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
  10 |     # /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
  11 | >>> RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
  13 |     COPY scripts/sccache.sh /scripts/
--------------------
--------------------
ERROR: failed to solve: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 2B done
---
#10 9.083 
#10 9.083 gzip: stdin: unexpected end of file
#10 9.084 tar: Child returned status 1
#10 9.084 tar: Error is not recoverable: exiting now
#10 ERROR: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
 > [6/8] RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh:
0.276 + mkdir netbsd

 97  197M   97  193M    0     0  21.9M      0  0:00:09  0:00:08  0:00:01 23.2M
---
9.084 tar: Error is not recoverable: exiting now
------
Dockerfile:11
--------------------
   9 |     # GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
  10 |     # /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
  11 | >>> RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
  13 |     COPY scripts/sccache.sh /scripts/
--------------------
--------------------
ERROR: failed to solve: process "/bin/sh -c env HOST_CFLAGS=\"-O -fcommon\" /tmp/build-netbsd-toolchain.sh" did not complete successfully: exit code: 2
##[error]Process completed with exit code 1.
Post job cleanup.

@fee1-dead
Copy link
Member Author

spurious

@bors retry

@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 Aug 8, 2023
@bors
Copy link
Contributor

bors commented Aug 8, 2023

⌛ Testing commit 057be38 with merge f88a8b7...

@bors
Copy link
Contributor

bors commented Aug 8, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing f88a8b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 8, 2023
@bors bors merged commit f88a8b7 into rust-lang:master Aug 8, 2023
12 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 8, 2023
@fee1-dead fee1-dead deleted the lower-impl-effect branch August 9, 2023 01:56
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f88a8b7): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

Results

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)
2.4% [2.4%, 2.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.9%, -3.2%] 2
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: 632.146s -> 632.905s (0.12%)

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. PG-const-traits Project group: Const traits 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.

6 participants