Skip to content

Commit

Permalink
tests: replace "lvalue" terminology with "place".
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jan 29, 2018
1 parent 46a9bdd commit 6f8d263
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/test/compile-fail/regions-adjusted-lvalue-op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/test/incremental/hashes/unary_and_binary_exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-18514.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-18845.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/mir_drop_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/type-ascription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
4 changes: 2 additions & 2 deletions src/test/ui/issue-26093.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
// 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
}
}

fn main() {
not_an_lvalue!(99);
not_a_place!(99);
}
4 changes: 2 additions & 2 deletions src/test/ui/issue-26093.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6f8d263

Please sign in to comment.