about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-09-28Rollup merge of #64763 - GuillaumeGomez:long-err-explanation-E0734, r=estebankMazdak Farrokhzad-32/+59
Add E0734 and its long explanation Part of https://github.com/rust-lang/rust/issues/61137
2019-09-28Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasperMazdak Farrokhzad-18/+50
added more context for duplicate lang item errors (fixes #60561) Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one. It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging. I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way.
2019-09-28Rollup merge of #64387 - nathanwhit:redundant-semi-fix, r=varkorMazdak Farrokhzad-3/+64
Fix redundant semicolon lint interaction with proc macro attributes Fixes #63967 and fixes #63947, both of which were caused by the lint's changes to the parser interacting poorly with proc macro attributes and causing span information to be lost r? @varkor
2019-09-28Rollup merge of #64131 - shivan1b:deterministic-fxhashmap, r=Mark-SimulacrumMazdak Farrokhzad-0/+178
data_structures: Add deterministic FxHashMap and FxHashSet wrappers StableMap A wrapper for FxHashMap that allows to `insert`, `remove`, `get`, `get_mut` and convert a hashmap into a sorted vector using the method `into_sorted_vector` but no iteration support. StableSet A wrapper for FxHashSet that allows to `insert`, `remove`, `get` and convert a hashset into a sorted vector using the method `into_sorted_vector` but no iteration support. Addresses issue #63713
2019-09-29Add a couple more test cases, including non-ascii strings.ben-3/+16
2019-09-28Slice docs: fix typoAndre Bogus-1/+1
2019-09-28clean upEsteban Küber-16/+15
2019-09-28review commentsEsteban Küber-22/+28
2019-09-28Point at enclosing match when expecting `()` in armEsteban Küber-33/+158
When encountering code like the following: ```rust fn main() { match 3 { 4 => 1, 3 => { println!("Yep it maches."); 2 } _ => 2 } println!("Bye!") } ``` point at the enclosing `match` expression and suggest ignoring the returned value: ``` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:8:13 | LL | / match 3 { LL | | 4 => 1, LL | | 3 => { LL | | 2 | | ^ expected (), found integer LL | | } LL | | _ => 2 LL | | } | | -- help: consider using a semicolon here | |_____| | expected this to be `()` | = note: expected type `()` found type `{integer} ``` Fix #40799.
2019-09-28Fix typo in intrinsics op safetyMahmut Bulut-4/+4
2019-09-28Upgrade async/await to "used" keywords.Eric Huss-61/+61
2019-09-28Auto merge of #64419 - wesleywiser:const_prop_use_ecx, r=oli-obkbors-254/+425
Deduplicate some code between miri and const prop r? @oli-obk
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-461/+184
2019-09-28StableHasher does not need to be generic over the Result typeMark Rousskov-11/+7
2019-09-28rustc_codegen_ssa: remove redundant `va_list_ref` field from `FunctionCx`.Eduard-Mihai Burtescu-18/+8
2019-09-28rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures.Eduard-Mihai Burtescu-386/+295
2019-09-28rustc: don't store a lifetime in hir::TyKind::CVarArgs.Eduard-Mihai Burtescu-30/+18
2019-09-28syntax: don't keep a redundant c_variadic flag in the AST.Eduard-Mihai Burtescu-19/+22
2019-09-28Rename `sty` to `kind`Dylan MacKenzie-6/+6
Picks up changes made in #64513
2019-09-28Bless miri unleashed outputDylan MacKenzie-12/+5
2019-09-28Revert "Use conservative, type-based qualifcation for statics"Dylan MacKenzie-2/+3
This reverts commit ac7a343cef8287427a98b9210cdb1a772486be10.
2019-09-28Correct `IndirectlyMutableLocals` docsDylan MacKenzie-8/+4
2019-09-28Mask results from flow-sensitive resolver with `in_any_value_of_ty`Dylan MacKenzie-1/+19
We relied previously on the caller (e.g. `Q::in_operand`) to ignore `Local`s that were indirectly mutable (and thus assumed to be qualified). However, it's much clearer (and more efficient) to do this in the resolver itself. This does not yet remove the masking done in `Q::in_operand` and others for safety's sake, although I believe that should now be possible.
2019-09-28Add description for every module in `check_consts`Dylan MacKenzie-0/+17
2019-09-28Share `IndirectlyMutableLocals` results via referenceDylan MacKenzie-26/+35
2019-09-28Require `fmt::Debug` to implement `NonConstOp`Dylan MacKenzie-4/+4
2019-09-28Use conservative, type-based qualifcation for staticsDylan MacKenzie-3/+2
2019-09-28Return a `bool` from `in_any_value_of_ty`Dylan MacKenzie-20/+12
The `Option` was only used for the promotion qualifiers, so we can use a simpler API for validation.
2019-09-28Give usage instructions `IndirectlyMutableLocals` docsDylan MacKenzie-3/+7
2019-09-28Trigger ICE on nightly if validators disagreeDylan MacKenzie-2/+21
Also adds an unstable flag to disable the ICE (`-Zsuppress-const-validation-back-compat-ice`) so that nightly users do not have to revert to a previous nightly if their code causes disagreement between the validators.
2019-09-28Explain why `visit_terminator` does nothing for `IndirectlyMutableLocals`Dylan MacKenzie-0/+3
2019-09-28Move non-const ops into their own moduleDylan MacKenzie-337/+342
2019-09-28Remember to replace ICE with some form of warningDylan MacKenzie-1/+3
2019-09-28Add rationale for `suppress_errors` flagDylan MacKenzie-1/+3
2019-09-28Correct list of miri-supported operationsDylan MacKenzie-2/+2
Heap allocations are out, indirect `fn` calls are in!
2019-09-28Fix tests broken by more consistent miri unleashed warningsDylan MacKenzie-242/+82
2019-09-28Run new validator in compare modeDylan MacKenzie-28/+97
2019-09-28Add dataflow-based const validationDylan MacKenzie-0/+1292
2019-09-28Pass current qualification state in a separate parameterDylan MacKenzie-25/+36
2019-09-28Control whether a `Qualif` is cleared on moveDylan MacKenzie-0/+4
2019-09-28Remove reference to `Mode::NonConstFn` in qualifsDylan MacKenzie-16/+12
This should have no effect on behavior since the validator is never run in const contexts.
2019-09-28Add requisite imports and bitset to hold qualifsDylan MacKenzie-1/+19
2019-09-28Make new qualifs publicDylan MacKenzie-3/+3
2019-09-28Remove unnecessary methodDylan MacKenzie-10/+0
2019-09-28Copy `Qualif` to start work on new const validatorDylan MacKenzie-0/+271
This is an exact copy of the `Qualif` trait from `qualify_consts.rs` and its first two implementers, `HasMutInterior` and `NeedsDrop`.
2019-09-28Don't treat locals as mutably borrowed after they're droppedDylan MacKenzie-12/+5
2019-09-28Add analysis to determine if a local is indirectly mutableDylan MacKenzie-4/+157
This adds a dataflow analysis that determines if a reference to a given `Local` or part of a `Local` that would allow mutation exists before a point in the CFG. If no such reference exists, we know for sure that that `Local` cannot have been mutated via an indirect assignment or function call.
2019-09-28Add additional `const` testsDylan MacKenzie-0/+46
2019-09-28Silence "skipping const checks" if outside a const contextDylan MacKenzie-30/+6
2019-09-28Refactor into ban_nonexisting_field methodWojciech Baranowski-27/+37