Add #![feature(unsized_locals)].
This commit is contained in:
parent
cd0476a390
commit
7f05304068
3 changed files with 31 additions and 0 deletions
|
@ -503,6 +503,9 @@ declare_features! (
|
|||
|
||||
// Allows `Self` in type definitions
|
||||
(active, self_in_typedefs, "1.30.0", Some(49303), None),
|
||||
|
||||
// unsized rvalues at arguments and parameters
|
||||
(active, unsized_locals, "1.30.0", Some(48055), None),
|
||||
);
|
||||
|
||||
declare_features! (
|
||||
|
|
15
src/test/ui/feature-gate-unsized_locals.rs
Normal file
15
src/test/ui/feature-gate-unsized_locals.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn f(f: FnOnce()) {}
|
||||
//~^ ERROR E0277
|
||||
|
||||
fn main() {
|
||||
}
|
13
src/test/ui/feature-gate-unsized_locals.stderr
Normal file
13
src/test/ui/feature-gate-unsized_locals.stderr
Normal file
|
@ -0,0 +1,13 @@
|
|||
error[E0277]: the size for values of type `(dyn std::ops::FnOnce() + 'static)` cannot be known at compilation time
|
||||
--> $DIR/feature-gate-unsized_locals.rs:11:6
|
||||
|
|
||||
LL | fn f(f: FnOnce()) {}
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::FnOnce() + 'static)`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= note: all local variables must have a statically known size
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
Loading…
Add table
Reference in a new issue