Skip to content
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

Rollup of 12 pull requests #78904

Merged
merged 31 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
34ff352
don't refer to async as 'generators'
SNCPlay42 Jul 21, 2020
5042dbd
add RegionNameHighlight::Occluded
SNCPlay42 Sep 8, 2020
301bb12
Enable LLVM Polly via llvm-args.
JRF63 Oct 30, 2020
1f5c655
Fix query cycle when tracing explicit_item_bounds
matthewjasper Oct 28, 2020
299a65f
Update chalk 0.32.0 -> 0.35.0
matthewjasper Oct 28, 2020
acb6a06
Fix various Chalk lowering bugs
matthewjasper Oct 28, 2020
4d60a80
Address review comment and update chalk to 0.36.0
matthewjasper Oct 29, 2020
3237b38
rustc_ast: Do not panic by default when visiting macro calls
petrochenkov Nov 3, 2020
90fafc8
rustc_ast: `visit_mac` -> `visit_mac_call`
petrochenkov Nov 3, 2020
53c1eb7
ci: demote i686-unknown-freebsd to tier 2 compiler target
pietroalbini Nov 4, 2020
3863dee
Infer the default host target from the host toolchain if possible
jyn514 Oct 29, 2020
f78f36c
Monomorphize a type argument of size-of operation during codegen
tmiasko Nov 7, 2020
103f7a4
fix `super_visit_with` for `Terminator`
lcnr Nov 7, 2020
d847299
Run tools builder on subtree changes
Mark-Simulacrum Nov 8, 2020
7ca6e8f
BTreeMap: fix pointer provenance rules, make borrowing explicit
ssomers Oct 28, 2020
b7f16c5
inliner: Make `inline_call` infallible
tmiasko Nov 6, 2020
dc4d74d
inliner: Break inlining cycles
tmiasko Nov 9, 2020
8d43b3c
Add `#[cfg(panic = "...")]`
davidhewitt Jul 25, 2020
61b52a3
use RegionNameHighlight for async fn and closure returns
SNCPlay42 Sep 8, 2020
46bce9f
Rollup merge of #74754 - davidhewitt:cfg-panic, r=ecstatic-morse
Dylan-DPC Nov 9, 2020
99f16e6
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
Dylan-DPC Nov 9, 2020
391136e
Rollup merge of #77016 - Mark-Simulacrum:clippy-tests, r=pietroalbini
Dylan-DPC Nov 9, 2020
2187f3c
Rollup merge of #78480 - ssomers:btree-alias, r=Mark-Simulacrum
Dylan-DPC Nov 9, 2020
0aed74a
Rollup merge of #78502 - matthewjasper:chalkup, r=nikomatsakis
Dylan-DPC Nov 9, 2020
62d3a4f
Rollup merge of #78513 - jyn514:rustup-toolchain, r=Mark-Simulacrum
Dylan-DPC Nov 9, 2020
7ac079f
Rollup merge of #78566 - JRF63:polly, r=Mark-Simulacrum
Dylan-DPC Nov 9, 2020
ee1fedf
Rollup merge of #78580 - tmiasko:inline-loop, r=oli-obk
Dylan-DPC Nov 9, 2020
8ebca24
Rollup merge of #78710 - petrochenkov:macvisit, r=davidtwco
Dylan-DPC Nov 9, 2020
4e0695b
Rollup merge of #78746 - pietroalbini:i686-freebsd, r=Mark-Simulacrum
Dylan-DPC Nov 9, 2020
7924ecc
Rollup merge of #78830 - lcnr:mir-folder, r=oli-obk
Dylan-DPC Nov 9, 2020
c150b93
Rollup merge of #78844 - tmiasko:monomorphize-sizeof, r=oli-obk
Dylan-DPC Nov 9, 2020
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ jobs:
- name: dist-i586-gnu-i586-i686-musl
os: ubuntu-latest-xl
env: {}
- name: dist-i686-freebsd
os: ubuntu-latest-xl
env: {}
- name: dist-i686-linux
os: ubuntu-latest-xl
env: {}
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "chalk-derive"
version = "0.32.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d072b2ba723f0bada7c515d8b3725224bc4f5052d2a92dcbeb0b118ff37084a"
checksum = "9f88ce4deae1dace71e49b7611cfae2d5489de3530d6daba5758043c47ac3a10"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -472,9 +472,9 @@ dependencies = [

[[package]]
name = "chalk-engine"
version = "0.32.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fb5475f6083d6d6c509e1c335c4f69ad04144ac090faa1afb134a53c3695841"
checksum = "0e34c9b1b10616782143d7f49490f91ae94afaf2202de3ab0b2835e78b4f0ccc"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand All @@ -485,19 +485,19 @@ dependencies = [

[[package]]
name = "chalk-ir"
version = "0.32.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f60cdb0e18c5455cb6a85e8464aad3622b70476018edfa8845691df66f7e9a05"
checksum = "63362c629c2014ab639b04029070763fb8224df136d1363d30e9ece4c8877da3"
dependencies = [
"chalk-derive",
"lazy_static",
]

[[package]]
name = "chalk-solve"
version = "0.32.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "981534d499a8476ecc0b520be4d3864757f96211826a75360fbf2cb6fae362ab"
checksum = "cac338a67af52a7f50bb2f8232e730a3518ce432dbe303246acfe525ddd838c7"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand Down
21 changes: 9 additions & 12 deletions compiler/rustc_ast/src/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,8 @@ pub trait MutVisitor: Sized {
noop_visit_local(l, self);
}

fn visit_mac(&mut self, _mac: &mut MacCall) {
panic!("visit_mac disabled by default");
// N.B., see note about macros above. If you really want a visitor that
// works on macros, use this definition in your trait impl:
// mut_visit::noop_visit_mac(_mac, self);
fn visit_mac_call(&mut self, mac: &mut MacCall) {
noop_visit_mac(mac, self);
}

fn visit_macro_def(&mut self, def: &mut MacroDef) {
Expand Down Expand Up @@ -494,7 +491,7 @@ pub fn noop_visit_ty<T: MutVisitor>(ty: &mut P<Ty>, vis: &mut T) {
vis.visit_id(id);
visit_vec(bounds, |bound| vis.visit_param_bound(bound));
}
TyKind::MacCall(mac) => vis.visit_mac(mac),
TyKind::MacCall(mac) => vis.visit_mac_call(mac),
}
vis.visit_span(span);
visit_lazy_tts(tokens, vis);
Expand Down Expand Up @@ -962,7 +959,7 @@ pub fn noop_visit_item_kind<T: MutVisitor>(kind: &mut ItemKind, vis: &mut T) {
vis.visit_generics(generics);
visit_bounds(bounds, vis);
}
ItemKind::MacCall(m) => vis.visit_mac(m),
ItemKind::MacCall(m) => vis.visit_mac_call(m),
ItemKind::MacroDef(def) => vis.visit_macro_def(def),
}
}
Expand Down Expand Up @@ -991,7 +988,7 @@ pub fn noop_flat_map_assoc_item<T: MutVisitor>(
visit_bounds(bounds, visitor);
visit_opt(ty, |ty| visitor.visit_ty(ty));
}
AssocItemKind::MacCall(mac) => visitor.visit_mac(mac),
AssocItemKind::MacCall(mac) => visitor.visit_mac_call(mac),
}
visitor.visit_span(span);
visit_lazy_tts(tokens, visitor);
Expand Down Expand Up @@ -1081,7 +1078,7 @@ pub fn noop_flat_map_foreign_item<T: MutVisitor>(
visit_bounds(bounds, visitor);
visit_opt(ty, |ty| visitor.visit_ty(ty));
}
ForeignItemKind::MacCall(mac) => visitor.visit_mac(mac),
ForeignItemKind::MacCall(mac) => visitor.visit_mac_call(mac),
}
visitor.visit_span(span);
visit_lazy_tts(tokens, visitor);
Expand Down Expand Up @@ -1121,7 +1118,7 @@ pub fn noop_visit_pat<T: MutVisitor>(pat: &mut P<Pat>, vis: &mut T) {
visit_vec(elems, |elem| vis.visit_pat(elem))
}
PatKind::Paren(inner) => vis.visit_pat(inner),
PatKind::MacCall(mac) => vis.visit_mac(mac),
PatKind::MacCall(mac) => vis.visit_mac_call(mac),
}
vis.visit_span(span);
visit_lazy_tts(tokens, vis);
Expand Down Expand Up @@ -1287,7 +1284,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
}
visit_vec(inputs, |(_c, expr)| vis.visit_expr(expr));
}
ExprKind::MacCall(mac) => vis.visit_mac(mac),
ExprKind::MacCall(mac) => vis.visit_mac_call(mac),
ExprKind::Struct(path, fields, expr) => {
vis.visit_path(path);
fields.flat_map_in_place(|field| vis.flat_map_field(field));
Expand Down Expand Up @@ -1350,7 +1347,7 @@ pub fn noop_flat_map_stmt_kind<T: MutVisitor>(
StmtKind::Empty => smallvec![StmtKind::Empty],
StmtKind::MacCall(mut mac) => {
let MacCallStmt { mac: mac_, style: _, attrs } = mac.deref_mut();
vis.visit_mac(mac_);
vis.visit_mac_call(mac_);
visit_thin_attrs(attrs, vis);
smallvec![StmtKind::MacCall(mac)]
}
Expand Down
23 changes: 9 additions & 14 deletions compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,8 @@ pub trait Visitor<'ast>: Sized {
fn visit_lifetime(&mut self, lifetime: &'ast Lifetime) {
walk_lifetime(self, lifetime)
}
fn visit_mac(&mut self, _mac: &'ast MacCall) {
panic!("visit_mac disabled by default");
// N.B., see note about macros above.
// if you really want a visitor that
// works on macros, use this
// definition in your trait impl:
// visit::walk_mac(self, _mac)
fn visit_mac_call(&mut self, mac: &'ast MacCall) {
walk_mac(self, mac)
}
fn visit_mac_def(&mut self, _mac: &'ast MacroDef, _id: NodeId) {
// Nothing to do
Expand Down Expand Up @@ -346,7 +341,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
visitor.visit_generics(generics);
walk_list!(visitor, visit_param_bound, bounds);
}
ItemKind::MacCall(ref mac) => visitor.visit_mac(mac),
ItemKind::MacCall(ref mac) => visitor.visit_mac_call(mac),
ItemKind::MacroDef(ref ts) => visitor.visit_mac_def(ts, item.id),
}
walk_list!(visitor, visit_attribute, &item.attrs);
Expand Down Expand Up @@ -414,7 +409,7 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) {
}
TyKind::Typeof(ref expression) => visitor.visit_anon_const(expression),
TyKind::Infer | TyKind::ImplicitSelf | TyKind::Err => {}
TyKind::MacCall(ref mac) => visitor.visit_mac(mac),
TyKind::MacCall(ref mac) => visitor.visit_mac_call(mac),
TyKind::Never | TyKind::CVarArgs => {}
}
}
Expand Down Expand Up @@ -532,7 +527,7 @@ pub fn walk_pat<'a, V: Visitor<'a>>(visitor: &mut V, pattern: &'a Pat) {
PatKind::Tuple(ref elems) | PatKind::Slice(ref elems) | PatKind::Or(ref elems) => {
walk_list!(visitor, visit_pat, elems);
}
PatKind::MacCall(ref mac) => visitor.visit_mac(mac),
PatKind::MacCall(ref mac) => visitor.visit_mac_call(mac),
}
}

