tests: replace "lvalue" terminology with "place".
This commit is contained in:
parent
46a9bdda78
commit
6f8d263e87
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// check that we link regions in mutable lvalue ops correctly - issue #41774
|
||||
// check that we link regions in mutable place ops correctly - issue #41774
|
||||
|
||||
struct Data(i32);
|
||||
|
||||
|
@ -404,9 +404,9 @@ pub fn value_cast(a: u32) -> i32 {
|
||||
|
||||
|
||||
|
||||
// Change l-value in assignment ------------------------------------------------
|
||||
// Change place in assignment --------------------------------------------------
|
||||
#[cfg(cfail1)]
|
||||
pub fn lvalue() -> i32 {
|
||||
pub fn place() -> i32 {
|
||||
let mut x = 10;
|
||||
let mut y = 11;
|
||||
x = 9;
|
||||
@ -416,7 +416,7 @@ pub fn lvalue() -> i32 {
|
||||
#[cfg(not(cfail1))]
|
||||
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
|
||||
#[rustc_clean(cfg="cfail3")]
|
||||
pub fn lvalue() -> i32 {
|
||||
pub fn place() -> i32 {
|
||||
let mut x = 10;
|
||||
let mut y = 11;
|
||||
y = 9;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Test that we don't ICE when translating a generic impl method from
|
||||
// an extern crate that contains a match expression on a local
|
||||
// variable lvalue where one of the match case bodies contains an
|
||||
// variable place where one of the match case bodies contains an
|
||||
// expression that autoderefs through an overloaded generic deref
|
||||
// impl.
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
// This used to generate invalid IR in that even if we took the
|
||||
// `false` branch we'd still try to free the Box from the other
|
||||
// arm. This was due to treating `*Box::new(9)` as an rvalue datum
|
||||
// instead of as an lvalue.
|
||||
// instead of as a place.
|
||||
|
||||
fn test(foo: bool) -> u8 {
|
||||
match foo {
|
||||
|
@ -8,8 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that an `&mut self` method, when invoked on an lvalue whose
|
||||
// type is `&mut [u8]`, passes in a pointer to the lvalue and not a
|
||||
// Test that an `&mut self` method, when invoked on a place whose
|
||||
// type is `&mut [u8]`, passes in a pointer to the place and not a
|
||||
// temporary. Issue #19147.
|
||||
|
||||
use std::slice;
|
||||
|
@ -41,7 +41,7 @@ fn main() {
|
||||
// all borrows are extended - nothing has been dropped yet
|
||||
assert_eq!(get(), vec![]);
|
||||
}
|
||||
// in a let-statement, extended lvalues are dropped
|
||||
// in a let-statement, extended places are dropped
|
||||
// *after* the let result (tho they have the same scope
|
||||
// as far as scope-based borrowck goes).
|
||||
assert_eq!(get(), vec![0, 2, 3, 1]);
|
||||
|
@ -40,6 +40,6 @@ fn main() {
|
||||
assert_eq!(b, 1: u16);
|
||||
|
||||
let mut v = Vec::new();
|
||||
v: Vec<u8> = vec![1, 2, 3]; // Lvalue type ascription
|
||||
v: Vec<u8> = vec![1, 2, 3]; // Place expression type ascription
|
||||
assert_eq!(v, [1u8, 2, 3]);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
macro_rules! not_an_lvalue {
|
||||
macro_rules! not_a_place {
|
||||
($thing:expr) => {
|
||||
$thing = 42;
|
||||
//~^ ERROR invalid left-hand side expression
|
||||
@ -16,5 +16,5 @@ macro_rules! not_an_lvalue {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
not_an_lvalue!(99);
|
||||
not_a_place!(99);
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ error[E0070]: invalid left-hand side expression
|
||||
13 | $thing = 42;
|
||||
| ^^^^^^^^^^^ left-hand of expression not valid
|
||||
...
|
||||
19 | not_an_lvalue!(99);
|
||||
| ------------------- in this macro invocation
|
||||
19 | not_a_place!(99);
|
||||
| ----------------- in this macro invocation
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user