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 7 pull requests #69845

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7ca1b2f
Don't use static crt by default when build proc-macro.
12101111 Mar 3, 2020
7996df9
Run format.
12101111 Mar 3, 2020
89aebbd
Only run this test on musl
12101111 Mar 3, 2020
84349cc
Remove trailing whitespace.
12101111 Mar 3, 2020
a755d8d
Support type search for arguments and returned types
GuillaumeGomez Feb 23, 2020
612d375
Update JS results tester
GuillaumeGomez Feb 23, 2020
5892d0d
Add tests for new of variables
GuillaumeGomez Feb 23, 2020
71b9512
formatting
GuillaumeGomez Feb 23, 2020
6ffe9f3
Rename render::Type to improve naming
GuillaumeGomez Mar 3, 2020
f63b88c
Permit attributes on 'if' expressions
Aaron1011 Feb 16, 2020
e912d9d
Test #[allow(unused)] on `if` expression
Aaron1011 Feb 16, 2020
e9ec47b
Test that stmt_expr_attrs properly gates if-attrs
Aaron1011 Feb 19, 2020
9a299e4
Test trying to cfg-remove an `if` expression
Aaron1011 Feb 19, 2020
b00f674
Remove recovery test
Aaron1011 Feb 19, 2020
e11cdfd
Add run-pass test suggested by @joshtriplett
Aaron1011 Feb 19, 2020
7f19358
Move if-attr tests to their own directory
Aaron1011 Feb 19, 2020
1b681d6
Test that cfg-gated if-exprs are not type-checked
Aaron1011 Feb 19, 2020
37c2c38
Extent pretty-print test
Aaron1011 Feb 19, 2020
66b152c
Fix tabs
Aaron1011 Feb 19, 2020
e50fd5a
Update stderr
Aaron1011 Mar 4, 2020
22ee27b
update backtrace crate
RalfJung Mar 5, 2020
dbed65a
Simplify checking of crt_static_feature()
12101111 Mar 8, 2020
7a89bf1
override flags from compiletest
12101111 Mar 8, 2020
0468929
move error allocation test to error.rs
RalfJung Mar 4, 2020
938f852
miri validation: debug-complain about unexpected errors
RalfJung Mar 4, 2020
4971d03
fix some cases of unexpected exceptions leaving validation
RalfJung Mar 5, 2020
85e1466
Fix typo
RalfJung Mar 6, 2020
ed3014a
use static strings instead of tcx
RalfJung Mar 6, 2020
75e6cfc
run crt-static test on all target
12101111 Mar 9, 2020
58303b7
Use slices in preference to 0-terminated strings
tmiasko Mar 6, 2020
e54a829
Avoid unnecessary interning of enum variant part id
tmiasko Mar 6, 2020
676b9bc
unix: Don't override existing SIGSEGV/BUS handlers
cuviper Mar 3, 2020
7718ae3
Rollup merge of #69201 - Aaron1011:feature/permit-if-attr, r=Centril
Centril Mar 9, 2020
5ac1fba
Rollup merge of #69402 - GuillaumeGomez:extend-search, r=kinnison
Centril Mar 9, 2020
2f59631
Rollup merge of #69519 - 12101111:remove-proc-macro-check, r=nagisa,s…
Centril Mar 9, 2020
369afc8
Rollup merge of #69685 - cuviper:soft-segv, r=sfackler
Centril Mar 9, 2020
8301e32
Rollup merge of #69729 - RalfJung:backtrace, r=Mark-Simulacrum
Centril Mar 9, 2020
867104a
Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obk
Centril Mar 9, 2020
51ff921
Rollup merge of #69779 - tmiasko:di-cstr, r=nagisa
Centril Mar 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
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"

[[package]]
name = "backtrace"
version = "0.3.44"
version = "0.3.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536"
checksum = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8"
dependencies = [
"backtrace-sys",
"cfg-if",
Expand All @@ -135,9 +135,9 @@ dependencies = [

[[package]]
name = "backtrace-sys"
version = "0.1.32"
version = "0.1.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491"
checksum = "e17b52e737c40a7d75abca20b29a19a0eb7ba9fc72c5a72dd282a0a3c2c0dc35"
dependencies = [
"cc",
"compiler_builtins",
Expand Down
27 changes: 23 additions & 4 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fn print_backtrace(backtrace: &mut Backtrace) {
eprintln!("\n\nAn error occurred in miri:\n{:?}", backtrace);
}

impl From<ErrorHandled> for InterpErrorInfo<'tcx> {
impl From<ErrorHandled> for InterpErrorInfo<'_> {
fn from(err: ErrorHandled) -> Self {
match err {
ErrorHandled::Reported => err_inval!(ReferencedConstant),
Expand Down Expand Up @@ -291,7 +291,7 @@ pub enum InvalidProgramInfo<'tcx> {
Layout(layout::LayoutError<'tcx>),
}

impl fmt::Debug for InvalidProgramInfo<'tcx> {
impl fmt::Debug for InvalidProgramInfo<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use InvalidProgramInfo::*;
match self {
Expand Down Expand Up @@ -321,6 +321,8 @@ pub enum UndefinedBehaviorInfo {
RemainderByZero,
/// Overflowing inbounds pointer arithmetic.
PointerArithOverflow,
/// Invalid metadata in a wide pointer (using `str` to avoid allocations).
InvalidMeta(&'static str),
}

impl fmt::Debug for UndefinedBehaviorInfo {
Expand All @@ -338,6 +340,7 @@ impl fmt::Debug for UndefinedBehaviorInfo {
DivisionByZero => write!(f, "dividing by zero"),
RemainderByZero => write!(f, "calculating the remainder with a divisor of zero"),
PointerArithOverflow => write!(f, "overflowing in-bounds pointer arithmetic"),
InvalidMeta(msg) => write!(f, "invalid metadata in wide pointer: {}", msg),
}
}
}
Expand All @@ -354,8 +357,8 @@ pub enum UnsupportedOpInfo<'tcx> {
Unsupported(String),

/// When const-prop encounters a situation it does not support, it raises this error.
/// This must not allocate for performance reasons.
ConstPropUnsupported(&'tcx str),
/// This must not allocate for performance reasons (hence `str`, not `String`).
ConstPropUnsupported(&'static str),

// -- Everything below is not categorized yet --
FunctionAbiMismatch(Abi, Abi),
Expand Down Expand Up @@ -612,3 +615,19 @@ impl fmt::Debug for InterpError<'_> {
}
}
}

impl InterpError<'_> {
/// Some errors allocate to be created as they contain free-form strings.
/// And sometimes we want to be sure that did not happen as it is a
/// waste of resources.
pub fn allocates(&self) -> bool {
match self {
InterpError::MachineStop(_)
| InterpError::Unsupported(UnsupportedOpInfo::Unsupported(_))
| InterpError::Unsupported(UnsupportedOpInfo::ValidationFailure(_))
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_))
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::UbExperimental(_)) => true,
_ => false,
}
}
}
Loading