Skip to content

Commit

Permalink
Auto merge of #90387 - matthiaskrgr:rollup-b2x8v0x, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Rollup of 3 pull requests

Successful merges:

 - #90082 (Fix minor typos)
 - #90336 (Remove extra lines in examples for `Duration::try_from_secs_*`)
 - #90376 (Various cleanups around opaque types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Oct 28, 2021
2 parents c390d69 + bcee0a6 commit df76418
Show file tree
Hide file tree
Showing 9 changed files with 599 additions and 655 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use rustc_span::def_id::CRATE_DEF_ID;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::VariantIdx;
use rustc_trait_selection::infer::InferCtxtExt as _;
use rustc_trait_selection::opaque_types::InferCtxtExt;
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
use rustc_trait_selection::traits::query::type_op;
use rustc_trait_selection::traits::query::type_op::custom::CustomTypeOp;
Expand Down
592 changes: 591 additions & 1 deletion compiler/rustc_infer/src/infer/opaque_types.rs

Large diffs are not rendered by default.

648 changes: 6 additions & 642 deletions compiler/rustc_trait_selection/src/opaque_types.rs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion compiler/rustc_typeck/src/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKi
use rustc_infer::traits::Obligation;
use rustc_middle::ty::{self, ToPredicate, Ty, TyS};
use rustc_span::{MultiSpan, Span};
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
use rustc_trait_selection::traits::{
IfExpressionCause, MatchExpressionArmCause, ObligationCause, ObligationCauseCode,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_typeck/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use rustc_session::lint::builtin::{UNINHABITED_STATIC, UNSUPPORTED_CALLING_CONVE
use rustc_span::symbol::sym;
use rustc_span::{self, MultiSpan, Span};
use rustc_target::spec::abi::Abi;
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use rustc_trait_selection::traits;
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
use rustc_ty_utils::representability::{self, Representability};
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use rustc_span::source_map::{original_sp, DUMMY_SP};
use rustc_span::symbol::{kw, sym, Ident};
use rustc_span::{self, BytePos, MultiSpan, Span};
use rustc_trait_selection::infer::InferCtxtExt as _;
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
use rustc_trait_selection::traits::{
self, ObligationCause, ObligationCauseCode, StatementAsExpression, TraitEngine, TraitEngineExt,
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_typeck/src/check/regionck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ use rustc_middle::hir::place::{PlaceBase, PlaceWithHirId};
use rustc_middle::ty::adjustment;
use rustc_middle::ty::{self, Ty};
use rustc_span::Span;
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use std::ops::Deref;

// a variation on try that just returns unit
Expand Down Expand Up @@ -340,8 +339,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
self.link_fn_params(body.params);
self.visit_body(body);
self.visit_region_obligations(body_id.hir_id);

self.constrain_opaque_types();
}

fn visit_region_obligations(&mut self, hir_id: hir::HirId) {
Expand Down
3 changes: 0 additions & 3 deletions library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ impl Duration {
/// # Examples
/// ```
/// #![feature(duration_checked_float)]
///
/// use std::time::Duration;
///
/// let dur = Duration::try_from_secs_f64(2.7);
Expand Down Expand Up @@ -799,7 +798,6 @@ impl Duration {
/// # Examples
/// ```
/// #![feature(duration_checked_float)]
///
/// use std::time::Duration;
///
/// let dur = Duration::try_from_secs_f32(2.7);
Expand Down Expand Up @@ -1258,7 +1256,6 @@ impl fmt::Debug for Duration {
///
/// ```
/// #![feature(duration_checked_float)]
///
/// use std::time::Duration;
///
/// if let Err(e) = Duration::try_from_secs_f32(-1.0) {
Expand Down
4 changes: 2 additions & 2 deletions src/doc/unstable-book/src/library-features/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ assert_eq!(x, 5);
This will write the value `5` into the `u64` variable `x`.
You can see that the string literal we use to specify instructions is actually a template string.
It is governed by the same rules as Rust [format strings][format-syntax].
The arguments that are inserted into the template however look a bit different then you may
The arguments that are inserted into the template however look a bit different than you may
be familiar with. First we need to specify if the variable is an input or an output of the
inline assembly. In this case it is an output. We declared this by writing `out`.
We also need to specify in what kind of register the assembly expects the variable.
Expand Down Expand Up @@ -106,7 +106,7 @@ code.
Second, we can see that inputs are declared by writing `in` instead of `out`.

Third, one of our operands has a type we haven't seen yet, `const`.
This tells the compiler to expand this argument to value directly inside the assembly template.
This tells the compiler to expand this argument to a value directly inside the assembly template.
This is only possible for constants and literals.

Fourth, we can see that we can specify an argument number, or name as in any format string.
Expand Down

0 comments on commit df76418

Please sign in to comment.