| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Add a tidy check for files with over 3,000 lines
Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures.
This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`.
Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
|
|
|
|
This was left over from when closure copy and clone were gated behind
feature flags.
|
|
Function signatures with the `variadic` member set are actually
C-variadic functions. Make this a little more explicit by renaming the
`variadic` boolean value, `c_variadic`.
|
|
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
|
|
|
|
This preserves the error you currently get on stable for the
old-lub-glb-object.rs test.
|
|
This set of diffs was produced by combing through
b68fad670bb3612cac26e50751e4fd9150e59977 and seeing where the
`leak_check` used to be invoked and how.
|
|
|
|
Rename rustc_errors dependency in rust 2018 crates
I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.
Related: rust-lang/cargo#5653
cc #58099
r? @Centril
|
|
|
|
|
|
|
|
|
|
|
|
make trait-aliases work across crates
This is rebase of a small part of @alexreg's PR #55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects.
The stylistic edits I also rebased and can open a separate PR.
The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it.
Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working.
Fixes #56488.
Fixes #57023.
|
|
Fix stack overflow when finding blanket impls
Currently, SelectionContext tries to prevent stack overflow by keeping
track of the current recursion depth. However, this depth tracking is
only used when performing normal section (which includes confirmation).
No such tracking is performed for evaluate_obligation_recursively, which
can allow a stack overflow to occur.
To fix this, this commit tracks the current predicate evaluation depth.
This is done separately from the existing obligation depth tracking:
an obligation overflow can occur across multiple calls to 'select' (e.g.
when fulfilling a trait), while a predicate evaluation overflow can only
happen as a result of a deep recursive call stack.
Fixes #56701
I've re-used `tcx.sess.recursion_limit` when checking for predication evaluation overflows. This is such a weird corner case that I don't believe it's necessary to have a separate setting controlling the maximum depth.
|
|
|
|
Co-authored-by: Alexander Regueiro <alexreg@me.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Currently, SelectionContext tries to prevent stack overflow by keeping
track of the current recursion depth. However, this depth tracking is
only used when performing normal section (which includes confirmation).
No such tracking is performed for evaluate_obligation_recursively, which
can allow a stack overflow to occur.
To fix this, this commit tracks the current predicate evaluation depth.
This is done separately from the existing obligation depth tracking:
an obligation overflow can occur across multiple calls to 'select' (e.g.
when fulfilling a trait), while a predicate evaluation overflow can only
happen as a result of a deep recursive call stack.
Fixes #56701
|
|
|
|
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
|
|
should be a pure refactoring.
|
|
|
|
Remove the leak-check and its associated machinery. Replace with
making the solver aware of universes.
|
|
When we coerce `dyn Foo` to `dyn Bar`, that is OK as long as `Foo` is
usable in all contexts where `Bar` is usable (hence using the source
must be a subtype of the target).
This is needed for the universe-based code to handle
`old-lub-glb-object`; that test used to work sort of by accident
before with the old code.
|
|
|
|
Previously, evaluation ignored outlives relationships. Since we using
evaluation to skip the "normal" trait selection (which enforces
outlives relationships) this led to incorrect results in some cases.
|
|
|
|
|
|
|
|
|
|
The future-compat warnings break code that assumes that `dyn Send + Sync !=
dyn Sync + Send`, and are the first step in making them equal. cc #33140.
It should be possible to revert this commit when we're done with the
warnings.
|
|
|
|
|
|
|
|
|
|
|
|
refactor: use shorthand fields
refactor: use shorthand for single fields everywhere (excluding tests).
|
|
|
|
Implement trait aliases (RFC 1733)
Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733.
CC @durka @nikomatsakis
|
|
|