Skip to content

Rollup of 13 pull requests #81461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b43aa96
Print failure message on all tests that should panic, but don't
johanngan Jan 10, 2021
2624b3e
Improve diagnostics for Precise Capture
ChrisPardy Nov 23, 2020
3056dd0
fix tidy
ChrisPardy Jan 16, 2021
b8115b8
fix line numbers
ChrisPardy Jan 16, 2021
0724573
Move a few more types to `rustc_type_ir`
LeSeulArtichaut Dec 12, 2020
933bb18
Use `rustc_type_ir::{IntTy,UintTy,FloatTy} instead of the `rustc_ast`…
LeSeulArtichaut Dec 12, 2020
50e1ae1
Use ty::{IntTy,UintTy,FloatTy} in rustc
LeSeulArtichaut Dec 12, 2020
e0d64b9
Use ty::{IntTy,UintTy,FloatTy} in rustdoc and clippy
LeSeulArtichaut Dec 12, 2020
e25959b
Make more traits of the From/Into family diagnostic items
flip1995 Jan 22, 2021
3b8f1b7
Make `-Z time-passes` less noisy
jyn514 Jan 22, 2021
8a18fb0
Stabilize `Seek::stream_position` & change feature of `Seek::stream_len`
LukasKalbertodt Dec 19, 2020
ef3127d
Completely remove search query parameter when clearing search input
GuillaumeGomez Jan 25, 2021
09518db
Improve URL handling when clicking on a menu link while being on the …
GuillaumeGomez Jan 25, 2021
0959f0f
Tweak suggestion for missing field in patterns
estebank Jan 26, 2021
cf71d83
add tests
ChrisPardy Jan 26, 2021
b0625eb
boop, ur abstract consts are now expanded
BoxyUwU Jan 27, 2021
a7625f8
compiletest: Add two more unit tests
phansch Jan 27, 2021
582a171
add const_evaluatable_checked test
lcnr Jan 27, 2021
b519deb
const_evaluatable: stop looking into type aliases
lcnr Jan 27, 2021
f426177
comments
BoxyUwU Jan 27, 2021
ab421a1
fix tidy errors
BoxyUwU Jan 27, 2021
45484ec
Update cargo
ehuss Jan 27, 2021
025a850
Rollup merge of #70904 - LukasKalbertodt:stabilize-seek-convenience, …
JohnTitor Jan 28, 2021
446edd1
Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis
JohnTitor Jan 28, 2021
9822663
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…
JohnTitor Jan 28, 2021
84ad95b
Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=n…
JohnTitor Jan 28, 2021
70be5ce
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
JohnTitor Jan 28, 2021
bb6d1d3
Rollup merge of #81284 - jyn514:impl-times, r=wesleywiser
JohnTitor Jan 28, 2021
0b1870e
Rollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157
JohnTitor Jan 28, 2021
b8eac50
Rollup merge of #81416 - estebank:suggestion-span-tweak, r=petrochenkov
JohnTitor Jan 28, 2021
f183e5f
Rollup merge of #81426 - BoxyUwU:boxychangesv2, r=oli-obk
JohnTitor Jan 28, 2021
d56360d
Rollup merge of #81428 - phansch:compiletest-tests, r=Mark-Simulacrum
JohnTitor Jan 28, 2021
76548ba
Rollup merge of #81430 - lcnr:elaborate-const-eval, r=oli-obk
JohnTitor Jan 28, 2021
d98fcbd
Rollup merge of #81433 - lcnr:stop-looking-into-ty-alias, r=oli-obk
JohnTitor Jan 28, 2021
f3dfbfc
Rollup merge of #81445 - ehuss:update-cargo, r=ehuss
JohnTitor Jan 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"

[[package]]
name = "crates-io"
version = "0.31.1"
version = "0.33.0"
dependencies = [
"anyhow",
"curl",
Expand Down Expand Up @@ -1337,9 +1337,9 @@ dependencies = [

[[package]]
name = "git2"
version = "0.13.14"
version = "0.13.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "186dd99cc77576e58344ad614fa9bb27bad9d048f85de3ca850c1f4e8b048260"
checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986"
dependencies = [
"bitflags",
"libc",
Expand Down Expand Up @@ -1792,9 +1792,9 @@ dependencies = [

[[package]]
name = "libgit2-sys"
version = "0.12.16+1.1.0"
version = "0.12.18+1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f91b2f931ee975a98155195be8cd82d02e8e029d7d793d2bac1b8181ac97020"
checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885"
dependencies = [
"cc",
"libc",
Expand Down Expand Up @@ -4345,6 +4345,7 @@ dependencies = [
"bitflags",
"rustc_data_structures",
"rustc_index",
"rustc_macros",
"rustc_serialize",
]

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_cranelift/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@ mod vtable;
mod prelude {
pub(crate) use std::convert::{TryFrom, TryInto};

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

pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
pub(crate) use rustc_middle::bug;
pub(crate) use rustc_middle::mir::{self, *};
pub(crate) use rustc_middle::ty::layout::{self, TyAndLayout};
pub(crate) use rustc_middle::ty::{
self, FnSig, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable,
self, FloatTy, FnSig, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable, UintTy,
};
pub(crate) use rustc_target::abi::{Abi, LayoutOf, Scalar, Size, VariantIdx};

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
lhs: Self::Value,
rhs: Self::Value,
) -> (Self::Value, Self::Value) {
use rustc_ast::IntTy::*;
use rustc_ast::UintTy::*;
use rustc_middle::ty::{Int, Uint};
use rustc_middle::ty::{IntTy::*, UintTy::*};

let new_kind = match ty.kind() {
Int(t @ Isize) => Int(t.normalize(self.tcx.sess.target.pointer_width)),
Expand Down
35 changes: 17 additions & 18 deletions compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use crate::llvm::debuginfo::{
};
use crate::value::Value;

use rustc_ast as ast;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::const_cstr;
use rustc_data_structures::fingerprint::Fingerprint;
Expand Down Expand Up @@ -830,37 +829,37 @@ trait MsvcBasicName {
fn msvc_basic_name(self) -> &'static str;
}

impl MsvcBasicName for ast::IntTy {
impl MsvcBasicName for ty::IntTy {
fn msvc_basic_name(self) -> &'static str {
match self {
ast::IntTy::Isize => "ptrdiff_t",
ast::IntTy::I8 => "__int8",
ast::IntTy::I16 => "__int16",
ast::IntTy::I32 => "__int32",
ast::IntTy::I64 => "__int64",
ast::IntTy::I128 => "__int128",
ty::IntTy::Isize => "ptrdiff_t",
ty::IntTy::I8 => "__int8",
ty::IntTy::I16 => "__int16",
ty::IntTy::I32 => "__int32",
ty::IntTy::I64 => "__int64",
ty::IntTy::I128 => "__int128",
}
}
}

impl MsvcBasicName for ast::UintTy {
impl MsvcBasicName for ty::UintTy {
fn msvc_basic_name(self) -> &'static str {
match self {
ast::UintTy::Usize => "size_t",
ast::UintTy::U8 => "unsigned __int8",
ast::UintTy::U16 => "unsigned __int16",
ast::UintTy::U32 => "unsigned __int32",
ast::UintTy::U64 => "unsigned __int64",
ast::UintTy::U128 => "unsigned __int128",
ty::UintTy::Usize => "size_t",
ty::UintTy::U8 => "unsigned __int8",
ty::UintTy::U16 => "unsigned __int16",
ty::UintTy::U32 => "unsigned __int32",
ty::UintTy::U64 => "unsigned __int64",
ty::UintTy::U128 => "unsigned __int128",
}
}
}

impl MsvcBasicName for ast::FloatTy {
impl MsvcBasicName for ty::FloatTy {
fn msvc_basic_name(self) -> &'static str {
match self {
ast::FloatTy::F32 => "float",
ast::FloatTy::F64 => "double",
ty::FloatTy::F32 => "float",
ty::FloatTy::F64 => "double",
}
}
}
Expand Down
37 changes: 18 additions & 19 deletions compiler/rustc_codegen_llvm/src/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ use crate::llvm;
use crate::llvm::{Bool, False, True};
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use rustc_ast as ast;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_middle::bug;
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::Ty;
use rustc_middle::ty::{self, Ty};
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
use rustc_target::abi::{AddressSpace, Align, Integer, Size};

Expand Down Expand Up @@ -80,32 +79,32 @@ impl CodegenCx<'ll, 'tcx> {
self.type_i8()
}

crate fn type_int_from_ty(&self, t: ast::IntTy) -> &'ll Type {
crate fn type_int_from_ty(&self, t: ty::IntTy) -> &'ll Type {
match t {
ast::IntTy::Isize => self.type_isize(),
ast::IntTy::I8 => self.type_i8(),
ast::IntTy::I16 => self.type_i16(),
ast::IntTy::I32 => self.type_i32(),
ast::IntTy::I64 => self.type_i64(),
ast::IntTy::I128 => self.type_i128(),
ty::IntTy::Isize => self.type_isize(),
ty::IntTy::I8 => self.type_i8(),
ty::IntTy::I16 => self.type_i16(),
ty::IntTy::I32 => self.type_i32(),
ty::IntTy::I64 => self.type_i64(),
ty::IntTy::I128 => self.type_i128(),
}
}

crate fn type_uint_from_ty(&self, t: ast::UintTy) -> &'ll Type {
crate fn type_uint_from_ty(&self, t: ty::UintTy) -> &'ll Type {
match t {
ast::UintTy::Usize => self.type_isize(),
ast::UintTy::U8 => self.type_i8(),
ast::UintTy::U16 => self.type_i16(),
ast::UintTy::U32 => self.type_i32(),
ast::UintTy::U64 => self.type_i64(),
ast::UintTy::U128 => self.type_i128(),
ty::UintTy::Usize => self.type_isize(),
ty::UintTy::U8 => self.type_i8(),
ty::UintTy::U16 => self.type_i16(),
ty::UintTy::U32 => self.type_i32(),
ty::UintTy::U64 => self.type_i64(),
ty::UintTy::U128 => self.type_i128(),
}
}

crate fn type_float_from_ty(&self, t: ast::FloatTy) -> &'ll Type {
crate fn type_float_from_ty(&self, t: ty::FloatTy) -> &'ll Type {
match t {
ast::FloatTy::F32 => self.type_f32(),
ast::FloatTy::F64 => self.type_f64(),
ty::FloatTy::F32 => self.type_f32(),
ty::FloatTy::F64 => self.type_f64(),
}
}

Expand Down
20 changes: 8 additions & 12 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,20 +875,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
ty::Uint(_) => value.to_string(),
ty::Int(int_ty) => {
match int_ty.normalize(bx.tcx().sess.target.pointer_width) {
ast::IntTy::I8 => (value as i8).to_string(),
ast::IntTy::I16 => (value as i16).to_string(),
ast::IntTy::I32 => (value as i32).to_string(),
ast::IntTy::I64 => (value as i64).to_string(),
ast::IntTy::I128 => (value as i128).to_string(),
ast::IntTy::Isize => unreachable!(),
ty::IntTy::I8 => (value as i8).to_string(),
ty::IntTy::I16 => (value as i16).to_string(),
ty::IntTy::I32 => (value as i32).to_string(),
ty::IntTy::I64 => (value as i64).to_string(),
ty::IntTy::I128 => (value as i128).to_string(),
ty::IntTy::Isize => unreachable!(),
}
}
ty::Float(ast::FloatTy::F32) => {
f32::from_bits(value as u32).to_string()
}
ty::Float(ast::FloatTy::F64) => {
f64::from_bits(value as u64).to_string()
}
ty::Float(ty::FloatTy::F32) => f32::from_bits(value as u32).to_string(),
ty::Float(ty::FloatTy::F64) => f64::from_bits(value as u64).to_string(),
_ => span_bug!(span, "asm const has bad type {}", ty),
};
InlineAsmOperandRef::Const { string }
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,15 +929,17 @@ pub struct ExtCtxt<'a> {
pub force_mode: bool,
pub expansions: FxHashMap<Span, Vec<String>>,
/// Called directly after having parsed an external `mod foo;` in expansion.
pub(super) extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate)>,
///
/// `Ident` is the module name.
pub(super) extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate, Ident)>,
}

impl<'a> ExtCtxt<'a> {
pub fn new(
sess: &'a Session,
ecfg: expand::ExpansionConfig<'a>,
resolver: &'a mut dyn ResolverExpand,
extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate)>,
extern_mod_loaded: Option<&'a dyn Fn(&ast::Crate, Ident)>,
) -> ExtCtxt<'a> {
ExtCtxt {
sess,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
proc_macros: vec![],
};
if let Some(extern_mod_loaded) = self.cx.extern_mod_loaded {
extern_mod_loaded(&krate);
extern_mod_loaded(&krate, ident);
}

*old_mod = krate.module;
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_infer/src/infer/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use super::{InferCtxt, MiscVariable, TypeTrace};

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

use rustc_ast as ast;
use rustc_data_structures::sso::SsoHashMap;
use rustc_hir::def_id::DefId;
use rustc_middle::traits::ObligationCause;
Expand Down Expand Up @@ -281,7 +280,7 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
&self,
vid_is_expected: bool,
vid: ty::FloatVid,
val: ast::FloatTy,
val: ty::FloatTy,
) -> RelateResult<'tcx, Ty<'tcx>> {
self.inner
.borrow_mut()
Expand Down
17 changes: 12 additions & 5 deletions compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use rustc_session::lint;
use rustc_session::output::{filename_for_input, filename_for_metadata};
use rustc_session::search_paths::PathKind;
use rustc_session::Session;
use rustc_span::symbol::Symbol;
use rustc_span::symbol::{Ident, Symbol};
use rustc_span::{FileName, RealFileName};
use rustc_trait_selection::traits;
use rustc_typeck as typeck;
Expand Down Expand Up @@ -211,8 +211,13 @@ pub fn register_plugins<'a>(
Ok((krate, lint_store))
}

fn pre_expansion_lint(sess: &Session, lint_store: &LintStore, krate: &ast::Crate) {
sess.time("pre_AST_expansion_lint_checks", || {
fn pre_expansion_lint(
sess: &Session,
lint_store: &LintStore,
krate: &ast::Crate,
crate_name: &str,
) {
sess.prof.generic_activity_with_arg("pre_AST_expansion_lint_checks", crate_name).run(|| {
rustc_lint::check_ast_crate(
sess,
lint_store,
Expand All @@ -233,7 +238,7 @@ fn configure_and_expand_inner<'a>(
metadata_loader: &'a MetadataLoaderDyn,
) -> Result<(ast::Crate, Resolver<'a>)> {
tracing::trace!("configure_and_expand_inner");
pre_expansion_lint(sess, lint_store, &krate);
pre_expansion_lint(sess, lint_store, &krate, crate_name);

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

let extern_mod_loaded = |k: &ast::Crate| pre_expansion_lint(sess, lint_store, k);
let extern_mod_loaded = |k: &ast::Crate, ident: Ident| {
pre_expansion_lint(sess, lint_store, k, &*ident.name.as_str())
};
let mut ecx = ExtCtxt::new(&sess, cfg, &mut resolver, Some(&extern_mod_loaded));

// Expand macros now!
Expand Down
Loading