Expand All @@ -557,7 +552,7 @@ pub fn walk_foreign_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a ForeignI
walk_list!(visitor, visit_ty, ty);
}
ForeignItemKind::MacCall(mac) => {
visitor.visit_mac(mac);
visitor.visit_mac_call(mac);
}
}
}
Expand Down Expand Up @@ -662,7 +657,7 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem,
walk_list!(visitor, visit_ty, ty);
}
AssocItemKind::MacCall(mac) => {
visitor.visit_mac(mac);
visitor.visit_mac_call(mac);
}
}
}
Expand Down Expand Up @@ -692,7 +687,7 @@ pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) {
StmtKind::Empty => {}
StmtKind::MacCall(ref mac) => {
let MacCallStmt { ref mac, style: _, ref attrs } = **mac;
visitor.visit_mac(mac);
visitor.visit_mac_call(mac);
for attr in attrs.iter() {
visitor.visit_attribute(attr);
}
Expand Down Expand Up @@ -823,7 +818,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
ExprKind::Ret(ref optional_expression) => {
walk_list!(visitor, visit_expr, optional_expression);
}
ExprKind::MacCall(ref mac) => visitor.visit_mac(mac),
ExprKind::MacCall(ref mac) => visitor.visit_mac_call(mac),
ExprKind::Paren(ref subexpression) => visitor.visit_expr(subexpression),
ExprKind::InlineAsm(ref ia) => {
for (op, _) in &ia.operands {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_passes/src/node_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ impl<'ast> Visitor<'ast> for NodeCounter {
self.count += 1;
walk_lifetime(self, lifetime)
}
fn visit_mac(&mut self, _mac: &MacCall) {
fn visit_mac_call(&mut self, mac: &MacCall) {
self.count += 1;
walk_mac(self, _mac)
walk_mac(self, mac)
}
fn visit_path(&mut self, path: &Path, _id: NodeId) {
self.count += 1;
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_ast_passes/src/show_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ impl<'a> Visitor<'a> for ShowSpanVisitor<'a> {
}
visit::walk_ty(self, t);
}

fn visit_mac(&mut self, mac: &'a ast::MacCall) {
visit::walk_mac(self, mac);
}
}

pub fn run(span_diagnostic: &rustc_errors::Handler, mode: &str, krate: &ast::Crate) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fn find_type_parameters(
visit::walk_ty(self, ty)
}

fn visit_mac(&mut self, mac: &ast::MacCall) {
fn visit_mac_call(&mut self, mac: &ast::MacCall) {
self.cx.span_err(mac.span(), "`derive` cannot be used on items with type macros");
}
}
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_builtin_macros/src/proc_macro_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> {
visit::walk_item(self, item);
self.in_root = prev_in_root;
}

fn visit_mac(&mut self, mac: &'a ast::MacCall) {
visit::walk_mac(self, mac)
}
}

// Creates a new module which looks like:
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_builtin_macros/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> {
}
smallvec![P(item)]
}

fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
// Do nothing.
}
}

