diff options
| author | bors <bors@rust-lang.org> | 2020-10-17 01:41:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-17 01:41:43 +0000 |
| commit | 3f50dea4d0dfce527871bb0a198dc17c479e697b (patch) | |
| tree | bdde49e8d12de219742f63555eed23fde2ced051 /src/test | |
| parent | f1b97ee7f8ffb1a814944b85c7e05a1555a7eda5 (diff) | |
| parent | b9c45d1e782f710bae7b8d43c1863848b8f660a5 (diff) | |
| download | rust-3f50dea4d0dfce527871bb0a198dc17c479e697b.tar.gz rust-3f50dea4d0dfce527871bb0a198dc17c479e697b.zip | |
Auto merge of #78033 - Dylan-DPC:rollup-ds2cfsf, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #76199 (Permit uninhabited enums to cast into ints) - #77751 (liballoc: VecDeque: Add binary search functions) - #77785 (Remove compiler-synthesized reexports when documenting) - #77932 (BTreeMap: improve gdb introspection of BTreeMap with ZST keys or values) - #77961 (Set .llvmbc and .llvmcmd sections as allocatable) - #77985 (llvm: backport SystemZ fix for AGR clobbers) Failed merges: r? `@ghost`
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/debuginfo/pretty-std-collections.rs | 28 | ||||
| -rw-r--r-- | src/test/rustdoc/no-compiler-reexport.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/uninhabited/uninhabited-enum-cast.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/uninhabited/uninhabited-enum-cast.stderr | 9 |
4 files changed, 30 insertions, 18 deletions
diff --git a/src/test/debuginfo/pretty-std-collections.rs b/src/test/debuginfo/pretty-std-collections.rs index c6d2090759f..cc2a3a34510 100644 --- a/src/test/debuginfo/pretty-std-collections.rs +++ b/src/test/debuginfo/pretty-std-collections.rs @@ -34,20 +34,26 @@ // gdb-check:$6 = BTreeMap(size=15) = {[0] = pretty_std_collections::MyLeafNode (0), [...]} // (abbreviated because it's boring but we need enough elements to include internal nodes) -// gdb-command: print zst_btree_map -// gdb-check:$7 = BTreeMap(size=1) +// gdb-command: print zst_key_btree_map +// gdb-check:$7 = BTreeMap(size=1) = {[()] = 1} + +// gdb-command: print zst_val_btree_map +// gdb-check:$8 = BTreeMap(size=1) = {[1] = ()} + +// gdb-command: print zst_key_val_btree_map +// gdb-check:$9 = BTreeMap(size=1) = {[()] = ()} // gdb-command: print vec_deque -// gdb-check:$8 = VecDeque(size=3) = {5, 3, 7} +// gdb-check:$10 = VecDeque(size=3) = {5, 3, 7} // gdb-command: print vec_deque2 -// gdb-check:$9 = VecDeque(size=7) = {2, 3, 4, 5, 6, 7, 8} +// gdb-check:$11 = VecDeque(size=7) = {2, 3, 4, 5, 6, 7, 8} // gdb-command: print hash_map -// gdb-check:$10 = HashMap(size=4) = {[1] = 10, [2] = 20, [3] = 30, [4] = 40} +// gdb-check:$12 = HashMap(size=4) = {[1] = 10, [2] = 20, [3] = 30, [4] = 40} // gdb-command: print hash_set -// gdb-check:$11 = HashSet(size=4) = {1, 2, 3, 4} +// gdb-check:$13 = HashSet(size=4) = {1, 2, 3, 4} // === LLDB TESTS ================================================================================== @@ -114,8 +120,14 @@ fn main() { nasty_btree_map.insert(i, MyLeafNode(i)); } - let mut zst_btree_map: BTreeMap<(), ()> = BTreeMap::new(); - zst_btree_map.insert((), ()); + let mut zst_key_btree_map: BTreeMap<(), i32> = BTreeMap::new(); + zst_key_btree_map.insert((), 1); + + let mut zst_val_btree_map: BTreeMap<i32, ()> = BTreeMap::new(); + zst_val_btree_map.insert(1, ()); + + let mut zst_key_val_btree_map: BTreeMap<(), ()> = BTreeMap::new(); + zst_key_val_btree_map.insert((), ()); // VecDeque let mut vec_deque = VecDeque::new(); diff --git a/src/test/rustdoc/no-compiler-reexport.rs b/src/test/rustdoc/no-compiler-reexport.rs new file mode 100644 index 00000000000..6d50325fed5 --- /dev/null +++ b/src/test/rustdoc/no-compiler-reexport.rs @@ -0,0 +1,7 @@ +// compile-flags: --no-defaults + +#![crate_name = "foo"] + +// @has 'foo/index.html' '//code' 'extern crate std;' +// @!has 'foo/index.html' '//code' 'use std::prelude::v1::*;' +pub struct Foo; diff --git a/src/test/ui/uninhabited/uninhabited-enum-cast.rs b/src/test/ui/uninhabited/uninhabited-enum-cast.rs index 7e178e054cc..5a75c94c42f 100644 --- a/src/test/ui/uninhabited/uninhabited-enum-cast.rs +++ b/src/test/ui/uninhabited/uninhabited-enum-cast.rs @@ -1,7 +1,9 @@ +// check-pass + enum E {} fn f(e: E) { - println!("{}", (e as isize).to_string()); //~ ERROR non-primitive cast + println!("{}", (e as isize).to_string()); } fn main() {} diff --git a/src/test/ui/uninhabited/uninhabited-enum-cast.stderr b/src/test/ui/uninhabited/uninhabited-enum-cast.stderr deleted file mode 100644 index a9f10dfec99..00000000000 --- a/src/test/ui/uninhabited/uninhabited-enum-cast.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0605]: non-primitive cast: `E` as `isize` - --> $DIR/uninhabited-enum-cast.rs:4:20 - | -LL | println!("{}", (e as isize).to_string()); - | ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0605`. |
