rust/compiler
Matthias Krüger cc043aa75f
Rollup merge of #92037 - fee1-dead:fix_env_dmbic, r=oli-obk
Use a const ParamEnv when in default_method_body_is_const

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](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=12dc6681b2eeee5f604203d96259eeb4))

```rust
#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]

trait Tr {}
impl Tr for () {}

const fn foo<T>() where T: ~const Tr {}

pub trait Foo {
    #[default_method_body_is_const]
    fn foo() {
        foo::<()>();
    }
}
```
2021-12-18 14:49:42 +01:00
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_arena Add some comments. 2021-11-19 07:52:59 +11:00
rustc_ast Auto merge of #91945 - matthiaskrgr:rollup-jszf9zp, r=matthiaskrgr 2021-12-15 03:28:55 +00:00
rustc_ast_lowering Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726 2021-12-18 08:16:26 +01:00
rustc_ast_passes Stabilize destructuring_assignment 2021-12-14 22:38:51 -05:00
rustc_ast_pretty Rollup merge of #91625 - est31:remove_indexes, r=oli-obk 2021-12-10 22:40:36 +01:00
rustc_attr re-format with new rustfmt 2021-11-30 13:08:41 -05:00
rustc_borrowck get_mut_span_in_struct_field uses span.between 2021-12-18 13:00:08 +11:00
rustc_builtin_macros Rollup merge of #92016 - calebcartwright:expose-asm-args-parsing, r=Amanieu 2021-12-18 08:16:31 +01:00
rustc_codegen_cranelift Rollup merge of #91868 - tmiasko:llvm-time-trace-out, r=oli-obk 2021-12-15 01:28:06 +01:00
rustc_codegen_gcc Rollup merge of #91868 - tmiasko:llvm-time-trace-out, r=oli-obk 2021-12-15 01:28:06 +01:00
rustc_codegen_llvm Rollup merge of #92024 - pcwalton:per-codegen-unit-names, r=davidtwco 2021-12-18 14:49:41 +01:00
rustc_codegen_ssa Rollup merge of #91566 - cbeuw:remap-dwo-name, r=davidtwco 2021-12-18 14:49:38 +01:00
rustc_const_eval miri: lift restriction on extern types being the only field in a struct 2021-12-15 23:44:51 +01:00
rustc_data_structures Auto merge of #91549 - fee1-dead:const_env, r=spastorino 2021-12-12 22:15:32 +00:00
rustc_driver fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_error_codes Clarify and tidy up explanation of E0038 2021-11-30 09:25:17 -08:00
rustc_errors Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_expand Rollup merge of #90521 - jhpratt:stabilize-destructuring_assignment, r=jackh726,pnkfelix 2021-12-15 08:36:19 +01:00
rustc_feature Stabilize destructuring_assignment 2021-12-14 22:38:51 -05:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_hir Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
rustc_hir_pretty Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
rustc_incremental Rollup merge of #91625 - est31:remove_indexes, r=oli-obk 2021-12-10 22:40:36 +01:00
rustc_index Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_infer Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_interface Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514 2021-12-15 10:56:58 +01:00
rustc_lexer Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
rustc_lint Rollup merge of #91818 - camelid:unused-result-type, r=jackh726 2021-12-18 08:16:27 +01:00
rustc_lint_defs Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726 2021-12-18 08:16:26 +01:00
rustc_llvm Auto merge of #91284 - t6:freebsd-riscv64, r=Amanieu 2021-12-06 03:51:05 +00:00
rustc_macros Query modifier 2021-12-12 12:35:00 +08:00
rustc_metadata Rollup merge of #91926 - SylvanB:remove_in_band_lifetimes_from_rustc_metadata, r=nagisa 2021-12-18 14:49:39 +01:00
rustc_middle Add a temporary hack before env fix lands in bootstrap 2021-12-17 20:46:48 +08:00
rustc_mir_build Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
rustc_mir_dataflow Remove in_band_lifetimes from rustc_mir_dataflow 2021-12-16 14:29:43 -05:00
rustc_mir_transform Rollup merge of #91975 - cjgillot:noinline-generator, r=jackh726 2021-12-18 08:16:30 +01:00
rustc_monomorphize Rollup merge of #90701 - michaelwoerister:more-artifact-sizes, r=davidtwco 2021-11-09 19:00:45 +01:00
rustc_parse Rollup merge of #87901 - poliorcetics:pub-pub-pub, r=jackh726 2021-12-18 08:16:25 +01:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Rollup merge of #91896 - pitaj:91867-passes, r=michaelwoerister 2021-12-18 10:26:36 +01:00
rustc_plugin_impl replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy Take a LocalDefId in expect_*item. 2021-11-28 21:09:45 +01:00
rustc_query_impl Query modifier 2021-12-12 12:35:00 +08:00
rustc_query_system Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_resolve Auto merge of #89836 - pierwill:fix-85142-crate-hash, r=wesleywiser 2021-12-16 02:21:30 +00:00
rustc_save_analysis Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514 2021-12-15 10:56:58 +01:00
rustc_serialize Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkov 2021-12-13 07:30:38 +00:00
rustc_session fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_span Auto merge of #89836 - pierwill:fix-85142-crate-hash, r=wesleywiser 2021-12-16 02:21:30 +00:00
rustc_symbol_mangling Remove in_band_lifetimes from rustc_symbol_mangling 2021-12-15 22:02:25 +00:00
rustc_target Revert "Set MACOSX_DEPLOYMENT_TARGET env var to default for linking if not set." 2021-12-13 21:31:48 +01:00
rustc_trait_selection Rollup merge of #91904 - SylvanB:remove_in_band_lifetimes_rustc_trait_selection, r=petrochenkov 2021-12-16 10:12:42 +01:00
rustc_traits get rid of normalize_generic_arg... queries 2021-12-13 23:05:25 +01:00
rustc_ty_utils Use a const ParamEnv when in default_method_body_is_const 2021-12-17 20:42:48 +08:00
rustc_type_ir Fix HashStable implementation on InferTy 2021-12-13 20:36:17 -08:00
rustc_typeck Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726 2021-12-18 08:16:26 +01:00