summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2020-04-03Ensure HAS_FREE_LOCAL_NAMES is set for ReFreeMatthew Jasper-26/+29
2020-03-10Rollup merge of #69714 - spastorino:place-ref-lifetime, r=oli-obkMazdak Farrokhzad-4/+4
Make PlaceRef take just one lifetime r? @eddyb
2020-03-10Rollup merge of #69475 - Zoxc:no-no-force, r=michaelwoeristerMazdak Farrokhzad-185/+140
Remove the `no_force` query attribute This removes the `no_force` query attribute and instead uses the `DepNodeParams` trait to find out if a query can be forced. Also the `analysis` query is moved to the query macro. r? @eddyb
2020-03-09Add a comment to `recover`.John Kåre Alsaker-0/+6
2020-03-09Remove the `no_force` query attributeJohn Kåre Alsaker-38/+0
2020-03-09Remove the need for `no_force`John Kåre Alsaker-117/+127
2020-03-09Move `analysis` to the query macroJohn Kåre Alsaker-30/+7
2020-03-09Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obkMazdak Farrokhzad-4/+23
Ensure that validity only raises validity errors For now, only as a debug-assertion (similar to const-prop detecting errors that allocate). Now includes https://github.com/rust-lang/rust/pull/69646. [Relative diff](https://github.com/RalfJung/rust/compare/layout-visitor...RalfJung:validity-errors). r? @oli-obk
2020-03-08use static strings instead of tcxRalf Jung-5/+5
2020-03-08Fix typoRalf Jung-2/+2
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2020-03-08fix some cases of unexpected exceptions leaving validationRalf Jung-5/+8
2020-03-08move error allocation test to error.rsRalf Jung-1/+17
2020-03-08Rollup merge of #69326 - JOE1994:os_str_widestring, r=RalfJungMazdak Farrokhzad-0/+10
mir-interpret: add method to read wide strings from Memory Implemented *step2* from [instructions](https://github.com/rust-lang/miri/issues/707#issuecomment-561564057) laid out in rust-lang/miri#707. Added 2 new methods to struct `rustc_mir::interpret::InterpCx`. * `read_os_str_from_wide_str` (src/librustc_mir/interpret/operand.rs) * `write_os_str_to_wide_str` (src/librustc_mir/interpret/place.rs) - used existing logic implemented in [MIRI/src/eval.rs](https://github.com/rust-lang/miri/blob/94732aaf7bf79fd01a4a48d11155c6586b937514/src/eval.rs#L132-L141) These methods are intended to be used for environment variable emulation in Windows.
2020-03-07Rollup merge of #69787 - spastorino:use-local-directly-its-copy, r=oli-obkMazdak Farrokhzad-5/+5
mir::Local is Copy we can pass it by value in these cases r? @oli-obk
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-10/+10
fix various typos
2020-03-07Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakisMazdak Farrokhzad-3/+0
Remove the `no_debug` feature Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779 r? @nikomatsakis
2020-03-07Rollup merge of #69782 - matthiaskrgr:redundant_field_name_rep, r=cramertjMazdak Farrokhzad-20/+17
Don't redundantly repeat field names (clippy::redundant_field_names)
2020-03-07Rollup merge of #69656 - matthiaskrgr:iter_nth_zero, r=oli-obkMazdak Farrokhzad-2/+2
Use .next() instead of .nth(0) on iterators.
2020-03-06mir-interpret: add method Memory::read wide_stringJOE1994-0/+10
2020-03-06mir::Local is Copy we can pass it by value in these casesSantiago Pastorino-5/+5
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-20/+17
2020-03-07Remove `NO_DEBUG` constYuki Okushi-3/+0
2020-03-06fix various typosMatthias Krüger-10/+10
2020-03-06Auto merge of #69614 - estebank:ice-age, r=davidtwcobors-1/+1
`delay_span_bug` when codegen cannot select obligation Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-03-05Auto merge of #69746 - Dylan-DPC:rollup-wr6dvdk, r=Dylan-DPCbors-22/+21
Rollup of 8 pull requests Successful merges: - #69697 (Add explanation for E0380) - #69698 (Use associated constants of integer types) - #69711 (Update macros.rs: fix documentation typo.) - #69713 (more clippy cleanups) - #69728 (Make link to `std::str` active) - #69732 (Clean E0382 and E0384 explanations) - #69736 (even more clippy cleanups) - #69742 (Fixed a typo) Failed merges: r? @ghost
2020-03-05Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPCDylan DPC-1/+1
even more clippy cleanups * Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed) * Use more efficient &&str to String conversion (clippy::inefficient_to_string) * Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call) * Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg) * Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator) * Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes) * Remove redundant patterns when matching ( x @ _ to x) (clippy::redundant_pattern)
2020-03-05Rollup merge of #69713 - matthiaskrgr:more_cleanup, r=cramertjDylan DPC-3/+3
more clippy cleanups * Don't use .ok() before unwrapping via .expect() on a Result. * Use .map() to modify data inside Options instead of using .and_then(|x| Some(y)) * Use .as_deref() instead of .as_ref().map(Deref::deref) * Don't use "if let" bindings to only check a value and not actually bind anything. * Use single-char patter on {ends,starts}_with and remove clone on copy type.
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-1/+1
it. (clippy::redundant_static_lifetimes)
2020-03-05Bumped version number for const_eval_limit in active.rsChristoph Schmidler-8/+6
and renamed 'recursion_limit' in limits.rs to simple 'limit' because it does handle other limits too.
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-3/+3
rename feature to const_eval_limit
2020-03-05Disable CTFE if const_limit was set to 0, otherwise use the value set, which ↵Christoph Schmidler-7/+7
defaults to 1_000_000
2020-03-05Prepare const_limit feature gate and attributeChristoph Schmidler-1/+2
2020-03-04PlaceRef<'a, 'tcx> -> PlaceRef<'tcx>Santiago Pastorino-4/+4
2020-03-04Use .map() to modify data inside Options instead of using .and_then(|x| ↵Matthias Krüger-3/+3
Some(y)) (clippy::option_and_then_some)
2020-03-04cover some more nearby casesRalf Jung-9/+8
2020-03-04use integer assoc consts instead of methodsRalf Jung-9/+9
2020-03-04Auto merge of #69550 - RalfJung:scalar, r=oli-obkbors-29/+15
interpret engine: Scalar cleanup * Remove `to_ptr` * Make `to_bits` private r? @oli-obk
2020-03-03Rollup merge of #69650 - matthiaskrgr:clnp, r=varkorDylan DPC-1/+1
cleanup more iterator usages (and other things) * Improve weird formatting by moving comment inside else-code block. * Use .any(x) instead of .find(x).is_some() on iterators. * Use .nth(x) instead of .skip(x).next() on iterators. * Simplify conditions like x + 1 <= y to x < y * Use let instead of match to get value of enum with single variant.
2020-03-03Rollup merge of #69621 - matthiaskrgr:q, r=petrochenkovDylan DPC-6/+3
use question mark operator in a few places.
2020-03-03Auto merge of #69482 - lqd:poloniusup, r=nikomatsakisbors-1/+1
Polonius: update `polonius-engine` to 0.12.0 Since @albins won't have the time to finish up #68993 for a while, I'll take care of the trivial remaining tasks (rebasing, taking care of tidy/rustfmt). I'll r? @nikomatsakis since they're assigned to #68993, but have actually [already reviewed it pre-rebase](https://github.com/rust-lang/rust/pull/68993#issuecomment-586413089). When CI passes: I'll notify bors and close #68993, since this PR supersedes it.
2020-03-03use question mark operator in a few places.Matthias Krüger-6/+3
2020-03-03Rollup merge of #69619 - matthiaskrgr:misc, r=eddybYuki Okushi-5/+3
more cleanups * use starts_with() instead of chars().next() == Some(x) * use subsec_micros() instead of subsec_nanos() / 1000 * use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables * use values() or keys() respectively when iterating only over keys or values of maps.
2020-03-03Use .next() instead of .nth(0) on iterators.Matthias Krüger-2/+2
2020-03-02Make PlaceRef lifetimes of Place::as_ref be both 'tcxSantiago Pastorino-1/+1
2020-03-03Simplify conditions like x + 1 <= y to x < yMatthias Krüger-1/+1
2020-03-02Remove chalk integrationCAD97-126/+0
2020-03-02use values() or keys() respectively when iterating only over keys or values ↵Matthias Krüger-1/+1
of maps.
2020-03-02Auto merge of #69469 - matthewjasper:type-flags, r=cramertjbors-92/+104
Clean up TypeFlags * Add a new method `has_infer_types_or_consts` that's used instead of `has_infer_types` most of the time, since there's generally no reason to only consider types. * Remove `has_closure_types`/`HAS_TY_CLOSURE`, because closures are no longer implicitly linked to the `InferCtxt`. * Reorder flags to group similar ones together * Make some flags more granular * Compute `HAS_FREE_LOCAL_NAMES` from the other flags * Add some more doc comments
2020-03-02Auto merge of #69432 - petrochenkov:alldeps, r=eddybbors-4/+1
rustc_metadata: Load metadata for indirect macro-only dependencies Imagine this dependency chain between crates ``` Executable crate -> Library crate -> Macro crate ``` where "Library crate" uses the macros from "Macro crate" for some code generation, but doesn't reexport them any further. Currently, when compiling "Executable crate" we don't even load metadata for it, because why would we want to load any metadata from "Macro crate" if it already did all its code generation job when compiling "Library crate". Right? Wrong! Hygiene data and spans (https://github.com/rust-lang/rust/issues/68686, https://github.com/rust-lang/rust/pull/68941) from "Macro crate" still may need to be decoded from "Executable crate". So we'll have to load them properly. Questions: - How this will affect compile times for larger crate trees in practice? How to measure it? Hygiene/span encoding/decoding will necessarily slow down compilation because right now we just don't do some work that we should do, but this introduces a whole new way to slow down things. E.g. loading metadata for `syn` (and its dependencies) when compiling your executable if one of its library dependencies uses it. - We are currently detecting whether a crate reexports macros from "Macro crate" or not, could we similarly detect whether a crate "reexports spans" and keep it unloaded if it doesn't? Or at least "reexports important spans" affecting hygiene, we can probably lose spans that only affect diagnostics.
2020-03-01Clean up TypeFlagsMatthew Jasper-87/+99
* Reorder flags to group similar ones together * Make some flags more granular * Compute `HAS_FREE_LOCAL_NAMES` from the other flags * Remove `HAS_TY_CLOSURE` * Add some more doc comments