| Age | Commit message (Collapse) | Author | Lines |
|
It's basically just a less capable version of `SmallVec`.
|
|
|
|
|
|
|
|
|
|
fix NLL ICEs
Custom type-ops reuse some of the query machinery -- but while query results are canonicalized after they are constructed, custom type ops are not, and hence we have to resolve the type variables to avoid an ICE here.
Also, use the type-op machinery for implied outlives bounds.
Fixes #53568
Fixes #52992
Fixes #53680
|
|
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()
|
|
tristanburgess:52985_diagnostics_no_concrete_type_behind_existential_type, r=oli-obk
52985 diagnostics no concrete type behind existential type
@oli-obk FYI. See below for new cycle error generated.
```rust
error[E0391]: cycle detected when processing `Foo`
--> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:3:1
|
3 | existential type Foo: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires processing `bar`...
--> /dev/staging/existential_type_no_concrete_type_nouse_potential.rs:6:23
|
6 | fn bar(x: Foo) -> Foo {
| _______________________^
7 | | x
8 | | }
| |_^
= note: ...which again requires processing `Foo`, completing the cycle
error: aborting due to previous error
For more information about this error, try `rustc --explain E0391`.
```
|
|
Fixes #52992
|
|
|
|
or "".into()
|
|
|
|
|
|
- Original cycle error diagnostics PR'd against this issue caught
panic-causing error while resolving std::mem::transmute calls
- Now, catch invalid use case of not providing a concrete sized type
behind existential type in definining use case.
- Update relevant test to reflect this new error
52985: revert normalize query changes
- PR 53588 invalidates 53316, causing a correct cycle error to occur
with a good span.
- Don't need to revert the whole merge as the test files are
still fine, just need to revert the normalize query changes.
- It should now be correct that infinite recursion detected during
normalize query type folding is a bug, should have been caught earlier
(when resolving the existential type's defining use cases).
52985: code review impl
- Only cause cycle error if anonymous type resolves to anonymous type
that has the same def id (is the same type) as the original (parent)
type.
- Add test case to cover this case for existential types.
52985: remove Ty prefix from TyAnon
- To align with changes per commit 6f637da50c56a22f745fd056691da8c86824cd9b
|
|
|
|
|
|
|
|
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
|
|
|
|
|
|
|
|
Fix typos found by codespell.
|
|
It's a ~1% win on `keccak` and `inflate`.
|
|
Rename CodeMap/FileMap to SourceMap/SourceFile
A first renaming for #51574
|
|
52985: cause cycle err on inf trait normalization
Issue: #52985
- If an existential type is defined, but no user code infers the
concrete type behind the existential type, normalization would
infinitely recurse on this existential type which is only defined in
terms of itself.
- Instead of raising an inf recurse error, we cause a cycle error to
help highlight that the issue is that the type is only defined in terms
of itself.
- Three known potential improvements:
- If type folding itself was exposed as a query, used by
normalization and other mechanisms, cases that would cause infinite recursion would
automatically cause a cycle error.
- The span for the cycle error should be improved to point to user
code that fails to allow inference of the concrete type of the existential type,
assuming that this error occurs because no user code can allow inference the
concrete type.
- A mechanism to extend the cycle error with a helpful note would be nice. Currently,
the error is built and maintained by src/librustc/ty/query/plumbing,
with no known way to extend the information that the error gets built
with.
r? @oli-obk
|
|
|
|
|
|
|
|
skip trivial `Sized` predicates
This came to about a 2% win for me in cargo. Small, but hey.
r? @eddyb
|
|
Implement Unsized Rvalues
This PR is the first step to implement RFC1909: unsized rvalues (#48055).
## Implemented
- `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`)
- Unsized locations are allowed in MIR
- Unsized places and operands are correctly translated at codegen
## Not implemented in this PR
- Additional `Sized` checks:
- tuple struct constructor (accidentally compiles now)
- closure arguments at closure generation (accidentally compiles now)
- upvars (ICEs now)
- Generating vtable for `fn method(self)` (ICEs now)
- VLAs: `[e; n]` where `n` isn't const
- Reduce unnecessary allocations
## Current status
- [x] Fix `__rust_probestack` (rust-lang-nursery/compiler-builtins#244)
- [x] Get the fix merged
- [x] `#![feature(unsized_locals)]`
- [x] Give it a tracking issue number
- [x] Lift sized checks in typeck and MIR-borrowck
- [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR
- [x] Minimum working codegen
- [x] Add more examples and fill in unimplemented codegen paths
- [ ] <del>Loosen object-safety rules (will be another PR)</del>
- [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del>
- [ ] <del>Reduce temporaries (will be another PR)</del>
|
|
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #52858 (Implement Iterator::size_hint for Elaborator.)
- #53321 (Fix usage of `wasm_target_feature`)
- #53326 ([nll] add regression test for issue #27868)
- #53347 (rustc_resolve: don't allow paths starting with `::crate`.)
- #53349 ([nll] add tests for #48697 and #30104)
- #53357 (Pretty print btreemap for GDB)
- #53358 (`{to,from}_{ne,le,be}_bytes` for unsigned integer types)
- #53406 (Do not suggest conversion method that is already there)
- #53407 (make more ported compile fail tests more robust w.r.t. NLL)
- #53413 (Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.)
- #53434 (wasm: Remove --strip-debug argument to LLD)
Failed merges:
r? @ghost
|
|
unions are not always trivially dropable
Fixes #52786
r? @nikomatsakis
|
|
|
|
Various changes to `rustc_on_unimplemented`
- Add `from_method` and `from_desugaring` to formatting options
- Change wording of errors slightly
|
|
fix error for unsized packed struct field
It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.
|
|
|
|
NLL - Prevent where clauses from extending the lifetime of bindings
Fixes https://github.com/rust-lang/rust/issues/53123
r? @nikomatsakis
|
|
|
|
- If an existential type is defined, but no user code infers the
concrete type behind the existential type, normalization would
infinitely recurse on this existential type which is only defined in
terms of itself.
- Instead of raising an inf recurse error, we cause a cycle error to
help highlight that the issue is that the type is only defined in terms
of itself.
- Three known potential improvements:
- If type folding itself was exposed as a query, used by
normalization and other mechanisms, cases that would cause infinite recursion would
automatically cause a cycle error.
- The span for the cycle error should be improved to point to user
code that fails to allow inference of the concrete type of the existential type,
assuming that this error occurs because no user code can allow inference the
concrete type.
- A mechanism to extend the cycle error with a helpful note would be nice. Currently,
the error is built and maintained by src/librustc/ty/query/plumbing,
with no known way to extend the information that the error gets built
with.
|
|
A few cleanups for rustc_data_structures
- remove a redundant `clone()`
- make some calls to `.iter()` implicit
- collapse/simplify a few operations
- remove some explicit `return`s
- make `SnapshotMap::{commit, rollback_to}` take references
- remove unnecessary struct field names
- change `transmute()`s in `IdxSet::{from_slice, from_slice_mut}` to casts
- remove some unnecessary lifetime annotations
- split 2 long literals
|
|
- Add `from_method` and `from_desugaring` to formatting options
- Change wording of errors slightly
|
|
Fixes #52786
|
|
|
|
|
|
|
|
|
|
|