Skip to content

Commit 0e19020

Browse files
committed
Auto merge of rust-lang#81461 - JohnTitor:rollup-b0ij25f, r=JohnTitor
Rollup of 13 pull requests Successful merges: - rust-lang#70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`)) - rust-lang#79951 (Refractor a few more types to `rustc_type_ir` ) - rust-lang#80868 (Print failure message on all tests that should panic, but don't) - rust-lang#81062 (Improve diagnostics for Precise Capture) - rust-lang#81277 (Make more traits of the From/Into family diagnostic items) - rust-lang#81284 (Make `-Z time-passes` less noisy) - rust-lang#81379 (Improve URLs handling) - rust-lang#81416 (Tweak suggestion for missing field in patterns) - rust-lang#81426 (const_evaluatable: expand abstract consts in try_unify) - rust-lang#81428 (compiletest: Add two more unit tests) - rust-lang#81430 (add const_evaluatable_checked test) - rust-lang#81433 (const_evaluatable: stop looking into type aliases) - rust-lang#81445 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents e32f372 + f3dfbfc commit 0e19020

File tree

95 files changed

+1928
-733
lines changed

Some content is hidden

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

95 files changed

+1928
-733
lines changed

Cargo.lock

+6-5
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
770770

771771
[[package]]
772772
name = "crates-io"
773-
version = "0.31.1"
773+
version = "0.33.0"
774774
dependencies = [
775775
"anyhow",
776776
"curl",
@@ -1337,9 +1337,9 @@ dependencies = [
13371337

13381338
[[package]]
13391339
name = "git2"
1340-
version = "0.13.14"
1340+
version = "0.13.17"
13411341
source = "registry+https://github.com/rust-lang/crates.io-index"
1342-
checksum = "186dd99cc77576e58344ad614fa9bb27bad9d048f85de3ca850c1f4e8b048260"
1342+
checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986"
13431343
dependencies = [
13441344
"bitflags",
13451345
"libc",
@@ -1792,9 +1792,9 @@ dependencies = [
17921792

17931793
[[package]]
17941794
name = "libgit2-sys"
1795-
version = "0.12.16+1.1.0"
1795+
version = "0.12.18+1.1.0"
17961796
source = "registry+https://github.com/rust-lang/crates.io-index"
1797-
checksum = "9f91b2f931ee975a98155195be8cd82d02e8e029d7d793d2bac1b8181ac97020"
1797+
checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885"
17981798
dependencies = [
17991799
"cc",
18001800
"libc",
@@ -4345,6 +4345,7 @@ dependencies = [
43454345
"bitflags",
43464346
"rustc_data_structures",
43474347
"rustc_index",
4348+
"rustc_macros",
43484349
"rustc_serialize",
43494350
]
43504351

compiler/rustc_codegen_cranelift/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,14 @@ mod vtable;
8383
mod prelude {
8484
pub(crate) use std::convert::{TryFrom, TryInto};
8585

86-
pub(crate) use rustc_ast::ast::{FloatTy, IntTy, UintTy};
8786
pub(crate) use rustc_span::Span;
8887

8988
pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
9089
pub(crate) use rustc_middle::bug;
9190
pub(crate) use rustc_middle::mir::{self, *};
9291
pub(crate) use rustc_middle::ty::layout::{self, TyAndLayout};
9392
pub(crate) use rustc_middle::ty::{
94-
self, FnSig, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable,
93+
self, FloatTy, FnSig, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable, UintTy,
9594
};
9695
pub(crate) use rustc_target::abi::{Abi, LayoutOf, Scalar, Size, VariantIdx};
9796

compiler/rustc_codegen_llvm/src/builder.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,8 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
304304
lhs: Self::Value,
305305
rhs: Self::Value,
306306
) -> (Self::Value, Self::Value) {
307-
use rustc_ast::IntTy::*;
308-
use rustc_ast::UintTy::*;
309307
use rustc_middle::ty::{Int, Uint};
308+
use rustc_middle::ty::{IntTy::*, UintTy::*};
310309

311310
let new_kind = match ty.kind() {
312311
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.pointer_width)),

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+17-18
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::llvm::debuginfo::{
1818
};
1919
use crate::value::Value;
2020

21-
use rustc_ast as ast;
2221
use rustc_codegen_ssa::traits::*;
2322
use rustc_data_structures::const_cstr;
2423
use rustc_data_structures::fingerprint::Fingerprint;
@@ -830,37 +829,37 @@ trait MsvcBasicName {
830829
fn msvc_basic_name(self) -> &'static str;
831830
}
832831

833-
impl MsvcBasicName for ast::IntTy {
832+
impl MsvcBasicName for ty::IntTy {
834833
fn msvc_basic_name(self) -> &'static str {
835834
match self {
836-
ast::IntTy::Isize => "ptrdiff_t",
837-
ast::IntTy::I8 => "__int8",
838-
ast::IntTy::I16 => "__int16",
839-
ast::IntTy::I32 => "__int32",
840-
ast::IntTy::I64 => "__int64",
841-
ast::IntTy::I128 => "__int128",
835+
ty::IntTy::Isize => "ptrdiff_t",
836+
ty::IntTy::I8 => "__int8",
837+
ty::IntTy::I16 => "__int16",
838+
ty::IntTy::I32 => "__int32",
839+
ty::IntTy::I64 => "__int64",
840+
ty::IntTy::I128 => "__int128",
842841
}
843842
}
844843
}
845844

846-
impl MsvcBasicName for ast::UintTy {
845+
impl MsvcBasicName for ty::UintTy {
847846
fn msvc_basic_name(self) -> &'static str {
848847
match self {
849-
ast::UintTy::Usize => "size_t",
850-
ast::UintTy::U8 => "unsigned __int8",
851-
ast::UintTy::U16 => "unsigned __int16",
852-
ast::UintTy::U32 => "unsigned __int32",
853-
ast::UintTy::U64 => "unsigned __int64",
854-
ast::UintTy::U128 => "unsigned __int128",
848+
ty::UintTy::Usize => "size_t",
849+
ty::UintTy::U8 => "unsigned __int8",
850+
ty::UintTy::U16 => "unsigned __int16",
851+
ty::UintTy::U32 => "unsigned __int32",
852+
ty::UintTy::U64 => "unsigned __int64",
853+
ty::UintTy::U128 => "unsigned __int128",
855854
}
856855
}
857856
}
858857

859-
impl MsvcBasicName for ast::FloatTy {
858+
impl MsvcBasicName for ty::FloatTy {
860859
fn msvc_basic_name(self) -> &'static str {
861860
match self {
862-
ast::FloatTy::F32 => "float",
863-
ast::FloatTy::F64 => "double",
861+
ty::FloatTy::F32 => "float",
862+
ty::FloatTy::F64 => "double",
864863
}
865864
}
866865
}

compiler/rustc_codegen_llvm/src/type_.rs

+18-19
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ use crate::llvm;
77
use crate::llvm::{Bool, False, True};
88
use crate::type_of::LayoutLlvmExt;
99
use crate::value::Value;
10-
use rustc_ast as ast;
1110
use rustc_codegen_ssa::common::TypeKind;
1211
use rustc_codegen_ssa::traits::*;
1312
use rustc_data_structures::small_c_str::SmallCStr;
1413
use rustc_middle::bug;
1514
use rustc_middle::ty::layout::TyAndLayout;
16-
use rustc_middle::ty::Ty;
15+
use rustc_middle::ty::{self, Ty};
1716
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
1817
use rustc_target::abi::{AddressSpace, Align, Integer, Size};
1918

@@ -80,32 +79,32 @@ impl CodegenCx<'ll, 'tcx> {
8079
self.type_i8()
8180
}
8281

83-
crate fn type_int_from_ty(&self, t: ast::IntTy) -> &'ll Type {
82+
crate fn type_int_from_ty(&self, t: ty::IntTy) -> &'ll Type {
8483
match t {
85-
ast::IntTy::Isize => self.type_isize(),
86-
ast::IntTy::I8 => self.type_i8(),
87-
ast::IntTy::I16 => self.type_i16(),
88-
ast::IntTy::I32 => self.type_i32(),
89-
ast::IntTy::I64 => self.type_i64(),
90-
ast::IntTy::I128 => self.type_i128(),
84+
ty::IntTy::Isize => self.type_isize(),
85+
ty::IntTy::I8 => self.type_i8(),
86+
ty::IntTy::I16 => self.type_i16(),
87+
ty::IntTy::I32 => self.type_i32(),
88+
ty::IntTy::I64 => self.type_i64(),
89+
ty::IntTy::I128 => self.type_i128(),
9190
}
9291
}
9392

94-
crate fn type_uint_from_ty(&self, t: ast::UintTy) -> &'ll Type {
93+
crate fn type_uint_from_ty(&self, t: ty::UintTy) -> &'ll Type {
9594
match t {
96-
ast::UintTy::Usize => self.type_isize(),
97-
ast::UintTy::U8 => self.type_i8(),
98-
ast::UintTy::U16 => self.type_i16(),
99-
ast::UintTy::U32 => self.type_i32(),
100-
ast::UintTy::U64 => self.type_i64(),
101-
ast::UintTy::U128 => self.type_i128(),
95+
ty::UintTy::Usize => self.type_isize(),
96+
ty::UintTy::U8 => self.type_i8(),
97+
ty::UintTy::U16 => self.type_i16(),
98+
ty::UintTy::U32 => self.type_i32(),
99+
ty::UintTy::U64 => self.type_i64(),
100+
ty::UintTy::U128 => self.type_i128(),
102101
}
103102
}
104103

105-
crate fn type_float_from_ty(&self, t: ast::FloatTy) -> &'ll Type {
104+
crate fn type_float_from_ty(&self, t: ty::FloatTy) -> &'ll Type {
106105
match t {
107-
ast::FloatTy::F32 => self.type_f32(),
108-
ast::FloatTy::F64 => self.type_f64(),
106+
ty::FloatTy::F32 => self.type_f32(),
107+
ty::FloatTy::F64 => self.type_f64(),
109108
}
110109
}
111110

compiler/rustc_codegen_ssa/src/mir/block.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -875,20 +875,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
875875
ty::Uint(_) => value.to_string(),
876876
ty::Int(int_ty) => {
877877
match int_ty.normalize(bx.tcx().sess.target.pointer_width) {
878-
ast::IntTy::I8 => (value as i8).to_string(),
879-
ast::IntTy::I16 => (value as i16).to_string(),
880-
ast::IntTy::I32 => (value as i32).to_string(),
881-
ast::IntTy::I64 => (value as i64).to_string(),
882-
ast::IntTy::I128 => (value as i128).to_string(),
883-
ast::IntTy::Isize => unreachable!(),
878+
ty::IntTy::I8 => (value as i8).to_string(),
879+
ty::IntTy::I16 => (value as i16).to_string(),
880+
ty::IntTy::I32 => (value as i32).to_string(),
881+
ty::IntTy::I64 => (value as i64).to_string(),
882+
ty::IntTy::I128 => (value as i128).to_string(),
883+
ty::IntTy::Isize => unreachable!(),
884884
}
885885
}
886-
ty::Float(ast::FloatTy::F32) => {
887-
f32::from_bits(value as u32).to_string()
888-
}
889-
ty::Float(ast::FloatTy::F64) => {
890-
f64::from_bits(value as u64).to_string()
891-
}
886+
ty::Float(ty::FloatTy::F32) => f32::from_bits(value as u32).to_string(),
887+
ty::Float(ty::FloatTy::F64) => f64::from_bits(value as u64).to_string(),
892888
_ => span_bug!(span, "asm const has bad type {}", ty),
893889
};
894890
InlineAsmOperandRef::Const { string }

compiler/rustc_expand/src/base.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -929,15 +929,17 @@ pub struct ExtCtxt<'a> {
929929
pub force_mode: bool,
930930
pub expansions: FxHashMap<Span, Vec<String>>,
931931
/// Called directly after having parsed an external `mod foo;` in expansion.
932-
pub(super) extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate)>,
932+
///
933+
/// `Ident` is the module name.
934+
pub(super) extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate, Ident)>,
933935
}
934936

