Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
58e901b6fd1163172149fd422565523b17eed5f0
rust/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
221 B
Rust
Raw Normal View History

const fn: allow use of trait impls from bounds
2020-11-22 04:19:46 +01:00
// check-pass
struct S;
impl PartialEq for S {
fn eq(&self, _: &S) -> bool {
true
}
}
Introduce `~const` - [x] Removed `?const` and change uses of `?const` - [x] Added `~const` to the AST. It is gated behind const_trait_impl. - [x] Validate `~const` in ast_validation. - [ ] Add enum `BoundConstness` to the HIR. (With variants `NotConst` and `ConstIfConst` allowing future extensions) - [ ] Adjust trait selection and pre-existing code to use `BoundConstness`. - [ ] Optional steps (*for this PR, obviously*) - [ ] Fix #88155 - [ ] Do something with constness bounds in chalk
2021-08-25 11:53:16 +00:00
const fn equals_self<T: PartialEq>(t: &T) -> bool {
const fn: allow use of trait impls from bounds
2020-11-22 04:19:46 +01:00
true
}
pub const EQ: bool = equals_self(&S);
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1771ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API