about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-10-21Fix `canonicalize_const_var` from leaking inference variables throughben-1/+1
it's type.
2019-10-21use unwrap_or in lint codeGuanqun Lu-5/+1
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-50/+47
It's a full conversion, except in `DefKey::compute_stable_hash()` where a `Symbol` now is converted to an `InternedString` before being hashed. This was necessary to avoid test failures.
2019-10-21Remove unnecessary `Hash` bounds from various types.Nicholas Nethercote-4/+4
2019-10-21Remove unnecessary trait bounds from `keys::Keys`.Nicholas Nethercote-7/+2
2019-10-21Convert `InternedString`s to `Symbols` in `UnsafetyViolation`.Nicholas Nethercote-3/+3
2019-10-21Convert some `InternedString`s to `Symbols`.Nicholas Nethercote-48/+48
This avoids the needs for various conversions, and makes the code slightly faster, because `Symbol` comparisons and hashing is faster.
2019-10-21Rollup merge of #65579 - skinny121:resolve_const_vars, r=varkorYuki Okushi-3/+6
Changed `resolve_type_vars_with_obligations` to also resolve const inference variables Fixes #65380 r? @varkor
2019-10-21Rollup merge of #65460 - sinkuu:contains_insert, r=varkorYuki Okushi-2/+1
Clean up `contains()` `insert()` chains on HashSet They can be merged to a single `insert()` call, which may avoid double-hashing/lookup of the value.
2019-10-20Rollup merge of #65595 - Centril:cfgspecs, r=Mark-SimulacrumMazdak Farrokhzad-772/+2
move `parse_cfgspecs` to `rustc_interface` Part of https://github.com/rust-lang/rust/pull/65324. r? @Mark-Simulacrum
2019-10-20also check the iterator is not too longRalf Jung-0/+2
2019-10-20miri add write_bytes method to Memory doing bounds-checks and supporting ↵Ralf Jung-2/+7
iterators
2019-10-20Fix resolve_type_vars_with_obligations not resolving const inferenceben-3/+6
variables.
2019-10-19Rollup merge of #65192 - estebank:restrict-bound, r=matthewjasperMazdak Farrokhzad-2/+180
Use structured suggestion for restricting bounds When a trait bound is not met and restricting a type parameter would make the restriction hold, use a structured suggestion pointing at an appropriate place (type param in param list or `where` clause). Account for opaque parameters where instead of suggesting extending the `where` clause, we suggest appending the new restriction: `fn foo(impl Trait + UnmetTrait)`. Fix #64565, fix #41817, fix #24354, cc #26026, cc #37808, cc #24159, fix #37138, fix #24354, cc #20671.
2019-10-19Rollup merge of #64007 - estebank:overlapping-patterns, r=matthewjasperMazdak Farrokhzad-0/+16
Add check for overlapping ranges to unreachable patterns lint Fix #63987.
2019-10-19move parse_cfgspecs to rustc_interfaceMazdak Farrokhzad-772/+2
2019-10-19Auto merge of #64890 - wesleywiser:const_prop_rvalue, r=oli-obkbors-3/+4
[const-prop] Handle remaining MIR Rvalue cases r? @oli-obk
2019-10-19Rollup merge of #65545 - nnethercote:more-symbol-cleanups, r=petrochenkovMazdak Farrokhzad-3/+3
More symbol cleanups Some minor improvements, mostly aimed at reducing unimportant differences between `Symbol` and `InternedString`. Helps a little with #60869. r? @petrochenkov
2019-10-19Rollup merge of #65252 - petrochenkov:deriveholders2, r=matthewjasperMazdak Farrokhzad-1/+1
expand: Simplify expansion of derives And make it more uniform with other macros. This is done by merging placeholders for future derives' outputs into the derive container's output fragment early (addressing FIXMEs from https://github.com/rust-lang/rust/pull/63667). Also, macros with names starting with `_` are no longer reported as unused, in accordance with the usual behavior of `unused` lints. r? @matthewjasper or @mark-i-m
2019-10-18Don't ICE when evaluating writes to uninhabited enum variantsWesley Wiser-3/+4
2019-10-19expand: Simplify expansion of derivesVadim Petrochenkov-1/+1
And make it more uniform with other macros. By merging placeholders for future derives' outputs into the derive container's output fragment early.
2019-10-18Rollup merge of #65535 - eddyb:sliced-predicates, r=nikomatsakisTyler Mandry-55/+34
rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct. While rebasing #59789 I noticed we can do this now. However, it doesn't help much without changing `inferred_outlives_of` to the same type, which I might try next.
2019-10-18Rollup merge of #65480 - nnethercote:rm-iterate_until_fixed_size, r=nikomatsakisTyler Mandry-27/+29
Speed up `LexicalResolve::expansion()` A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in #65425. r? @nikomatsakis
2019-10-18Rollup merge of #65472 - Zoxc:sharded-dep-graph-2, r=nikomatsakisTyler Mandry-8/+21
Use a sharded dep node to dep node index map Split out from https://github.com/rust-lang/rust/pull/61845 and based on https://github.com/rust-lang/rust/pull/63756. r? @nikomatsakis
2019-10-18Rollup merge of #65197 - spastorino:place-mut-visitor-adjusts2, r=oli-obkTyler Mandry-77/+136
Prepare `MutVisitor`s to handle interned projections The following are all the files where mir's `MutVisitor` is implemented. The `-` there stands for no changes, `visit_place` wasn't making any change on `Place`s. `x` stands for this file was changed to make `visit_place` do whatever it was doing with the base but avoid modifying the projection, instead just create a new one and assign to it. ``` [-] src/librustc_mir/transform/no_landing_pads.rs [x] src/librustc_mir/transform/promote_consts.rs [x] src/librustc_mir/transform/generator.rs [x] src/librustc_mir/transform/erase_regions.rs [-] src/librustc_mir/transform/instcombine.rs [x] src/librustc_mir/transform/inline.rs [x] src/librustc_mir/transform/simplify.rs [x] src/librustc_mir/util/def_use.rs [-] src/librustc_mir/transform/const_prop.rs [-] src/librustc_mir/transform/cleanup_post_borrowck.rs [x] src/librustc_mir/borrow_check/nll/renumber.rs [-] src/librustc_mir/transform/copy_prop.rs ``` There is some code repetition, just created the PR so we can start discussing it. /cc @oli-obk @nikomatsakis
2019-10-18Use Cow to handle modifications of projection in preparation for interningSantiago Pastorino-11/+22
2019-10-18Remove `Hash` impls for `DefPath`, `DisambiguatedDefPathData`, and `DefKey`.Nicholas Nethercote-3/+3
They aren't used.
2019-10-17Add process_* place hooks to improve code reutilizationSantiago Pastorino-3/+25
2019-10-17Setup a different visit place set of methods for mutable and immutable visitorsSantiago Pastorino-77/+103
In particular, use a blank visit_place for mutable visitor to be sure, non modified visitors are not trying to mutating place.
2019-10-18rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole ↵Eduard-Mihai Burtescu-55/+34
struct.
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-13/+17
Move to using Box<dyn Fn() -> ...> so that we can let plugins register state. This also adds a callback that'll get called from plugin registration so that Clippy and other tools can register lints without using the plugin API. The plugin API still works, but this new API is more compatible with drivers other than rustc.
2019-10-17Create lint store during plugin registrationMark Rousskov-15/+20
Remove lint store from Session
2019-10-17Remove all borrows of lint store from Session from librustcMark Rousskov-23/+29
Access through tcx is fine -- by that point, the lint store is frozen, but direct access through Session will go away in future commits, as lint store is still mutable in early stages of Session, and will be removed completely.
2019-10-17Access future incompatibility information directlyMark Rousskov-6/+1
Avoid querying LintStore when not necessary
2019-10-17Remove side table of future incompatibility infoMark Rousskov-72/+172
Moves this information to a direct field of Lint, which is where it belongs.
2019-10-17Make declare_lint take any amount of boolean fieldsMark Rousskov-10/+21
2019-10-17Move to storing constructor functions inside LintStoreMark Rousskov-33/+26
This stops storing the pass objects and instead stores constructor functions. The primary effect is that LintStore no longer has any interior mutability.
2019-10-17Take lint passes as constructor functionsMark Rousskov-8/+8
2019-10-17Make get_lints be a static functionMark Rousskov-30/+16
This moves from calling get_lints on instantiated pass objects to the raw object
2019-10-17No longer implicitly register lints when registering passesMark Rousskov-4/+0
This is in preparation for on-demand constructing passes
2019-10-17Split out just registration to separate functionMark Rousskov-27/+13
2019-10-17Split module and crate late pass registrationMark Rousskov-9/+9
2019-10-17Lints being from a plugin is dependent on the lint, not the registrationMark Rousskov-10/+12
2019-10-17Handle lints, not passes in push_lintsMark Rousskov-7/+5
This extracts the call to get_lints() to callers.
2019-10-17De-propagate optional session from lint registrationMark Rousskov-12/+5
This is straight up removing dead code, but is a separate commit from the previous to avoid conflating clean up and important changes.
2019-10-17Duplicate lint specifications are always bug!Mark Rousskov-20/+2
Replace early_error and sess.err with bug!, in all cases. If the compiler we're running with, including plugins, is registering something twice, that's a (compiler/plugin) programmer error -- we should not try to be nice at the cost of developer ergononomics (hiding the stacktrace of the second registration is bad). This also is basically a static bug in ~all cases so it should not be a detriment to users, including with plugins.
2019-10-17Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centrilbors-13/+14
Rollup of 8 pull requests Successful merges: - #65237 (Move debug_map assertions after check for err) - #65316 (make File::try_clone produce non-inheritable handles on Windows) - #65319 (InterpCx: make memory field public) - #65461 (Don't recommend ONCE_INIT in std::sync::Once) - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic) - #65475 (add example for type_name) - #65478 (fmt::Write is about string slices, not byte slices) - #65486 (doc: fix typo in OsStrExt and OsStringExt) Failed merges: r? @ghost
2019-10-17Auto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelixbors-6/+20
Optimize dropck This does two things: caches the `trivial_dropck` check by making it a query, and shifts around the implementation of the primary dropck itself to avoid allocating many small vectors.
2019-10-17Rollup merge of #65465 - Centril:split-syntax-1, r=petrochenkovMazdak Farrokhzad-13/+14
Move syntax::ext to a syntax_expand and refactor some attribute logic Part of https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-17Use a sharded dep node to dep node index mapJohn Kåre Alsaker-8/+21