935937
impl<'a> ExtCtxt<'a> {
936938
pub fn new(
937939
sess: &'a Session,
938940
ecfg: expand::ExpansionConfig<'a>,
939941
resolver: &'a mut dyn ResolverExpand,
940-
extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate)>,
942+
extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate, Ident)>,
941943
) -> ExtCtxt<'a> {
942944
ExtCtxt {
943945
sess,

compiler/rustc_expand/src/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
14071407
proc_macros: vec![],
14081408
};
14091409
if let Some(extern_mod_loaded) = self.cx.extern_mod_loaded {
1410-
extern_mod_loaded(&krate);
1410+
extern_mod_loaded(&krate, ident);
14111411
}
14121412

14131413
*old_mod = krate.module;

compiler/rustc_infer/src/infer/combine.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use super::{InferCtxt, MiscVariable, TypeTrace};
3434

3535
use crate::traits::{Obligation, PredicateObligations};
3636

37-
use rustc_ast as ast;
3837
use rustc_data_structures::sso::SsoHashMap;
3938
use rustc_hir::def_id::DefId;
4039
use rustc_middle::traits::ObligationCause;
@@ -281,7 +280,7 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
281280
&self,
282281
vid_is_expected: bool,
283282
vid: ty::FloatVid,
284-
val: ast::FloatTy,
283+
val: ty::FloatTy,
285284
) -> RelateResult<'tcx, Ty<'tcx>> {
286285
self.inner
287286
.borrow_mut()

compiler/rustc_interface/src/passes.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use rustc_session::lint;
3333
use rustc_session::output::{filename_for_input, filename_for_metadata};
3434
use rustc_session::search_paths::PathKind;
3535
use rustc_session::Session;
36-
use rustc_span::symbol::Symbol;
36+
use rustc_span::symbol::{Ident, Symbol};
3737
use rustc_span::{FileName, RealFileName};
3838
use rustc_trait_selection::traits;
3939
use rustc_typeck as typeck;
@@ -211,8 +211,13 @@ pub fn register_plugins<'a>(
211211
Ok((krate, lint_store))
212212
}
213213