// Beware, this is duplicated in librustc_passes/entry.rs (with
Expand Down Expand Up @@ -201,10 +197,6 @@ impl<'a> MutVisitor for EntryPointCleaner<'a> {

smallvec![item]
}

fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
// Do nothing.
}
}

/// Crawl over the crate, inserting test reexports and the test main function
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}

mir::Rvalue::NullaryOp(mir::NullOp::SizeOf, ty) => {
let ty = self.monomorphize(&ty);
assert!(bx.cx().type_is_sized(ty));
let val = bx.cx().const_usize(bx.cx().layout_of(ty).size.bytes());
let tcx = self.cx.tcx();
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,6 @@ impl<'a> MutVisitor for StripUnconfigured<'a> {
noop_flat_map_assoc_item(configure!(self, item), self)
}

fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
// Don't configure interpolated AST (cf. issue #34171).
// Interpolated AST will get configured once the surrounding tokens are parsed.
}

fn visit_pat(&mut self, pat: &mut P<ast::Pat>) {
self.configure_pat(pat);
noop_visit_pat(pat, self)
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {

visit::walk_item(self, item);
}

fn visit_mac(&mut self, _: &'ast ast::MacCall) {}
}

if !self.cx.ecfg.proc_macro_hygiene() {
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_expand/src/mbe/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq, NamedMatch};
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast::token::{self, NtTT, Token};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndSpacing};
use rustc_ast::MacCall;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use rustc_errors::{pluralize, PResult};
Expand All @@ -27,10 +26,6 @@ impl MutVisitor for Marker {
fn visit_span(&mut self, span: &mut Span) {
*span = span.apply_mark(self.0, self.1)
}

fn visit_mac(&mut self, mac: &mut MacCall) {
mut_visit::noop_visit_mac(mac, self)
}
}

