Auto merge of #94290 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
Bump bootstrap to 1.60 This bumps the bootstrap compiler to 1.60 and cleans up cfgs and Span's rustc_pass_by_value (enabled by the bootstrap bump).
This commit is contained in:
commit
d981633ed6
63 changed files with 429 additions and 503 deletions
|
@ -35,7 +35,7 @@
|
|||
#![feature(let_else)]
|
||||
#![feature(never_type)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
use rustc_ast::token::{self, Token};
|
||||
use rustc_ast::tokenstream::{CanSynthesizeMissingTokens, TokenStream, TokenTree};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#![feature(box_patterns)]
|
||||
#![feature(let_else)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
pub mod ast_validation;
|
||||
pub mod feature_gate;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#![feature(trusted_step)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#![feature(proc_macro_internals)]
|
||||
#![feature(proc_macro_quote)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#![feature(once_cell)]
|
||||
#![feature(nll)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(associated_type_bounds)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
|
||||
//! The backend-agnostic functions of this crate use functions defined in various traits that
|
||||
|
|
|
@ -22,7 +22,7 @@ Rust MIR: a lowered representation of Rust.
|
|||
#![feature(trusted_step)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -20,7 +20,7 @@ mod private {
|
|||
/// but you can only construct a `Interned` with `new_unchecked`, and not
|
||||
/// directly.
|
||||
#[derive(Debug)]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst);
|
||||
|
||||
impl<'a, T> Interned<'a, T> {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#![feature(vec_into_raw_parts)]
|
||||
#![allow(rustc::default_hash_types)]
|
||||
#![deny(unaligned_references)]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#![feature(let_else)]
|
||||
#![feature(once_cell)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#![feature(if_let_guard)]
|
||||
#![feature(let_else)]
|
||||
#![feature(nll)]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![feature(adt_const_params)]
|
||||
#![allow(incomplete_features)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#![feature(proc_macro_span)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#![feature(let_else)]
|
||||
#![feature(nll)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#![feature(min_specialization)]
|
||||
#![feature(label_break_value)]
|
||||
#![recursion_limit = "512"] // For rustdoc
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(once_cell)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
mod callbacks;
|
||||
pub mod interface;
|
||||
|
|
|
@ -147,7 +147,7 @@ impl LintStore {
|
|||
&'t self,
|
||||
) -> impl Iterator<Item = (&'static str, Vec<LintId>, bool)> + 't {
|
||||
// This function is not used in a way which observes the order of lints.
|
||||
#[cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#[allow(rustc::potential_query_instability)]
|
||||
self.lint_groups
|
||||
.iter()
|
||||
.filter(|(_, LintGroup { depr, .. })| {
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#![feature(try_blocks)]
|
||||
#![feature(never_type)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
#![feature(unwrap_infallible)]
|
||||
#![feature(decl_macro)]
|
||||
#![recursion_limit = "512"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
|
|
@ -162,6 +162,9 @@ macro_rules! make_mir_visitor {
|
|||
self.super_constant(constant, location);
|
||||
}
|
||||
|
||||
// The macro results in a false positive of sorts, where &mut Span
|
||||
// is fine, but &Span is not; just allow the lint.
|
||||
#[allow(rustc::pass_by_value)]
|
||||
fn visit_span(&mut self,
|
||||
span: & $($mutability)? Span) {
|
||||
self.super_span(span);
|
||||
|
@ -869,6 +872,9 @@ macro_rules! make_mir_visitor {
|
|||
}
|
||||
}
|
||||
|
||||
// The macro results in a false positive of sorts, where &mut Span
|
||||
// is fine, but &Span is not; just allow the lint.
|
||||
#[allow(rustc::pass_by_value)]
|
||||
fn super_span(&mut self, _span: & $($mutability)? Span) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ pub use valtree::*;
|
|||
|
||||
/// Use this rather than `ConstS`, whenever possible.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Const<'tcx>(pub Interned<'tcx, ConstS<'tcx>>);
|
||||
|
||||
impl<'tcx> fmt::Debug for Const<'tcx> {
|
||||
|
|
|
@ -970,7 +970,7 @@ pub struct FreeRegionInfo {
|
|||
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/ty.html
|
||||
#[derive(Copy, Clone)]
|
||||
#[rustc_diagnostic_item = "TyCtxt"]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct TyCtxt<'tcx> {
|
||||
gcx: &'tcx GlobalCtxt<'tcx>,
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ static_assert_size!(TyS<'_>, 40);
|
|||
/// Use this rather than `TyS`, whenever possible.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[rustc_diagnostic_item = "Ty"]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
|
||||
|
||||
// Statics only used for internal testing.
|
||||
|
@ -486,7 +486,7 @@ static_assert_size!(PredicateS<'_>, 56);
|
|||
|
||||
/// Use this rather than `PredicateS`, whenever possible.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Predicate<'tcx>(Interned<'tcx, PredicateS<'tcx>>);
|
||||
|
||||
impl<'tcx> Predicate<'tcx> {
|
||||
|
|
|
@ -1396,7 +1396,7 @@ impl ParamConst {
|
|||
|
||||
/// Use this rather than `TyKind`, whenever possible.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
|
||||
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Region<'tcx>(pub Interned<'tcx, RegionKind>);
|
||||
|
||||
impl<'tcx> Deref for Region<'tcx> {
|
||||
|
|
|
@ -671,7 +671,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
// a Coverage code region can be generated, `continue` needs no `Assign`; but
|
||||
// without one, the `InstrumentCoverage` MIR pass cannot generate a code region for
|
||||
// `continue`. Coverage will be missing unless we add a dummy `Assign` to MIR.
|
||||
self.add_dummy_assignment(&span, block, source_info);
|
||||
self.add_dummy_assignment(span, block, source_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -730,8 +730,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
|
||||
// Add a dummy `Assign` statement to the CFG, with the span for the source code's `continue`
|
||||
// statement.
|
||||
fn add_dummy_assignment(&mut self, span: &Span, block: BasicBlock, source_info: SourceInfo) {
|
||||
let local_decl = LocalDecl::new(self.tcx.mk_unit(), *span).internal();
|
||||
fn add_dummy_assignment(&mut self, span: Span, block: BasicBlock, source_info: SourceInfo) {
|
||||
let local_decl = LocalDecl::new(self.tcx.mk_unit(), span).internal();
|
||||
let temp_place = Place::from(self.local_decls.push(local_decl));
|
||||
self.cfg.push_assign_unit(block, source_info, temp_place, self.tcx);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#![feature(once_cell)]
|
||||
#![feature(min_specialization)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -47,9 +47,9 @@ impl CoverageStatement {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn span(&self) -> &Span {
|
||||
pub fn span(&self) -> Span {
|
||||
match self {
|
||||
Self::Statement(_, span, _) | Self::Terminator(_, span) => span,
|
||||
Self::Statement(_, span, _) | Self::Terminator(_, span) => *span,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#![feature(trusted_step)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#![feature(control_flow_enum)]
|
||||
#![feature(let_else)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#![feature(try_blocks)]
|
||||
#![feature(associated_type_defaults)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
use rustc_ast::MacroDef;
|
||||
use rustc_attr as attr;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#![feature(once_cell)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#![feature(let_else)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(extern_types)]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#![feature(nll)]
|
||||
#![recursion_limit = "256"]
|
||||
#![allow(rustdoc::private_intra_doc_links)]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#![feature(nll)]
|
||||
#![feature(let_else)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
mod dump_visitor;
|
||||
mod dumper;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#![feature(min_specialization)]
|
||||
#![feature(once_cell)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#![feature(negative_impls)]
|
||||
#![feature(nll)]
|
||||
#![feature(min_specialization)]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![feature(rustc_attrs)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -61,15 +61,7 @@ use rustc_data_structures::fx::FxIndexSet;
|
|||
/// using the callback `SPAN_TRACK` to access the query engine.
|
||||
///
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
|
||||
// FIXME(@lcnr): Enable this attribute once the bootstrap
|
||||
// compiler knows of `rustc_pass_by_value`.
|
||||
//
|
||||
// Right now, this lint would only trigger when compiling the
|
||||
// stage 2 compiler, which is fairly annoying as there are
|
||||
// a lot of places using `&Span` right now. After the next bootstrap bump,
|
||||
// the lint will already trigger when using stage 1, which is a lot less annoying.
|
||||
//
|
||||
// #[cfg_attr(not(bootstrap), rustc_pass_by_value)]
|
||||
#[rustc_pass_by_value]
|
||||
pub struct Span {
|
||||
base_or_index: u32,
|
||||
len_or_tag: u16,
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
#![feature(never_type)]
|
||||
#![feature(nll)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![recursion_limit = "512"] // For rustdoc
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
|
|
@ -271,7 +271,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
ExprKind::Box(subexpr) => self.check_expr_box(subexpr, expected),
|
||||
ExprKind::Lit(ref lit) => self.check_lit(&lit, expected),
|
||||
ExprKind::Binary(op, lhs, rhs) => self.check_binop(expr, op, lhs, rhs),
|
||||
ExprKind::Assign(lhs, rhs, ref span) => {
|
||||
ExprKind::Assign(lhs, rhs, span) => {
|
||||
self.check_expr_assign(expr, expected, lhs, rhs, span)
|
||||
}
|
||||
ExprKind::AssignOp(op, lhs, rhs) => self.check_binop_assign(expr, op, lhs, rhs),
|
||||
|
@ -982,7 +982,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
expected: Expectation<'tcx>,
|
||||
lhs: &'tcx hir::Expr<'tcx>,
|
||||
rhs: &'tcx hir::Expr<'tcx>,
|
||||
span: &Span,
|
||||
span: Span,
|
||||
) -> Ty<'tcx> {
|
||||
let expected_ty = expected.coercion_target_type(self, expr.span);
|
||||
if expected_ty == self.tcx.types.bool {
|
||||
|
@ -1014,7 +1014,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
if eq {
|
||||
err.span_suggestion_verbose(
|
||||
*span,
|
||||
span,
|
||||
"you might have meant to compare for equality",
|
||||
"==".to_string(),
|
||||
applicability,
|
||||
|
@ -1031,7 +1031,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
return self.tcx.ty_error();
|
||||
}
|
||||
|
||||
self.check_lhs_assignable(lhs, "E0070", *span);
|
||||
self.check_lhs_assignable(lhs, "E0070", span);
|
||||
|
||||
let lhs_ty = self.check_expr_with_needs(&lhs, Needs::MutPlace);
|
||||
let rhs_ty = self.check_expr_coercable_to_type(&rhs, lhs_ty, Some(lhs));
|
||||
|
|
|
@ -36,7 +36,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
let ty =
|
||||
if !lhs_ty.is_ty_var() && !rhs_ty.is_ty_var() && is_builtin_binop(lhs_ty, rhs_ty, op) {
|
||||
self.enforce_builtin_binop_types(&lhs.span, lhs_ty, &rhs.span, rhs_ty, op);
|
||||
self.enforce_builtin_binop_types(lhs.span, lhs_ty, rhs.span, rhs_ty, op);
|
||||
self.tcx.mk_unit()
|
||||
} else {
|
||||
return_ty
|
||||
|
@ -98,9 +98,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
&& is_builtin_binop(lhs_ty, rhs_ty, op)
|
||||
{
|
||||
let builtin_return_ty = self.enforce_builtin_binop_types(
|
||||
&lhs_expr.span,
|
||||
lhs_expr.span,
|
||||
lhs_ty,
|
||||
&rhs_expr.span,
|
||||
rhs_expr.span,
|
||||
rhs_ty,
|
||||
op,
|
||||
);
|
||||
|
@ -114,9 +114,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
fn enforce_builtin_binop_types(
|
||||
&self,
|
||||
lhs_span: &Span,
|
||||
lhs_span: Span,
|
||||
lhs_ty: Ty<'tcx>,
|
||||
rhs_span: &Span,
|
||||
rhs_span: Span,
|
||||
rhs_ty: Ty<'tcx>,
|
||||
op: hir::BinOp,
|
||||
) -> Ty<'tcx> {
|
||||
|
@ -129,8 +129,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
let tcx = self.tcx;
|
||||
match BinOpCategory::from(op) {
|
||||
BinOpCategory::Shortcircuit => {
|
||||
self.demand_suptype(*lhs_span, tcx.types.bool, lhs_ty);
|
||||
self.demand_suptype(*rhs_span, tcx.types.bool, rhs_ty);
|
||||
self.demand_suptype(lhs_span, tcx.types.bool, lhs_ty);
|
||||
self.demand_suptype(rhs_span, tcx.types.bool, rhs_ty);
|
||||
tcx.types.bool
|
||||
}
|
||||
|
||||
|
@ -141,13 +141,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
BinOpCategory::Math | BinOpCategory::Bitwise => {
|
||||
// both LHS and RHS and result will have the same type
|
||||
self.demand_suptype(*rhs_span, lhs_ty, rhs_ty);
|
||||
self.demand_suptype(rhs_span, lhs_ty, rhs_ty);
|
||||
lhs_ty
|
||||
}
|
||||
|
||||
BinOpCategory::Comparison => {
|
||||
// both LHS and RHS and result will have the same type
|
||||
self.demand_suptype(*rhs_span, lhs_ty, rhs_ty);
|
||||
self.demand_suptype(rhs_span, lhs_ty, rhs_ty);
|
||||
tcx.types.bool
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ This API is completely unstable and subject to change.
|
|||
#![feature(control_flow_enum)]
|
||||
#![feature(hash_drain_filter)]
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue