Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Syntax 什么是<;-生锈的符号?_Syntax_Rust_Operators_Placement New - Fatal编程技术网

Syntax 什么是<;-生锈的符号?

Syntax 什么是<;-生锈的符号?,syntax,rust,operators,placement-new,Syntax,Rust,Operators,Placement New,什么是这个看起来像是新的被废弃了。。。所以现在它什么也不做?使用它会产生这样的错误:error[E0658]:表达式语法中的位置是实验性的,可能会发生变化。(见第27779期)。如果获得批准,它将像这样使用:let v=Vec::new();//v.back(){10};//中的旧语法新语法。v、 back()@turbulencetoo请注意链接的位置。这是官方RFCs回购协议的一个分支,而不是官方回购协议本身。包含更新,例如此RFC未被接受的事实。值得注意的是,这些RFC最初是被接受的(因此

什么是
这个
看起来像是新的被废弃了。。。所以现在它什么也不做?使用它会产生这样的错误:
error[E0658]:表达式语法中的位置是实验性的,可能会发生变化。(见第27779期)
。如果获得批准,它将像这样使用:
let v=Vec::new();//v.back(){10};//中的旧语法新语法。v、 back()@turbulencetoo请注意链接的位置。这是官方RFCs回购协议的一个分支,而不是官方回购协议本身。包含更新,例如此RFC未被接受的事实。值得注意的是,这些RFC最初是被接受的(因此,它们为什么在夜间半实施),这是由于各种可靠性问题。很可能必须提交一份全新的RFC才能进行申报<代码>框
语法仍然存在,因为编译器本身大量使用它。
// For comparison, a "normal new", allocating on the heap
string *foo = new string("foo");

// Allocate a buffer
char *buffer = new char[100];
// Allocate a new string starting at the beginning of the buffer 
string *bar = new (buffer) string("bar");
// Memory allocated on heap (with temporary stack allocation in the process)
let foo = Box::new(*b"foo"); 
// Or, without the stack allocation, when box syntax stabilises:
let foo = box *b"foo";

// Allocate a buffer
let mut buffer = box [0u8; 100];
// Allocate a new bytestring starting at the beginning of the buffer 
let bar = buffer[0..3] <- b"bar";
// Note that b"bar" is allocated first on the stack before being copied
// into the buffer
buffer[0..3].clone_from_slice(&b"bar"[0..3]);
let bar = &buffer[0..3];