Skip to content

Rollup of 14 pull requests #56215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Nov 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3d33d05
We're looking at the miri memory for constants instead of their initi…
oli-obk Nov 17, 2018
ef99b57
Refactor local monomorphization logic to be easier to comprehend
oli-obk Nov 17, 2018
eb18ddd
Don't auto-inline `const fn`
oli-obk Nov 17, 2018
089a504
Encode a custom "producers" section in wasm files
alexcrichton Nov 19, 2018
6eeedbc
generator fields are not necessarily initialized
RalfJung Nov 20, 2018
033cbfe
Incorporate `dyn` into more comments and docs.
frewsxcv Nov 20, 2018
7f10777
fix comment
RalfJung Nov 20, 2018
6befe67
treat generator fields like unions
RalfJung Nov 20, 2018
682b33a
Add require_type_is_sized_deferred.
qnighy Nov 18, 2018
8b42623
Check arg/ret sizedness at ExprKind::Path.
qnighy Nov 18, 2018
8ab5be1
Add tests verifying #50940.
qnighy Nov 18, 2018
2ff6ffc
Add tests for unsized-locals functions stability.
qnighy Nov 18, 2018
c6a803a
Modify doc to reflect the unsized-locals improvement.
qnighy Nov 18, 2018
fc284c1
Stabilize macro_literal_matcher
da-x Nov 19, 2018
b8ae7b8
macro_literal_matcher: fixes per petrochenkov's review
da-x Nov 20, 2018
d4ee1c9
Fix BTreeSet and BTreeMap gdb pretty-printers
tromey Nov 21, 2018
d1cd4e8
Move a flaky process test out of libstd
alexcrichton Nov 22, 2018
b319715
Disable the self-profiler unless the `-Z self-profile` flag is set
wesleywiser Nov 22, 2018
4381772
Fix invalid panic setup message
GuillaumeGomez Nov 22, 2018
ebb1a48
Merge branch 'master' into frewsxcv-dyn
frewsxcv Nov 23, 2018
6b338e0
Suggest correct enum variant on typo
estebank Nov 25, 2018
dce1c45
[Windows] Work around non-monotonic clocks in the self-profiler
wesleywiser Nov 22, 2018
68a26ec
Stabilize the int_to_from_bytes feature
SimonSapin Nov 25, 2018
af54eb2
read_c_str should call the AllocationExtra hooks
RalfJung Nov 25, 2018
0fac350
yay for NLL
RalfJung Nov 25, 2018
a6ea01f
fix length of slice returned from read_c_str
RalfJung Nov 25, 2018
2472e83
Typo
oli-obk Nov 25, 2018
d4a78da
resolve: Prohibit relative paths in visibilities on 2018 edition
petrochenkov Oct 30, 2018
e593431
resolve: Fix bad span arithmetics in import conflict diagnostics
petrochenkov Nov 25, 2018
fe548e3
resolve: Fix some more asserts in import validation
petrochenkov Nov 25, 2018
1aa3ffa
Rollup merge of #56024 - oli-obk:const_fn_collect_inner, r=michaelwoe…
pietroalbini Nov 25, 2018
6c2513c
Rollup merge of #56045 - qnighy:additional-sizedness, r=cramertj
pietroalbini Nov 25, 2018
b16d8eb
Rollup merge of #56072 - da-x:stabilize-literal-matcher, r=petrochenkov
pietroalbini Nov 25, 2018
ab5e45a
Rollup merge of #56075 - alexcrichton:wasm-producer-section, r=estebank
pietroalbini Nov 25, 2018
45e5a85
Rollup merge of #56100 - RalfJung:visiting-generators, r=oli-obk
pietroalbini Nov 25, 2018
6398df1
Rollup merge of #56101 - frewsxcv:frewsxcv-dyn, r=steveklabnik
pietroalbini Nov 25, 2018
ed6c7b7
Rollup merge of #56144 - tromey:Bug-55771-btreemap, r=alexcrichton
pietroalbini Nov 25, 2018
989678e
Rollup merge of #56151 - alexcrichton:move-out-flaky-test, r=nagisa
pietroalbini Nov 25, 2018
e03fa3e
Rollup merge of #56170 - wesleywiser:fix_self_profiler_windows, r=est…
pietroalbini Nov 25, 2018
686257c
Rollup merge of #56176 - GuillaumeGomez:panic-setup-msg, r=nagisa
pietroalbini Nov 25, 2018
dcae83b
Rollup merge of #56204 - estebank:suggest-variant, r=zackmdavis
pietroalbini Nov 25, 2018
d21d510
Rollup merge of #56207 - SimonSapin:int_to_from_bytes, r=nagisa
pietroalbini Nov 25, 2018
baf45d6
Rollup merge of #56210 - RalfJung:c_str, r=oli-obk
pietroalbini Nov 25, 2018
cd17b1d
Rollup merge of #56211 - petrochenkov:fwd, r=petrochenkov
pietroalbini Nov 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

