]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/stability-attribute/missing-const-stability.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / stability-attribute / missing-const-stability.rs
index 57e64737d0faa53ae4f203234006c37f9761ab9b..d89886af314a4c91db909388439e90d0d7450b6f 100644 (file)
@@ -18,9 +18,15 @@ impl Foo {
     pub const fn bar() {} // ok because function is unstable
 }
 
-// FIXME Once #![feature(const_trait_impl)] is allowed to be stable, add a test
-// for const trait impls. Right now, a "trait methods cannot be stable const fn"
-// error is emitted. This occurs prior to the lint being tested here, such that
-// the lint cannot currently be tested on this use case.
+#[stable(feature = "stable", since = "1.0.0")]
+pub trait Bar {
+    #[stable(feature = "stable", since = "1.0.0")]
+    fn fun();
+}
+#[stable(feature = "stable", since = "1.0.0")]
+impl const Bar for Foo {
+    //~^ ERROR implementation has missing const stability attribute
+    fn fun() {}
+}
 
 fn main() {}