File tree 2 files changed +32
-0
lines changed
src/test/ui/rfc-2632-const-trait-impl
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( const_fmt_arguments_new) ]
2
+ #![ feature( const_trait_impl) ]
3
+
4
+ #[ const_trait]
5
+ trait Tr {
6
+ fn req ( & self ) ;
7
+
8
+ fn prov ( & self ) {
9
+ println ! ( "lul" ) ; //~ ERROR: cannot call non-const fn `_print` in constant functions
10
+ self . req ( ) ;
11
+ }
12
+ }
13
+
14
+ struct S ;
15
+
16
+ impl const Tr for S {
17
+ fn req ( & self ) { }
18
+ }
19
+
20
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0015]: cannot call non-const fn `_print` in constant functions
2
+ --> $DIR/issue-79450.rs:9:9
3
+ |
4
+ LL | println!("lul");
5
+ | ^^^^^^^^^^^^^^^
6
+ |
7
+ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
8
+ = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
9
+
10
+ error: aborting due to previous error
11
+
12
+ For more information about this error, try `rustc --explain E0015`.
You can’t perform that action at this time.
0 commit comments