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 #70085

Closed
wants to merge 56 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
14bcf0a
Fix Peekable::next_back
timvermeulen Feb 4, 2020
16a23e7
Fuse FlattenCompat's inner iterator
timvermeulen Feb 4, 2020
cdc7304
Compute the correct layout for variants of uninhabited enums and read…
oli-obk Mar 6, 2020
ec88ffa
Comment nits
oli-obk Mar 11, 2020
74608c7
Rustfmt and adjust capitalization
oli-obk Mar 11, 2020
f5efb68
miri: categorize errors into "unsupported" and "UB"
RalfJung Mar 8, 2020
d02543a
fmt, tweak messages and bless
RalfJung Mar 8, 2020
9a95b01
generalize InvalidNullPointerUsage to InvalidIntPointerUsage
RalfJung Mar 8, 2020
3ebcd78
fmt, and fix rustfmt-induced rebase hickup
RalfJung Mar 8, 2020
2764d3d
start Miri messages lower-case
RalfJung Mar 9, 2020
3e61442
explain why we catch PointerUseAfterFree
RalfJung Mar 9, 2020
d8f8168
avoid boolean inversion
RalfJung Mar 9, 2020
9681422
we are on 2018 edition, use try block
RalfJung Mar 9, 2020
93436d8
make error message less confusing
RalfJung Mar 9, 2020
e219dd4
fmt
RalfJung Mar 11, 2020
349fcb9
tidy: Use cargo_metadata for license checks.
ehuss Feb 24, 2020
3f45da0
tidy: Check if exceptions are no longer used.
ehuss Feb 24, 2020
be10f14
tidy: check the licenses don't change
ehuss Feb 24, 2020
bc738f2
tidy: Verify the runtime crates don't have license exceptions.
ehuss Feb 24, 2020
3c48c89
tidy: Add some clarifying comments in license checks.
ehuss Feb 24, 2020
2e46faa
tidy: Add `test` to RUNTIME_CRATES.
ehuss Feb 25, 2020
9a53cf3
tidy: Sort WHITELIST.
ehuss Feb 25, 2020
ed0158d
tidy: Remove chalk-engine/chalk-macros.
ehuss Mar 13, 2020
76c7144
Properly handle Spans that reference imported SourceFiles
Aaron1011 Feb 7, 2020
51ea260
rustc: don't resolve Instances which would produce malformed shims.
eddyb Feb 9, 2020
bc8ff3f
rustc: tweak comments on InstanceDef.
anyska Mar 11, 2020
b9167e6
Support type search for arguments and returned types
GuillaumeGomez Feb 23, 2020
2f44857
Update JS results tester
GuillaumeGomez Feb 23, 2020
e78c451
Add tests for new of variables
GuillaumeGomez Feb 23, 2020
5654cde
formatting
GuillaumeGomez Feb 23, 2020
d964e60
Rename render::Type to improve naming
GuillaumeGomez Mar 3, 2020
496256c
Update src/librustdoc/html/static/main.js
GuillaumeGomez Mar 9, 2020
9b85213
Add missing variable to load in non-std tester as well
GuillaumeGomez Mar 16, 2020
cff1182
Fix FlattenCompat::{next, next_back}
timvermeulen Feb 6, 2020
8cf33b0
Add tests
timvermeulen Feb 4, 2020
5a9ccc9
Remove `free_region_map` from `TypeckTables`
matthewjasper Nov 30, 2019
cefd030
Don't use `TypeckTables` in NiceRegionError
matthewjasper Feb 15, 2020
0a7f16e
Erase regions in writeback
matthewjasper Feb 15, 2020
1ee5829
Update tests for erasing regions in typeck
matthewjasper Feb 15, 2020
a4cbcb2
Fix abort-on-eprintln during process shutdown
alexcrichton Mar 12, 2020
773c04c
std: Don't abort process when printing panics in tests
alexcrichton Mar 12, 2020
3314a34
Don't unwind when hitting the macro expansion recursion limit
Zoxc Feb 26, 2020
bdaf9e4
Update test
Zoxc Feb 29, 2020
37bee6d
Allow `hir().find` to return `None`
Zoxc Mar 16, 2020
9825d5c
Rollup merge of #68915 - timvermeulen:non_fused_iter, r=Amanieu
Manishearth Mar 17, 2020
af55daf
Rollup merge of #68941 - Aaron1011:fix/imported-span, r=petrochenkov
Manishearth Mar 17, 2020
60f7aa1
Rollup merge of #69036 - eddyb:monoshim, r=nikomatsakis
Manishearth Mar 17, 2020
59e1a3d
Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakis
Manishearth Mar 17, 2020
b960a1b
Rollup merge of #69402 - GuillaumeGomez:extend-search, r=kinnison
Manishearth Mar 17, 2020
f4090a6
Rollup merge of #69443 - ehuss:tidy-license, r=skade,Mark-Simulacrum
Manishearth Mar 17, 2020
e80c8ad
Rollup merge of #69497 - Zoxc:ast-fragment-error, r=petrochenkov
Manishearth Mar 17, 2020
45ed7e1
Rollup merge of #69768 - oli-obk:union_field_ice, r=eddyb,RalfJung
Manishearth Mar 17, 2020
c74d524
Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obk
Manishearth Mar 17, 2020
d6f4e39
Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfackler
Manishearth Mar 17, 2020
63e67ce
Rollup merge of #69959 - alexcrichton:fix-panic-in-print, r=Mark-Simu…
Manishearth Mar 17, 2020
c0f826a
Rollup merge of #70051 - Zoxc:opt-find, r=eddyb
Manishearth Mar 17, 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
2 changes: 2 additions & 0 deletions src/librustc_expand/base.rs
Original file line number Diff line number Diff line change
@@ -921,6 +921,7 @@ pub struct ExpansionData {
pub struct ExtCtxt<'a> {
pub parse_sess: &'a ParseSess,
pub ecfg: expand::ExpansionConfig<'a>,
pub reduced_recursion_limit: Option<usize>,
pub root_path: PathBuf,
pub resolver: &'a mut dyn Resolver,
pub current_expansion: ExpansionData,
@@ -936,6 +937,7 @@ impl<'a> ExtCtxt<'a> {
ExtCtxt {
parse_sess,
ecfg,
reduced_recursion_limit: None,
root_path: PathBuf::new(),
resolver,
current_expansion: ExpansionData {
16 changes: 12 additions & 4 deletions src/librustc_expand/expand.rs
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ use rustc_ast::util::map_in_place::MapInPlace;
use rustc_ast::visit::{self, AssocCtxt, Visitor};
use rustc_ast_pretty::pprust;
use rustc_attr::{self as attr, is_builtin_attr, HasAttrs};
use rustc_errors::{Applicability, FatalError, PResult};
use rustc_errors::{Applicability, PResult};
use rustc_feature::Features;
use rustc_parse::configure;
use rustc_parse::parser::Parser;
@@ -645,7 +645,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
))
.emit();
self.cx.trace_macros_diag();
FatalError.raise();
}

/// A macro's expansion does not fit in this fragment kind.
@@ -665,8 +664,17 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
invoc: Invocation,
ext: &SyntaxExtensionKind,
) -> ExpandResult<AstFragment, Invocation> {
if self.cx.current_expansion.depth > self.cx.ecfg.recursion_limit {
self.error_recursion_limit_reached();
let recursion_limit =
self.cx.reduced_recursion_limit.unwrap_or(self.cx.ecfg.recursion_limit);
if self.cx.current_expansion.depth > recursion_limit {
if self.cx.reduced_recursion_limit.is_none() {
self.error_recursion_limit_reached();
}

// Reduce the recursion limit by half each time it triggers.
self.cx.reduced_recursion_limit = Some(recursion_limit / 2);

return ExpandResult::Ready(invoc.fragment_kind.dummy(invoc.span()));
}

let (fragment_kind, span) = (invoc.fragment_kind, invoc.span());
13 changes: 11 additions & 2 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
@@ -306,6 +306,8 @@ fn configure_and_expand_inner<'a>(
ecx.parse_sess.missing_fragment_specifiers.borrow().iter().cloned().collect();
missing_fragment_specifiers.sort();

let recursion_limit_hit = ecx.reduced_recursion_limit.is_some();

for span in missing_fragment_specifiers {
let lint = lint::builtin::MISSING_FRAGMENT_SPECIFIER;
let msg = "missing fragment specifier";
@@ -314,8 +316,15 @@ fn configure_and_expand_inner<'a>(
if cfg!(windows) {
env::set_var("PATH", &old_path);
}
krate
});

if recursion_limit_hit {
// If we hit a recursion limit, exit early to avoid later passes getting overwhelmed
// with a large AST
Err(ErrorReported)
} else {
Ok(krate)
}
})?;

sess.time("maybe_building_test_harness", || {
rustc_builtin_macros::test_harness::inject(
2 changes: 1 addition & 1 deletion src/test/ui/macros/trace_faulty_macros.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ macro_rules! pat_macro {
pat_macro!(A{a:a, b:0, c:_, ..});
};
($a:pat) => {
$a
$a //~ ERROR expected expression
};
}

13 changes: 12 additions & 1 deletion src/test/ui/macros/trace_faulty_macros.stderr
Original file line number Diff line number Diff line change
@@ -49,5 +49,16 @@ LL | my_recursive_macro!();
= note: expanding `my_recursive_macro! { }`
= note: to `my_recursive_macro ! () ;`

error: aborting due to 2 previous errors
error: expected expression, found `A { a: a, b: 0, c: _, .. }`
--> $DIR/trace_faulty_macros.rs:16:9
|
LL | $a
| ^^ expected expression
...
LL | let a = pat_macro!();
| ------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors