Skip to content

Commit 7f05304

Browse files
committed
Add #![feature(unsized_locals)].
1 parent cd0476a commit 7f05304

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ declare_features! (
503503

504504
// Allows `Self` in type definitions
505505
(active, self_in_typedefs, "1.30.0", Some(49303), None),
506+
507+
// unsized rvalues at arguments and parameters
508+
(active, unsized_locals, "1.30.0", Some(48055), None),
506509
);
507510

508511
declare_features! (
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn f(f: FnOnce()) {}
12+
//~^ ERROR E0277
13+
14+
fn main() {
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0277]: the size for values of type `(dyn std::ops::FnOnce() + 'static)` cannot be known at compilation time
2+
--> $DIR/feature-gate-unsized_locals.rs:11:6
3+
|
4+
LL | fn f(f: FnOnce()) {}
5+
| ^ doesn't have a size known at compile-time
6+
|
7+
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::FnOnce() + 'static)`
8+
= 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>
9+
= note: all local variables must have a statically known size
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)