-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #88080 - fee1-dead:iterator-const, r=oli-obk
Skip assert ICE with default_method_body_is_const functions marked with #[default_method_body_is_const] would ICE when being const checked due to it not being a const function: `tcx.is_const_fn_raw(did)` returns false. We should skip this assert when it is marked with that attribute. r? `@oli-obk`
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// check-pass | ||
|
||
// This was an ICE, because the compiler ensures the | ||
// function to be const when performing const checking, | ||
// but functions marked with the attribute are not const | ||
// *and* subject to const checking. | ||
|
||
#![feature(staged_api)] | ||
#![feature(const_trait_impl)] | ||
#![feature(const_fn_trait_bound)] | ||
#![stable(since = "1", feature = "foo")] | ||
|
||
trait Tr { | ||
#[default_method_body_is_const] | ||
fn a() {} | ||
} | ||
|
||
fn main() {} |