Skip to content

Commit 13cbf33

Browse files
committed
finishing touches of the renaming
The last bits of the renaming: - rustfmted the one compiler expression that needed reflowing - blessed test expectations - updated and renamed the tests whose name referenced "metasized" - updated the one mention in the rustc-dev-guide
1 parent eefdb6d commit 13cbf33

26 files changed

Lines changed: 252 additions & 214 deletions

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
9595
let size_of_val_did = tcx.require_lang_item(LangItem::SizeOfVal, span);
9696
// Don't strip out `SizeOfVal` when the user wrote it explicitly, only when it was
9797
// elaborated
98-
if user_written_bounds
99-
.iter()
100-
.all(|(clause, _)| clause.as_trait_clause().map(|p| p.def_id()) != Some(size_of_val_did))
101-
{
98+
if user_written_bounds.iter().all(|(clause, _)| {
99+
clause.as_trait_clause().map(|p| p.def_id()) != Some(size_of_val_did)
100+
}) {
102101
elaborated_trait_bounds.retain(|(pred, _)| pred.def_id() != size_of_val_did);
103102
}
104103
debug!(?user_written_bounds, ?elaborated_trait_bounds);

src/doc/rustc-dev-guide/src/solve/candidate-preference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This document provides additional details and references to explain *why* we've
1717

1818
Trivial builtin impls are builtin impls which are known to be always applicable for well-formed types.
1919
This means that if one exists, using another candidate should never have fewer constraints.
20-
We currently only consider `Sized` - and `MetaSized` - impls to be trivial.
20+
We currently only consider `Sized` - and `SizeOfVal` - impls to be trivial.
2121

2222
This is necessary to prevent a lifetime error for the following pattern
2323

tests/ui/attributes/dump-preds.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: rustc_dump_predicates
44
LL | trait Trait<T>: Iterator<Item: Copy>
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
7+
= note: Binder { value: TraitPredicate(<Self as std::marker::SizeOfVal>, polarity:Positive), bound_vars: [] }
88
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
99
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
1010
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
@@ -17,7 +17,7 @@ error: rustc_dump_predicates
1717
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
|
20-
= note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
20+
= note: Binder { value: TraitPredicate(<Self as std::marker::SizeOfVal>, polarity:Positive), bound_vars: [] }
2121
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
2222
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
2323
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }

tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ error[E0277]: the size for values of type `Opaque` cannot be known
22
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:10:43
33
|
44
LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) };
5-
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Opaque`
5+
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Opaque`
66
| |
77
| required by a bound introduced by this call
88
|
9-
= note: the trait bound `Opaque: MetaSized` is not satisfied
9+
= note: the trait bound `Opaque: SizeOfVal` is not satisfied
1010
note: required by a bound in `std::intrinsics::size_of_val`
1111
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
1212
help: consider borrowing here
@@ -20,11 +20,11 @@ error[E0277]: the size for values of type `Opaque` cannot be known
2020
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:12:45
2121
|
2222
LL | const _ALIGN: usize = unsafe { align_of_val(&4 as *const i32 as *const Opaque) };
23-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Opaque`
23+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Opaque`
2424
| |
2525
| required by a bound introduced by this call
2626
|
27-
= note: the trait bound `Opaque: MetaSized` is not satisfied
27+
= note: the trait bound `Opaque: SizeOfVal` is not satisfied
2828
note: required by a bound in `std::intrinsics::align_of_val`
2929
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
3030
help: consider borrowing here

tests/ui/dyn-compatibility/pointeesized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-pass
2-
//! This test and `sized-*.rs` and `metasized.rs` test that dyn-compatibility correctly
2+
//! This test and `sized-*.rs` and `sizeofval.rs` test that dyn-compatibility correctly
33
//! handles sizedness traits, which are special in several parts of the compiler.
44
#![feature(sized_hierarchy)]
55
// PointeeSized is effectively removed before reaching the trait solver,

tests/ui/dyn-compatibility/sized-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! This test and `metasized.rs` and `pointeesized.rs` test that dyn-compatibility correctly
1+
//! This test and `sizeofval.rs` and `pointeesized.rs` test that dyn-compatibility correctly
22
//! handles the different sizedness traits, which are special in several parts of the compiler.
33
44
trait Foo: std::fmt::Debug + Sized {}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
//! This test and `sized-*.rs` and `pointeesized.rs` test that dyn-compatibility correctly
33
//! handles sizedness traits, which are special in several parts of the compiler.
44
#![feature(sized_hierarchy)]
5-
use std::marker::MetaSized;
5+
use std::marker::SizeOfVal;
66

7-
trait Foo: std::fmt::Debug + MetaSized {}
7+
trait Foo: std::fmt::Debug + SizeOfVal {}
88

