1
Fork 0

tests: replace "lvalue" terminology with "place".

This commit is contained in:
Eduard-Mihai Burtescu 2018-01-29 01:59:34 +02:00
parent 46a9bdda78
commit 6f8d263e87
9 changed files with 14 additions and 14 deletions

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // 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); struct Data(i32);

View file

@ -404,9 +404,9 @@ pub fn value_cast(a: u32) -> i32 {
// Change l-value in assignment ------------------------------------------------ // Change place in assignment --------------------------------------------------
#[cfg(cfail1)] #[cfg(cfail1)]
pub fn lvalue() -> i32 { pub fn place() -> i32 {
let mut x = 10; let mut x = 10;
let mut y = 11; let mut y = 11;
x = 9; x = 9;
@ -416,7 +416,7 @@ pub fn lvalue() -> i32 {
#[cfg(not(cfail1))] #[cfg(not(cfail1))]
#[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")] #[rustc_clean(except="HirBody,MirOptimized,MirValidated", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")] #[rustc_clean(cfg="cfail3")]
pub fn lvalue() -> i32 { pub fn place() -> i32 {
let mut x = 10; let mut x = 10;
let mut y = 11; let mut y = 11;
y = 9; y = 9;

View file

@ -10,7 +10,7 @@
// Test that we don't ICE when translating a generic impl method from // Test that we don't ICE when translating a generic impl method from
// an extern crate that contains a match expression on a local // 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 // expression that autoderefs through an overloaded generic deref
// impl. // impl.

View file

@ -11,7 +11,7 @@
// This used to generate invalid IR in that even if we took the // 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 // `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 // 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 { fn test(foo: bool) -> u8 {
match foo { match foo {

View file

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// Test that an `&mut self` method, when invoked on an lvalue whose // Test that an `&mut self` method, when invoked on a place whose
// type is `&mut [u8]`, passes in a pointer to the lvalue and not a // type is `&mut [u8]`, passes in a pointer to the place and not a
// temporary. Issue #19147. // temporary. Issue #19147.
use std::slice; use std::slice;

View file

@ -41,7 +41,7 @@ fn main() {
// all borrows are extended - nothing has been dropped yet // all borrows are extended - nothing has been dropped yet
assert_eq!(get(), vec![]); 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 // *after* the let result (tho they have the same scope
// as far as scope-based borrowck goes). // as far as scope-based borrowck goes).
assert_eq!(get(), vec![0, 2, 3, 1]); assert_eq!(get(), vec![0, 2, 3, 1]);

View file

@ -40,6 +40,6 @@ fn main() {
assert_eq!(b, 1: u16); assert_eq!(b, 1: u16);
let mut v = Vec::new(); 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]); assert_eq!(v, [1u8, 2, 3]);
} }

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
macro_rules! not_an_lvalue { macro_rules! not_a_place {
($thing:expr) => { ($thing:expr) => {
$thing = 42; $thing = 42;
//~^ ERROR invalid left-hand side expression //~^ ERROR invalid left-hand side expression
@ -16,5 +16,5 @@ macro_rules! not_an_lvalue {
} }
fn main() { fn main() {
not_an_lvalue!(99); not_a_place!(99);
} }

View file

@ -4,8 +4,8 @@ error[E0070]: invalid left-hand side expression
13 | $thing = 42; 13 | $thing = 42;
| ^^^^^^^^^^^ left-hand of expression not valid | ^^^^^^^^^^^ left-hand of expression not valid
... ...
19 | not_an_lvalue!(99); 19 | not_a_place!(99);
| ------------------- in this macro invocation | ----------------- in this macro invocation
error: aborting due to previous error error: aborting due to previous error