Skip to content

Commit 6576f4b

Browse files
committed
Auto merge of #65671 - Centril:rollup-00glhmb, r=Centril
Rollup of 7 pull requests Successful merges: - #62330 (Change untagged_unions to not allow union fields with drop) - #65092 (make is_power_of_two a const function) - #65621 (miri: add write_bytes method to Memory doing bounds-checks and supporting iterators) - #65647 (Remove unnecessary trait bounds and derivations) - #65653 (keep the root dir clean from debugging) - #65660 (Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`) - #65663 (Fix typo from #65214) Failed merges: r? @ghost
2 parents 10f12fe + 56756c2 commit 6576f4b

File tree

112 files changed

+667
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+667
-482
lines changed

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# This file should only ignore things that are generated during a build,
2-
# generated by common IDEs, and optional files controlled by the user
3-
# that affect the build (such as config.toml).
1+
# This file should only ignore things that are generated during a `x.py` build,
2+
# generated by common IDEs, and optional files controlled by the user that
3+
# affect the build (such as config.toml).
4+
# In particular, things like `mir_dump` should not be listed here; they are only
5+
# created during manual debugging and many people like to clean up instead of
6+
# having git ignore such leftovers. You can use `.git/info/exclude` to
7+
# configure your local ignore list.
48
# FIXME: This needs cleanup.
59
*~
610
.#*
@@ -52,6 +56,4 @@ config.stamp
5256
Session.vim
5357
.cargo
5458
no_llvm_build
55-
# Generated when dumping Graphviz output for debugging:
56-
/mir_dump/
57-
/*.dot
59+
# Before adding new lines, see the comment at the top.

src/bootstrap/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Ord for Interned<String> {
161161
}
162162
}
163163

164-
struct TyIntern<T: Hash + Clone + Eq> {
164+
struct TyIntern<T: Clone + Eq> {
165165
items: Vec<T>,
166166
set: HashMap<T, Interned<T>>,
167167
}

src/doc/rustc/src/lints/listing/warn-by-default.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -596,30 +596,6 @@ warning: function cannot return without recursing
596596
|
597597
```
598598

599-
## unions-with-drop-fields
600-
601-
This lint detects use of unions that contain fields with possibly non-trivial drop code. Some
602-
example code that triggers this lint:
603-
604-
```rust
605-
#![feature(untagged_unions)]
606-
607-
union U {
608-
s: String,
609-
}
610-
```
611-
612-
This will produce:
613-
614-
```text
615-
warning: union contains a field with possibly non-trivial drop code, drop code of union fields is ignored when dropping the union
616-
--> src/main.rs:4:5
617-
|
618-
4 | s: String,
619-
| ^^^^^^^^^
620-
|
621-
```
622-
623599
## unknown-lints
624600

625601
This lint detects unrecognized lint attribute. Some

src/libcore/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3757,8 +3757,8 @@ assert!(!10", stringify!($SelfT), ".is_power_of_two());", $EndFeature, "
37573757
```"),
37583758
#[stable(feature = "rust1", since = "1.0.0")]
37593759
#[inline]
3760-
pub fn is_power_of_two(self) -> bool {
3761-
(self.wrapping_sub(1)) & self == 0 && !(self == 0)
3760+
pub const fn is_power_of_two(self) -> bool {
3761+
self.count_ones() == 1
37623762
}
37633763
}
37643764

src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ parking_lot = "0.9"
3636
byteorder = { version = "1.3" }
3737
chalk-engine = { version = "0.9.0", default-features=false }
3838
rustc_fs_util = { path = "../librustc_fs_util" }
39-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
39+
smallvec = { version = "0.6.8", features = ["union", "may_dangle"] }
4040
measureme = "0.3"

src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl DepNodeIndex {
3535
pub const INVALID: DepNodeIndex = DepNodeIndex::MAX;
3636
}
3737

38-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
38+
#[derive(PartialEq)]
3939
pub enum DepNodeColor {
4040
Red,
4141
Green(DepNodeIndex)

src/librustc/hir/map/definitions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ macro_rules! define_global_metadata_kind {
599599
(pub enum GlobalMetaDataKind {
600600
$($variant:ident),*
601601
}) => (
602-
#[derive(Clone, Copy, Debug, Hash, RustcEncodable, RustcDecodable)]
603602
pub enum GlobalMetaDataKind {
604603
$($variant),*
605604
}

src/librustc/hir/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ impl Mutability {
10771077
}
10781078
}
10791079

1080-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
1080+
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
10811081
pub enum BinOpKind {
10821082
/// The `+` operator (addition).
10831083
Add,
@@ -1211,7 +1211,7 @@ impl Into<ast::BinOpKind> for BinOpKind {
12111211

12121212
pub type BinOp = Spanned<BinOpKind>;
12131213

1214-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Hash, HashStable)]
1214+
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
12151215
pub enum UnOp {
12161216
/// The `*` operator (deferencing).
12171217
UnDeref,
@@ -1388,8 +1388,7 @@ impl Body {
13881388
}
13891389

13901390
/// The type of source expression that caused this generator to be created.
1391-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
1392-
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
1391+
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
13931392
pub enum GeneratorKind {
13941393
/// An explicit `async` block or the body of an async function.
13951394
Async(AsyncGeneratorKind),
@@ -1412,8 +1411,7 @@ impl fmt::Display for GeneratorKind {
14121411
///
14131412
/// This helps error messages but is also used to drive coercions in
14141413
/// type-checking (see #60424).
1415-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, HashStable,
1416-
RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
1414+
#[derive(Clone, PartialEq, Eq, HashStable, RustcEncodable, RustcDecodable, Debug, Copy)]
14171415
pub enum AsyncGeneratorKind {
14181416
/// An explicit `async` block written by the user.
14191417
Block,

src/librustc/hir/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
1111

1212
use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
1313
/// An owned smart pointer.
14-
#[derive(Hash, PartialEq, Eq)]
14+
#[derive(PartialEq, Eq)]
1515
pub struct P<T: ?Sized> {
1616
ptr: Box<T>
1717
}

src/librustc/infer/canonical/canonicalizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
468468
ConstValue::Infer(InferConst::Fresh(_)) => {
469469
bug!("encountered a fresh const during canonicalization")
470470
}
471-
ConstValue::Infer(InferConst::Canonical(debruijn, _)) => {
471+
ConstValue::Bound(debruijn, _) => {
472472
if debruijn >= self.binder_index {
473473
bug!("escaping bound type during canonicalization")
474474
} else {
@@ -700,7 +700,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
700700
let var = self.canonical_var(info, const_var.into());
701701
self.tcx().mk_const(
702702
ty::Const {
703-
val: ConstValue::Infer(InferConst::Canonical(self.binder_index, var.into())),
703+
val: ConstValue::Bound(self.binder_index, var.into()),
704704
ty: self.fold_ty(const_var.ty),
705705
}
706706
)

0 commit comments

Comments
 (0)