implementing fallible allocation API (try_reserve) for Vec, String and HashMap
This commit is contained in:
parent
fab632f975
commit
92bfcd2b19
16 changed files with 1056 additions and 72 deletions
14
src/test/ui/feature-gate-try_reserve.rs
Normal file
14
src/test/ui/feature-gate-try_reserve.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2016 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 main() {
|
||||
let v = Vec::new();
|
||||
v.try_reserve(10); //~ ERROR: use of unstable library feature 'try_reserve'
|
||||
}
|
||||
11
src/test/ui/feature-gate-try_reserve.stderr
Normal file
11
src/test/ui/feature-gate-try_reserve.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
error[E0658]: use of unstable library feature 'try_reserve': new API (see issue #48043)
|
||||
--> $DIR/feature-gate-try_reserve.rs:13:7
|
||||
|
|
||||
LL | v.try_reserve(10); //~ ERROR: use of unstable library feature 'try_reserve'
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(try_reserve)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
If you want more information on this error, try using "rustc --explain E0658"
|
||||
Loading…
Add table
Add a link
Reference in a new issue