/// An iterator over the token trees in a delimited token tree (`{ ... }`) or a sequence (`$(...)`).
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_expand/src/mut_visit/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::tests::{matches_codepattern, string_to_crate};

use rustc_ast as ast;
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast::mut_visit::MutVisitor;
use rustc_ast_pretty::pprust;
use rustc_span::symbol::Ident;
use rustc_span::with_default_session_globals;
Expand All @@ -21,9 +21,6 @@ impl MutVisitor for ToZzIdentMutVisitor {
fn visit_ident(&mut self, ident: &mut Ident) {
*ident = Ident::from_str("zz");
}
fn visit_mac(&mut self, mac: &mut ast::MacCall) {
mut_visit::noop_visit_mac(mac, self)
}
}

// Maybe add to `expand.rs`.
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_expand/src/placeholders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,4 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> {
|item| !matches!(item.kind, ast::ItemKind::MacCall(_) if !self.cx.ecfg.keep_macs),
);
}

fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
// Do nothing.
}
}
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ declare_features! (
/// Allows the use of destructuring assignments.
(active, destructuring_assignment, "1.49.0", Some(71126), None),

/// Enables `#[cfg(panic = "...")]` config key.
(active, cfg_panic, "1.49.0", Some(77443), None),

// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const GATED_CFGS: &[GatedCfg] = &[
),
(sym::sanitize, sym::cfg_sanitize, cfg_fn!(cfg_sanitize)),
(sym::version, sym::cfg_version, cfg_fn!(cfg_version)),
(sym::panic, sym::cfg_panic, cfg_fn!(cfg_panic)),
];

/// Find a gated cfg determined by the `pred`icate which is given the cfg's name.
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,12 +880,6 @@ impl<'a> MutVisitor for ReplaceBodyWithLoop<'a, '_> {
})
}
}

// in general the pretty printer processes unexpanded code, so
// we override the default `visit_mac` method which panics.
fn visit_mac(&mut self, mac: &mut ast::MacCall) {
noop_visit_mac(mac, self)
}
}

/// Returns a version string such as "rustc 1.46.0 (04488afe3 2020-08-24)"
Expand Down
Loading