214-
fn pre_expansion_lint(sess: &Session, lint_store: &LintStore, krate: &ast::Crate) {
215-
sess.time("pre_AST_expansion_lint_checks", || {
214+
fn pre_expansion_lint(
215+
sess: &Session,
216+
lint_store: &LintStore,
217+
krate: &ast::Crate,
218+
crate_name: &str,
219+
) {
220+
sess.prof.generic_activity_with_arg("pre_AST_expansion_lint_checks", crate_name).run(|| {
216221
rustc_lint::check_ast_crate(
217222
sess,
218223
lint_store,
@@ -233,7 +238,7 @@ fn configure_and_expand_inner<'a>(
233238
metadata_loader: &'a MetadataLoaderDyn,
234239
) -> Result<(ast::Crate, Resolver<'a>)> {
235240
tracing::trace!("configure_and_expand_inner");
236-
pre_expansion_lint(sess, lint_store, &krate);
241+
pre_expansion_lint(sess, lint_store, &krate, crate_name);
237242

238243
let mut resolver = Resolver::new(sess, &krate, crate_name, metadata_loader, &resolver_arenas);
239244
rustc_builtin_macros::register_builtin_macros(&mut resolver);
@@ -295,7 +300,9 @@ fn configure_and_expand_inner<'a>(
295300
..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string())
296301
};
297302

298-
let extern_mod_loaded = |k: &ast::Crate| pre_expansion_lint(sess, lint_store, k);
303+
let extern_mod_loaded = |k: &ast::Crate, ident: Ident| {
304+
pre_expansion_lint(sess, lint_store, k, &*ident.name.as_str())
305+
};
299306
let mut ecx = ExtCtxt::new(&sess, cfg, &mut resolver, Some(&extern_mod_loaded));
300307

301308
// Expand macros now!

0 commit comments

Comments
 (0)