9-
impl<T: std::fmt::Debug + MetaSized> Foo for T {}
9+
impl<T: std::fmt::Debug + SizeOfVal> Foo for T {}
1010

11-
fn unsize_sized<T: 'static>(x: Box<T>) -> Box<dyn MetaSized> {
11+
fn unsize_sized<T: 'static>(x: Box<T>) -> Box<dyn SizeOfVal> {
1212
x
1313
}
1414

15-
fn unsize_subtrait(x: Box<dyn Foo>) -> Box<dyn MetaSized> {
15+
fn unsize_subtrait(x: Box<dyn Foo>) -> Box<dyn SizeOfVal> {
1616
x
1717
}
1818

tests/ui/extern/extern-types-size_of_val.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ error[E0277]: the size for values of type `A` cannot be known
22
--> $DIR/extern-types-size_of_val.rs:14:17
33
|
44
LL | size_of_val(x);
5-
| ----------- ^ the trait `MetaSized` is not implemented for `A`
5+
| ----------- ^ the trait `SizeOfVal` is not implemented for `A`
66
| |
77
| required by a bound introduced by this call
88
|
9-
= note: the trait bound `A: MetaSized` is not satisfied
9+
= note: the trait bound `A: SizeOfVal` is not satisfied
1010
note: required by a bound in `std::mem::size_of_val`
1111
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
1212
help: consider borrowing here
@@ -20,11 +20,11 @@ error[E0277]: the size for values of type `A` cannot be known
2020
--> $DIR/extern-types-size_of_val.rs:16:18
2121
|
2222
LL | align_of_val(x);
23-
| ------------ ^ the trait `MetaSized` is not implemented for `A`
23+
| ------------ ^ the trait `SizeOfVal` is not implemented for `A`
2424
| |
2525
| required by a bound introduced by this call
2626
|
27-
= note: the trait bound `A: MetaSized` is not satisfied
27+
= note: the trait bound `A: SizeOfVal` is not satisfied
2828
note: required by a bound in `std::mem::align_of_val`
2929
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
3030
help: consider borrowing here

tests/ui/extern/extern-types-unsized.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ error[E0277]: the size for values of type `A` cannot be known
6565
LL | assert_sized::<Bar<A>>();
6666
| ^^^^^^ doesn't have a known size
6767
|
68-
= help: the nightly-only, unstable trait `MetaSized` is not implemented for `A`
68+
= help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `A`
6969
note: required by a bound in `Bar`
7070
--> $DIR/extern-types-unsized.rs:14:12
7171
|
@@ -100,7 +100,7 @@ error[E0277]: the size for values of type `A` cannot be known
100100
LL | assert_sized::<Bar<Bar<A>>>();
101101
| ^^^^^^^^^^^ doesn't have a known size
102102
|
103-
= help: the nightly-only, unstable trait `MetaSized` is not implemented for `A`
103+
= help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `A`
104104
note: required by a bound in `Bar`
105105
--> $DIR/extern-types-unsized.rs:14:12
106106
|

tests/ui/extern/unsized-extern-derefmove.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ error[E0277]: the size for values of type `Device` cannot be known
44
LL | unsafe fn make_device() -> Box<Device> {
55
| ^^^^^^^^^^^ doesn't have a known size
66
|
7-
= help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device`
7+
= help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device`
88
note: required by a bound in `Box`
99
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
1010

1111
error[E0277]: the size for values of type `Device` cannot be known
1212
--> $DIR/unsized-extern-derefmove.rs:11:19
1313
|
1414
LL | Box::from_raw(0 as *mut _)
15-
| ------------- ^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Device`
15+
| ------------- ^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Device`
1616
| |
1717
| required by a bound introduced by this call
1818
|
19-
= note: the trait bound `Device: MetaSized` is not satisfied
19+
= note: the trait bound `Device: SizeOfVal` is not satisfied
2020
note: required by a bound in `Box::<T>::from_raw`
2121
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
2222
help: consider borrowing here
@@ -32,7 +32,7 @@ error[E0277]: the size for values of type `Device` cannot be known
3232
LL | Box::from_raw(0 as *mut _)
3333
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size
3434
|
35-
= help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device`
35+
= help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device`
3636
note: required by a bound in `Box`
3737
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
3838

@@ -55,7 +55,7 @@ error[E0277]: the size for values of type `Device` cannot be known
5555
LL | let d: Device = unsafe { *make_device() };
5656
| ^^^^^^^^^^^^^ doesn't have a known size
5757
|
58-
= help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device`
58+
= help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device`
5959
note: required by a bound in `Box`
6060
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
6161

0 commit comments

Comments
 (0)