Skip to content

Commit 5d62040

Browse files
committed
Auto merge of rust-lang#3130 - RalfJung:rustup, r=RalfJung
Rustup
2 parents e120dea + b01c480 commit 5d62040

File tree

540 files changed

+7133
-3331
lines changed

Some content is hidden

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

540 files changed

+7133
-3331
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Benoît Cortier <benoit.cortier@fried-world.eu>
7474
Bheesham Persaud <bheesham123@hotmail.com> Bheesham Persaud <bheesham.persaud@live.ca>
7575
Björn Steinbrink <bsteinbr@gmail.com> <B.Steinbrink@gmx.de>
7676
blake2-ppc <ulrik.sverdrup@gmail.com> <blake2-ppc>
77+
blyxyas <blyxyas@gmail.com> Alejandra González <blyxyas@gmail.com>
7778
boolean_coercion <booleancoercion@gmail.com>
7879
Boris Egorov <jightuse@gmail.com> <egorov@linux.com>
7980
bors <bors@rust-lang.org> bors[bot] <26634292+bors[bot]@users.noreply.github.com>

Cargo.lock

+7-5
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ dependencies = [
697697
"getopts",
698698
"glob",
699699
"home",
700+
"indexmap 2.0.0",
700701
"lazycell",
701702
"libc",
702703
"miow",
@@ -3418,6 +3419,7 @@ dependencies = [
34183419
"rustc_macros",
34193420
"rustc_serialize",
34203421
"rustc_span",
3422+
"rustc_type_ir",
34213423
"smallvec",
34223424
"thin-vec",
34233425
"tracing",
@@ -3838,7 +3840,7 @@ dependencies = [
38383840

38393841
[[package]]
38403842
name = "rustc_fluent_macro"
3841-
version = "0.1.0"
3843+
version = "0.0.0"
38423844
dependencies = [
38433845
"annotate-snippets",
38443846
"fluent-bundle",
@@ -3914,7 +3916,7 @@ dependencies = [
39143916

39153917
[[package]]
39163918
name = "rustc_hir_typeck"
3917-
version = "0.1.0"
3919+
version = "0.0.0"
39183920
dependencies = [
39193921
"rustc_ast",
39203922
"rustc_attr",
@@ -4042,7 +4044,7 @@ dependencies = [
40424044

40434045
[[package]]
40444046
name = "rustc_lexer"
4045-
version = "0.1.0"
4047+
version = "0.0.0"
40464048
dependencies = [
40474049
"expect-test",
40484050
"unicode-properties",
@@ -4111,7 +4113,7 @@ dependencies = [
41114113

41124114
[[package]]
41134115
name = "rustc_macros"
4114-
version = "0.1.0"
4116+
version = "0.0.0"
41154117
dependencies = [
41164118
"proc-macro2",
41174119
"quote",
@@ -4595,7 +4597,7 @@ dependencies = [
45954597

45964598
[[package]]
45974599
name = "rustc_transmute"
4598-
version = "0.1.0"
4600+
version = "0.0.0"
45994601
dependencies = [
46004602
"itertools",
46014603
"rustc_data_structures",

compiler/rustc_ast/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ rustc_lexer = { path = "../rustc_lexer" }
1414
rustc_macros = { path = "../rustc_macros" }
1515
rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }
17+
# depends on Mutability and Movability, which could be uplifted into a common crate.
18+
rustc_type_ir = { path = "../rustc_type_ir" }
1719
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
1820
thin-vec = "0.2.12"
1921
tracing = "0.1"

compiler/rustc_ast/src/ast.rs

+1-62
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3434
use rustc_span::source_map::{respan, Spanned};
3535
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3636
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
37+
pub use rustc_type_ir::{Movability, Mutability};
3738
use std::fmt;
3839
use std::mem;
3940
use thin_vec::{thin_vec, ThinVec};
@@ -800,57 +801,6 @@ pub enum PatKind {
800801
MacCall(P<MacCall>),
801802
}
802803

803-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
804-
#[derive(HashStable_Generic, Encodable, Decodable)]
805-
pub enum Mutability {
806-
// N.B. Order is deliberate, so that Not < Mut
807-
Not,
808-
Mut,
809-
}
810-
811-
impl Mutability {
812-
pub fn invert(self) -> Self {
813-
match self {
814-
Mutability::Mut => Mutability::Not,
815-
Mutability::Not => Mutability::Mut,
816-
}
817-
}
818-
819-
/// Returns `""` (empty string) or `"mut "` depending on the mutability.
820-
pub fn prefix_str(self) -> &'static str {
821-
match self {
822-
Mutability::Mut => "mut ",
823-
Mutability::Not => "",
824-
}
825-
}
826-
827-
/// Returns `"&"` or `"&mut "` depending on the mutability.
828-
pub fn ref_prefix_str(self) -> &'static str {
829-
match self {
830-
Mutability::Not => "&",
831-
Mutability::Mut => "&mut ",
832-
}
833-
}
834-
835-
/// Returns `""` (empty string) or `"mutably "` depending on the mutability.
836-
pub fn mutably_str(self) -> &'static str {
837-
match self {
838-
Mutability::Not => "",
839-
Mutability::Mut => "mutably ",
840-
}
841-
}
842-
843-
/// Return `true` if self is mutable
844-
pub fn is_mut(self) -> bool {
845-
matches!(self, Self::Mut)
846-
}
847-
848-
/// Return `true` if self is **not** mutable
849-
pub fn is_not(self) -> bool {
850-
matches!(self, Self::Not)
851-
}
852-
}
853-
854804
/// The kind of borrow in an `AddrOf` expression,
855805
/// e.g., `&place` or `&raw const place`.
856806
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
@@ -1579,17 +1529,6 @@ pub enum CaptureBy {
15791529
Ref,
15801530
}
15811531

1582-
/// The movability of a generator / closure literal:
1583-
/// whether a generator contains self-references, causing it to be `!Unpin`.
1584-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable, Debug, Copy)]
1585-
#[derive(HashStable_Generic)]
1586-
pub enum Movability {
1587-
/// May contain self-references, `!Unpin`.
1588-
Static,
1589-
/// Must not contain self-references, `Unpin`.
1590-
Movable,
1591-
}
1592-
15931532
/// Closure lifetime binder, `for<'a, 'b>` in `for<'a, 'b> |_: &'a (), _: &'b ()|`.
15941533
#[derive(Clone, Encodable, Decodable, Debug)]
15951534
pub enum ClosureBinder {

compiler/rustc_ast/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
6060
/// Requirements for a `StableHashingContext` to be used in this crate.
6161
/// This is a hack to allow using the `HashStable_Generic` derive macro
6262
/// instead of implementing everything in `rustc_middle`.
63-
pub trait HashStableContext: rustc_span::HashStableContext {
63+
pub trait HashStableContext:
64+
rustc_type_ir::HashStableContext + rustc_span::HashStableContext
65+
{
6466
fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
6567
}
6668

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+13-20
Original file line numberDiff line numberDiff line change
@@ -328,26 +328,19 @@ fn check_opaque_type_well_formed<'tcx>(
328328

329329
// Require that the hidden type actually fulfills all the bounds of the opaque type, even without
330330
// the bounds that the function supplies.
331-
let mut obligations = vec![];
332-
infcx
333-
.insert_hidden_type(
334-
OpaqueTypeKey { def_id, args: identity_args },
335-
&ObligationCause::misc(definition_span, def_id),
336-
param_env,
337-
definition_ty,
338-
true,
339-
&mut obligations,
340-
)
341-
.unwrap();
342-
infcx.add_item_bounds_for_hidden_type(
343-
def_id.to_def_id(),
344-
identity_args,
345-
ObligationCause::misc(definition_span, def_id),
346-
param_env,
347-
definition_ty,
348-
&mut obligations,
349-
);
350-
ocx.register_obligations(obligations);
331+
let opaque_ty = Ty::new_opaque(tcx, def_id.to_def_id(), identity_args);
332+
ocx.eq(&ObligationCause::misc(definition_span, def_id), param_env, opaque_ty, definition_ty)
333+
.map_err(|err| {
334+
infcx
335+
.err_ctxt()
336+
.report_mismatched_types(
337+
&ObligationCause::misc(definition_span, def_id),
338+
opaque_ty,
339+
definition_ty,
340+
err,
341+
)
342+
.emit()
343+
})?;
351344

352345
// Require the hidden type to be well-formed with only the generics of the opaque type.
353346
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the

compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_middle::mir::coverage::{CounterId, ExpressionId, Operand};
1+
use rustc_middle::mir::coverage::{CounterId, CovTerm, ExpressionId};
22

33
/// Must match the layout of `LLVMRustCounterKind`.
44
#[derive(Copy, Clone, Debug)]
@@ -43,11 +43,11 @@ impl Counter {
4343
Self { kind: CounterKind::Expression, id: expression_id.as_u32() }
4444
}
4545

46-
pub(crate) fn from_operand(operand: Operand) -> Self {
47-
match operand {
48-
Operand::Zero => Self::ZERO,
49-
Operand::Counter(id) => Self::counter_value_reference(id),
50-
Operand::Expression(id) => Self::expression(id),
46+
pub(crate) fn from_term(term: CovTerm) -> Self {
47+
match term {
48+
CovTerm::Zero => Self::ZERO,
49+
CovTerm::Counter(id) => Self::counter_value_reference(id),
50+
CovTerm::Expression(id) => Self::expression(id),
5151
}
5252
}
5353
}
@@ -73,17 +73,6 @@ pub struct CounterExpression {
7373
pub rhs: Counter,
7474
}
7575

76-
impl CounterExpression {
77-
/// The dummy expression `(0 - 0)` has a representation of all zeroes,
78-
/// making it marginally more efficient to initialize than `(0 + 0)`.
79-
pub(crate) const DUMMY: Self =
80-
Self { lhs: Counter::ZERO, kind: ExprKind::Subtract, rhs: Counter::ZERO };
81-
82-
pub fn new(lhs: Counter, kind: ExprKind, rhs: Counter) -> Self {
83-
Self { kind, lhs, rhs }
84-
}
85-
}
86-
8776
/// Corresponds to enum `llvm::coverage::CounterMappingRegion::RegionKind`.
8877
///
8978
/// Must match the layout of `LLVMRustCounterMappingRegionKind`.

0 commit comments

Comments
 (0)