2 changes: 0 additions & 2 deletions src/doc/unstable-book/src/language-features/unsized-locals.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ fn main() {
}
```

However, the current implementation allows `MyTupleStruct(..)` to be unsized. This will be fixed in the future.

## By-value trait objects

With this feature, you can have by-value `self` arguments without `Self: Sized` bounds.
Expand Down
26 changes: 0 additions & 26 deletions src/etc/debugger_pretty_printers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,32 +375,6 @@ def extract_tail_head_ptr_and_cap_from_std_vecdeque(vec_val):
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (tail, head, data_ptr, capacity)


def extract_length_and_ptr_from_std_btreeset(vec_val):
assert vec_val.type.get_type_kind() == TYPE_KIND_STD_BTREESET
map = vec_val.get_child_at_index(0)
root = map.get_child_at_index(0)
length = map.get_child_at_index(1).as_integer()
node = root.get_child_at_index(0)
ptr = node.get_child_at_index(0)
unique_ptr_val = ptr.get_child_at_index(0)
data_ptr = unique_ptr_val.get_child_at_index(0)
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (length, data_ptr)


def extract_length_and_ptr_from_std_btreemap(vec_val):
assert vec_val.type.get_type_kind() == TYPE_KIND_STD_BTREEMAP
root = vec_val.get_child_at_index(0)
length = vec_val.get_child_at_index(1).as_integer()
node = root.get_child_at_index(0)
ptr = node.get_child_at_index(0)
unique_ptr_val = ptr.get_child_at_index(0)
data_ptr = unique_ptr_val.get_child_at_index(0)
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (length, data_ptr)


def extract_length_and_ptr_from_slice(slice_val):
assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
Expand Down
70 changes: 41 additions & 29 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,32 @@ def children(self):
yield (str(index), (gdb_ptr + ((tail + index) % cap)).dereference())


# Yield each key (and optionally value) from a BoxedNode.
def children_of_node(boxed_node, height, want_values):
ptr = boxed_node['ptr']['pointer']
# This is written oddly because we don't want to rely on the field name being `__0`.
node_ptr = ptr[ptr.type.fields()[0]]
if height > 0:
type_name = str(node_ptr.type.target()).replace('LeafNode', 'InternalNode')
node_type = gdb.lookup_type(type_name)
node_ptr = node_ptr.cast(node_type.pointer())
leaf = node_ptr['data']
else:
leaf = node_ptr.dereference()
keys = leaf['keys']['value']['value']
if want_values:
values = leaf['vals']['value']['value']
length = int(leaf['len'])
for i in xrange(0, length + 1):
if height > 0:
for child in children_of_node(node_ptr['edges'][i], height - 1, want_values):
yield child
if i < length:
if want_values:
yield (keys[i], values[i])
else:
yield keys[i]

class RustStdBTreeSetPrinter(object):
def __init__(self, val):
self.__val = val
Expand All @@ -328,21 +354,16 @@ def display_hint():
return "array"

def to_string(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
return (self.__val.type.get_unqualified_type_name() +
("(len: %i)" % length))
("(len: %i)" % self.__val.get_wrapped_value()['map']['length']))

def children(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreeset(self.__val)
leaf_node = GdbValue(data_ptr.get_wrapped_value().dereference())
maybe_uninit_keys = leaf_node.get_child_at_index(3)
manually_drop_keys = maybe_uninit_keys.get_child_at_index(1)
keys = manually_drop_keys.get_child_at_index(0)
gdb_ptr = keys.get_wrapped_value()
for index in xrange(length):
yield (str(index), gdb_ptr[index])
root = self.__val.get_wrapped_value()['map']['root']
node_ptr = root['node']
i = 0
for child in children_of_node(node_ptr, root['height'], False):
yield (str(i), child)
i = i + 1


class RustStdBTreeMapPrinter(object):
Expand All @@ -354,26 +375,17 @@ def display_hint():
return "map"

def to_string(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreemap(self.__val)
return (self.__val.type.get_unqualified_type_name() +
("(len: %i)" % length))
("(len: %i)" % self.__val.get_wrapped_value()['length']))

def children(self):
(length, data_ptr) = \
rustpp.extract_length_and_ptr_from_std_btreemap(self.__val)
leaf_node = GdbValue(data_ptr.get_wrapped_value().dereference())
maybe_uninit_keys = leaf_node.get_child_at_index(3)
manually_drop_keys = maybe_uninit_keys.get_child_at_index(1)
keys = manually_drop_keys.get_child_at_index(0)
keys_ptr = keys.get_wrapped_value()
maybe_uninit_vals = leaf_node.get_child_at_index(4)
manually_drop_vals = maybe_uninit_vals.get_child_at_index(1)
vals = manually_drop_vals.get_child_at_index(0)
vals_ptr = vals.get_wrapped_value()
for index in xrange(length):
yield (str(index), keys_ptr[index])
yield (str(index), vals_ptr[index])
root = self.__val.get_wrapped_value()['root']
node_ptr = root['node']
i = 0
for child in children_of_node(node_ptr, root['height'], True):
yield (str(i), child[0])
yield (str(i), child[1])
i = i + 1


class RustStdStringPrinter(object):
Expand Down
16 changes: 8 additions & 8 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ impl Box<dyn Any> {
/// ```
/// use std::any::Any;
///
/// fn print_if_string(value: Box<Any>) {
/// fn print_if_string(value: Box<dyn Any>) {
/// if let Ok(string) = value.downcast::<String>() {
/// println!("String ({}): {}", string.len(), string);
/// }
Expand Down Expand Up @@ -523,7 +523,7 @@ impl Box<dyn Any + Send> {
/// ```
/// use std::any::Any;
///
/// fn print_if_string(value: Box<Any + Send>) {
/// fn print_if_string(value: Box<dyn Any + Send>) {
/// if let Ok(string) = value.downcast::<String>() {
/// println!("String ({}): {}", string.len(), string);
/// }
Expand Down Expand Up @@ -618,18 +618,18 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}

