diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-08-16 14:46:08 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-08-16 15:15:28 +0000 |
| commit | 85abdf07578f14b9c07b3aed9f6b23b1bbf23f8f (patch) | |
| tree | 47724fbf2dcb7f6408c1418a414ecbe8199172b7 | |
| parent | ee85704c0434e8453ee7d1113012331387cb6ee0 (diff) | |
| download | rust-85abdf07578f14b9c07b3aed9f6b23b1bbf23f8f.tar.gz rust-85abdf07578f14b9c07b3aed9f6b23b1bbf23f8f.zip | |
Add ui test
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs new file mode 100644 index 00000000000..d5b1a9073ac --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs @@ -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() {} |
