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 18 pull requests #74401

Closed
wants to merge 75 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c4b0265
Enable some timeouts in SGX platform
mzohreva Jun 12, 2020
d7dc64b
Handle spurious wakeups in wait_timeout_sgx
mzohreva Jun 12, 2020
c5d1fcd
Allow more ui tests for SGX
mzohreva Jun 12, 2020
3442d23
Improve wait_timeout_sgx, simplify usercalls::wait
mzohreva Jun 18, 2020
fde8d11
Don't pollute docs/suggestions with libstd deps
alexcrichton Jun 17, 2020
99c1513
Small cleanup for E0705 explanation
GuillaumeGomez Jun 27, 2020
582071c
Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aa…
Jul 1, 2020
c457b67
Remove unnecessary check in SGX wait usercall
mzohreva Jul 1, 2020
69d5fc1
Clean up E0710 explanation
GuillaumeGomez Jun 28, 2020
9b6b400
Remove some `ignore-stage1` annotations.
ehuss Jul 3, 2020
95bf7b7
add regression test for #61216
euclio Jul 3, 2020
24abe16
Disable 44056 test with debug on macos.
ehuss Jul 9, 2020
1acccb0
Make hir ProjectionKind more precise
arora-aman Jul 2, 2020
9f91a95
Ignore changes when debug assertions are enabled.
ehuss Jul 9, 2020
1466598
Address review comments
mzohreva Jul 11, 2020
c3ee75d
rustdoc: glue tokens before highlighting
euclio Jun 27, 2020
f970632
Don't render unstable for rustc docs
tesuji Jul 15, 2020
47fea96
Remove unused CSS rules for internal rustc items
tesuji Jul 15, 2020
0f4e4a0
rustdoc: Rename internal API fns to `into_string`
tesuji Jul 15, 2020
a5275ff
Don't run everybody_loops for rustdoc
jyn514 Jun 20, 2020
b3187aa
Don't run analysis pass in rustdoc
jyn514 Jun 20, 2020
1b8accb
Add an option not to report resolution errors for rustdoc
jyn514 Jun 20, 2020
14a8707
Add `rustdoc` tests from #72088
ecstatic-morse Jun 7, 2020
768d6a4
Don't ICE on errors in function returning impl trait
jyn514 Jul 3, 2020
a93bcc9
Recurse into function bodies, but don't typeck closures
jyn514 Jul 9, 2020
d010443
Add test case for #65863
jyn514 Jul 9, 2020
cf844d2
Don't make typeck_tables_of public
jyn514 Jul 10, 2020
0cbc1cd
Avoid unnecessary enum
jyn514 Jul 10, 2020
3576f5d
Address review comments about code style
jyn514 Jul 10, 2020
bbe4971
Don't crash on Vec<DoesNotExist>
jyn514 Jul 10, 2020
2f29e69
Mention `cargo check` in help message
jyn514 Jul 10, 2020
763d373
Use tcx as the only context for visitor
jyn514 Jul 10, 2020
0759a55
Remove unnecessary lifetime parameter
jyn514 Jul 10, 2020
2d0e8e2
--bless
jyn514 Jul 10, 2020
02a24c8
Don't ICE on infinitely recursive types
jyn514 Jul 11, 2020
4c88070
Use mem::replace instead of rewriting it
jyn514 Jul 11, 2020
b2ff0e7
Fix comment
jyn514 Jul 11, 2020
ac9157b
EMPTY_MAP -> EMPTY_SET
jyn514 Jul 12, 2020
6eec9fb
Address review comments
jyn514 Jul 12, 2020
e117b47
Catch errors for any new item, not just trait implementations
jyn514 Jul 15, 2020
281ca13
Use the default providers in rustc_interface instead of adding our own
jyn514 Jul 15, 2020
703f680
Don't panic if the lhs of a div by zero is not statically known
oli-obk Jul 10, 2020
85c25ae
Move usercall_wait_timeout to abi::usercalls::wait_timeout
mzohreva Jul 15, 2020
1813ae7
Add RISC-V GNU/Linux to src/tools/build-manifest as a host platform
msizanoen1 Jul 16, 2020
338a271
forbid generic params in the type of const params
lcnr Jul 8, 2020
14a1031
add self dependent const param test
lcnr Jul 8, 2020
3f55840
relax Node lt bounds
lcnr Jul 9, 2020
6f5d8bf
don't supply generics to AnonConsts in param lists
lcnr Jul 9, 2020
0c511ab
update help message
lcnr Jul 16, 2020
01f5dd3
bless ui tests
lcnr Jul 16, 2020
f52039d
add regression test for #71169
lcnr Jul 16, 2020
09ba0bd
add regression test for #73491
lcnr Jul 16, 2020
ca253ca
Clean up or comment every unwrap in BTreeMap's main code.
ssomers Jul 13, 2020
b82d332
Separate off BTreeMap support functions and loose their irrelevant bo…
ssomers Jul 14, 2020
631b2b9
Remove unused lazy_static
jyn514 Jul 16, 2020
9bc922e
Bump to 1.47
Mark-Simulacrum Jul 16, 2020
aba1242
apply bootstrap cfgs
Mark-Simulacrum Jul 16, 2020
f4d71a8
Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogb
Manishearth Jul 16, 2020
7f12387
Rollup merge of #73566 - jyn514:name-resolve-first, r=eddyb
Manishearth Jul 16, 2020
d9ee217
Rollup merge of #73771 - alexcrichton:ignore-unstable, r=estebank,Gui…
Manishearth Jul 16, 2020
433669b
Rollup merge of #73794 - GuillaumeGomez:cleanup-e0705, r=Dylan-DPC
Manishearth Jul 16, 2020
2174099
Rollup merge of #73807 - euclio:rustdoc-highlighting, r=ollie27,Guill…
Manishearth Jul 16, 2020
537c5e0
Rollup merge of #73835 - GuillaumeGomez:cleanup-e0710, r=Dylan-DPC
Manishearth Jul 16, 2020
9cdc999
Rollup merge of #73926 - joaopaulocarreiro:github_rust-6, r=nikomatsakis
Manishearth Jul 16, 2020
7674ed9
Rollup merge of #73981 - ehuss:remove-ignore-stage1, r=nikomatsakis
Manishearth Jul 16, 2020
963966b
Rollup merge of #73998 - euclio:search-index-determinism, r=nikomatsakis
Manishearth Jul 16, 2020
2f074e0
Rollup merge of #74140 - sexxi-goose:precise_hir_projections, r=nikom…
Manishearth Jul 16, 2020
ea5affa
Rollup merge of #74159 - lcnr:const-generic-ty-decl, r=varkor
Manishearth Jul 16, 2020
6cd504d
Rollup merge of #74171 - ehuss:44056-debug-macos, r=nikomatsakis
Manishearth Jul 16, 2020
0879a7f
Rollup merge of #74221 - oli-obk:const_prop_ice, r=wesleywiser
Manishearth Jul 16, 2020
457e7c0
Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns,…
Manishearth Jul 16, 2020
7702ea2
Rollup merge of #74359 - lzutao:rustdoc-tostring, r=GuillaumeGomez
Manishearth Jul 16, 2020
79a9089
Rollup merge of #74386 - msizanoen1:riscv-add-manifest-host, r=pietro…
Manishearth Jul 16, 2020
a1936ba
Rollup merge of #74391 - ssomers:btree_refactor, r=Mark-Simulacrum
Manishearth Jul 16, 2020
828708d
Rollup merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini
Manishearth Jul 16, 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
26 changes: 21 additions & 5 deletions src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
@@ -484,7 +484,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
lint: &'static lint::Lint,
source_info: SourceInfo,
message: &'static str,
panic: AssertKind<ConstInt>,
panic: AssertKind<impl std::fmt::Debug>,
) -> Option<()> {
let lint_root = self.lint_root(source_info)?;
self.tcx.struct_span_lint_hir(lint, lint_root, source_info.span, |lint| {
@@ -1004,11 +1004,27 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
let expected = ScalarMaybeUninit::from(Scalar::from_bool(*expected));
let value_const = self.ecx.read_scalar(value).unwrap();
if expected != value_const {
enum DbgVal<T> {
Val(T),
Underscore,
}
impl<T: std::fmt::Debug> std::fmt::Debug for DbgVal<T> {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Val(val) => val.fmt(fmt),
Self::Underscore => fmt.write_str("_"),
}
}
}
let mut eval_to_int = |op| {
let op = self
.eval_operand(op, source_info)
.expect("if we got here, it must be const");
self.ecx.read_immediate(op).unwrap().to_const_int()
// This can be `None` if the lhs wasn't const propagated and we just
// triggered the assert on the value of the rhs.
match self.eval_operand(op, source_info) {
Some(op) => {
DbgVal::Val(self.ecx.read_immediate(op).unwrap().to_const_int())
}
None => DbgVal::Underscore,
}
};
let msg = match msg {
AssertKind::DivisionByZero(op) => {
11 changes: 7 additions & 4 deletions src/test/ui/const_prop/ice-assert-fail-div-by-zero.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// check-pass

// compile-flags: --crate-type lib

#![warn(unconditional_panic)]

pub struct Fixed64(i64);

pub fn div(f: Fixed64) {
f.0 / 0;
// HACK: this test passes only because this is a const fn that is written to metadata
pub const fn div(f: Fixed64) {
f.0 / 0; //~ WARN will panic at runtime
}

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/const_prop/ice-assert-fail-div-by-zero.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
warning: this operation will panic at runtime
--> $DIR/ice-assert-fail-div-by-zero.rs:11:5
|
LL | f.0 / 0;
| ^^^^^^^ attempt to divide _ by zero
|
note: the lint level is defined here
--> $DIR/ice-assert-fail-div-by-zero.rs:5:9
|
LL | #![warn(unconditional_panic)]
| ^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted