about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2020-03-06perf(dep_graph): Avoid allocating a set on when the number reads are smallMarkus Westerlind-2/+17
`reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd` benchmark which I believe is due to the number of reads are very low in many cases (see https://github.com/rust-lang/rust/pull/50565 for instance). This avoids allocating the set until we start allocating the `reads` `SmallVec` but it is possible that a lower limit might be better (not tested since the improvement will be hard to spot either way).
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-05Remove eh_unwind_resume lang itemAmanieu d'Antras-2/+1
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-03rename TraitItemKind::Method -> FnMark Mansi-9/+9
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-7/+7
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
2020-03-01Fix use of `has_infer_types`Matthew Jasper-5/+5
* Add a new method `has_infer_types_or_consts` that's used instead most of the time, since there's generally no reason to only consider types. * Remove use of `has_closure_types`, because closures are no longer implicitly linked to the `InferCtxt`.
2020-03-01use for (idx, item) in iter.enumerate() instead of manually counting loop ↵Matthias Krüger-4/+2
iterations by variables
2020-03-01`delay_span_bug` when codegen cannot select obligationEsteban Küber-1/+1
Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-03-01Auto merge of #69380 - Zoxc:parent-module, r=michaelwoeristerbors-12/+17
Use a query to get parent modules Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944. r? @michaelwoerister
2020-03-01Rollup merge of #69580 - matthiaskrgr:map_clone, r=CentrilYuki Okushi-2/+2
use .copied() instead of .map(|x| *x) on iterators
2020-03-01Auto merge of #69592 - petrochenkov:nosyntax, r=Centrilbors-43/+43
Rename `libsyntax` to `librustc_ast` This was the last rustc crate that wasn't following the `rustc_*` naming convention. Follow-up to https://github.com/rust-lang/rust/pull/67763.
2020-02-29Auto merge of #69590 - Dylan-DPC:rollup-i3z0sic, r=Dylan-DPCbors-2/+2
Rollup of 7 pull requests Successful merges: - #69504 (Use assert_ne in hash tests) - #69571 (remove unneeded .as_ref() calls.) - #69572 (use .iter() instead of .into_iter() on references) - #69581 (fix aliasing violation in align_to_mut) - #69582 (improve transmute and Vec::from_raw_parts docs) - #69584 (Correct comment to match behavior) - #69587 (rustc_parse: Tweak the function parameter name check) Failed merges: r? @ghost
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-40/+40
2020-02-29Rollup merge of #69572 - matthiaskrgr:try_err_and_iter_on_ref, r=CentrilDylan DPC-2/+2
use .iter() instead of .into_iter() on references
2020-02-29Make it build againVadim Petrochenkov-4/+4
2020-02-29Auto merge of #69263 - anyska:blacklist-powerpc-zst, r=nagisabors-7/+15
Blacklist powerpc-unknown-linux-{gnu,musl} as having non-ignored GNU C ZSTs. Ref #64259 (this is a simpler alternative to that). See also https://github.com/rust-lang/rust/pull/64259#issuecomment-585815831.
2020-02-29use .copied() instead of .map(|x| *x) on iteratorsMatthias Krüger-2/+2
2020-02-29Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPCbors-18/+18
Rollup of 6 pull requests Successful merges: - #69477 (docs: add mention of async blocks in move keyword docs) - #69504 (Use assert_ne in hash tests) - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.) - #69551 (use is_empty() instead of len() == x to determine if structs are empty.) - #69563 (Fix no_std detection for target triples) - #69567 (use .to_string() instead of format!() macro to create strings) Failed merges: r? @ghost
2020-02-29mem::zeroed/uninit: panic on types that do not permit zero-initializationRalf Jung-30/+0
2020-02-29Reduce visibility of `get_module_parent_node` and remove `get_module_parent`John Kåre Alsaker-8/+2
2020-02-29Add a `parent_module_from_def_id` queryJohn Kåre Alsaker-5/+16
2020-02-29Auto merge of #69255 - estebank:e0599-details, r=varkorbors-0/+14
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fix #52523, fix #61661, cc #36513, fix #68131, fix #64417, fix #61768, cc #57457, cc #9082, fix #57994, cc #64934, cc #65149.
2020-02-29use .iter() instead of .into_iter() on references.Matthias Krüger-2/+2