/// `FnBox` is a version of the `FnOnce` intended for use with boxed
/// closure objects. The idea is that where one would normally store a
/// `Box<FnOnce()>` in a data structure, you should use
/// `Box<FnBox()>`. The two traits behave essentially the same, except
/// `Box<dyn FnOnce()>` in a data structure, you should use
/// `Box<dyn FnBox()>`. The two traits behave essentially the same, except
/// that a `FnBox` closure can only be called if it is boxed. (Note
/// that `FnBox` may be deprecated in the future if `Box<FnOnce()>`
/// that `FnBox` may be deprecated in the future if `Box<dyn FnOnce()>`
/// closures become directly usable.)
///
/// # Examples
///
/// Here is a snippet of code which creates a hashmap full of boxed
/// once closures and then removes them one by one, calling each
/// closure as it is removed. Note that the type of the closures
/// stored in the map is `Box<FnBox() -> i32>` and not `Box<FnOnce()
/// stored in the map is `Box<dyn FnBox() -> i32>` and not `Box<dyn FnOnce()
/// -> i32>`.
///
/// ```
Expand All @@ -638,8 +638,8 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
/// use std::boxed::FnBox;
/// use std::collections::HashMap;
///
/// fn make_map() -> HashMap<i32, Box<FnBox() -> i32>> {
/// let mut map: HashMap<i32, Box<FnBox() -> i32>> = HashMap::new();
/// fn make_map() -> HashMap<i32, Box<dyn FnBox() -> i32>> {
/// let mut map: HashMap<i32, Box<dyn FnBox() -> i32>> = HashMap::new();
/// map.insert(1, Box::new(|| 22));
/// map.insert(2, Box::new(|| 44));
/// map
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,15 @@ impl<T: Clone> Rc<T> {
impl Rc<dyn Any> {
#[inline]
#[stable(feature = "rc_downcast", since = "1.29.0")]
/// Attempt to downcast the `Rc<Any>` to a concrete type.
/// Attempt to downcast the `Rc<dyn Any>` to a concrete type.
///
/// # Examples
///
/// ```
/// use std::any::Any;
/// use std::rc::Rc;
///
/// fn print_if_string(value: Rc<Any>) {
/// fn print_if_string(value: Rc<dyn Any>) {
/// if let Ok(string) = value.downcast::<String>() {
/// println!("String ({}): {}", string.len(), string);
/// }
Expand Down
Loading