Skip to content

Use a const ParamEnv when in default_method_body_is_const - #92037

Merged
bors merged 1 commit into
rust-lang:masterfrom
fee1-dead-contrib:fix_env_dmbic
Dec 18, 2021
Merged

Use a const ParamEnv when in default_method_body_is_const#92037
bors merged 1 commit into
rust-lang:masterfrom
fee1-dead-contrib:fix_env_dmbic

Conversation

@fee1-dead

Copy link
Copy Markdown
Member

r? @oli-obk

This PR fixes the param_env function to return constness: Const correctly for trait methods marked with #[default_method_body_is_const]. The snippet below is erroneously accepted by the compiler and has been fixed by this change. (Playground)

#![feature(const_fn_trait_bound)]#![feature(const_trait_impl)]traitTr{}implTrfor(){}constfnfoo<T>()whereT: ~constTr{}pubtraitFoo{#[default_method_body_is_const]fnfoo(){foo::<()>();}}

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 17, 2021
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 17, 2021
@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Dec 17, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit a1f91aa has been approved by oli-obk

@borsbors 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 Dec 17, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 18, 2021
…askrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#91566 (Apply path remapping to DW_AT_GNU_dwo_name when producing split DWARF)
- rust-lang#91926 (Remove `in_band_lifetimes` from `rustc_metadata`)
- rust-lang#91931 (Remove `in_band_lifetimes` from `rustc_codegen_llvm`)
- rust-lang#92024 (rustc_codegen_llvm: Give each codegen unit a unique DWARF name on all platforms, not just Apple ones.)
- rust-lang#92037 (Use a const ParamEnv when in default_method_body_is_const)
- rust-lang#92047 (Set `RUST_BACKTRACE=0` when running location-detail tests)
- rust-lang#92050 (Add a space and 2 grave accents )
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit cc043aa into rust-lang:masterDec 18, 2021
@rustbotrustbot added this to the 1.59.0 milestone Dec 18, 2021
@fee1-deadfee1-dead added the F-const_trait_impl `#![feature(const_trait_impl)]` label Jul 20, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-const_trait_impl`#![feature(const_trait_impl)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@fee1-dead@oli-obk@bors@rust-highfive@rustbot