| Age | Commit message (Collapse) | Author | Lines |
|
We only want to load this auxiliary crate from a proc-macro, so that it
only ever needs to get built for the host platform.
|
|
This is a very obscure corner case, and should never be hit in practice.
|
|
|
|
|
|
Ensure stack when type checking and building MIR for large if expressions
Fixes #74564
|
|
This is important for fields, which are incorrectly referred to as
"items".
|
|
We were missing an Instance::resolve_for_fn_ptr in resolve_for_vtable.
Closes #74764.
|
|
|
|
|
|
|
|
|
|
|
|
Remove trait LengthAtMost32
This is a continuation of https://github.com/rust-lang/rust/pull/74026 preserving the original burrbull's commit.
I talked to @burrbull, he suggested me to finish his PR.
|
|
Use the proper span when WF-checking an impl self type
|
|
Normalize bounds fully when checking defaulted types
When checking that the default type for `<T as X>::Y` is valid in this example:
```
trait X { type Y: PartialEq<<Self as X>::Y> }
impl X for T { default type Y = S; }
```
We will have to prove the bound `S: PartialEq<<T as X>::Y>`. In this case
we want `<T as X>::Y` to normalize to `S`. This is valid because we are
checking the default value specifically here. Add `<T as X>::Y = S` to the
ParamEnv for normalization _of the bound we are checking_ only.
Fixes #73818.
---
I noticed that adding this to the env for bounds checking didn't break any tests. Not sure if this is because we can't rely on it to prove anything, or because of missing test coverage.
r? @matthewjasper, @nikomatsakis
|
|
|
|
|
|
Detect turbofish missing surrounding angle brackets
Fix #74065.
|
|
|
|
|
|
|
|
|
|
fixed error reporting for mismatched traits
mismatched traits were previously referred to as types
closes #72217
|
|
Optimize away BitAnd and BitOr when possible
This PR lets `const_prop` optimize away `a | true == true` , `a & false == false` and `a * 0 = 0`. While I was writing this I've realized that constant propagation misses a lot of opportunities. For example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2a4b45e772f214210a36749b27223bb0
Constant propagation doesn't seem to... propagate constants, additionally the way constant propagation is currently setup makes it tricky to add cases like `a | false == a`.
I tried to organize `eval_rvalue_with_identities` to make the pattern of the optimizations easier to see but it still obscurs what should be a simple peephole optmization.
cc @oli-obk
|
|
correctly deal with unsorted generic parameters
We now stop sorting generic params and instead correctly handle unsorted params in the rest of the compiler.
We still restrict const params to come after type params though, so this PR does not change anything which
is visible to users.
This might slightly influence perf, so let's prevent any unintentional rollups. @bors rollup=never
r? @varkor
|
|
Fix ICE while building MIR with type errors
See https://github.com/rust-lang/rust/issues/74047#issuecomment-663290913 for background. Replacing a binding with `PatKind::Wild` (introduced in #51789 and later refactored in #67439) caused an ICE downstream while building MIR.
I noticed that taking this code out no longer triggers the ICEs it was added to prevent. I'm not sure what else changed, or if this change is _correct_, but it does seem to be passing ui tests at least.
r? @oli-obk
cc @estebank
Fixes #74047.
|
|
Add missing backticks in diagnostics note
|
|
Don't ICE on unconstrained anonymous lifetimes inside associated types.
Fixes #62200. The change here is inspired (copied) by how this case is handled on bare fns at https://github.com/rust-lang/rust/blob/e8b55a4ad230ebec762fdfc4f241ba98a98560af/src/librustc_typeck/astconv.rs#L3083-L3106.
|
|
polymorphize GlobalAlloc::Function
this sadly does not change #74614
r? @eddyb
|
|
Internally unify rustc_deprecated and deprecated
This PR intentionally tries to be "featureless" in that the behavior is not altered for either attribute, though it more clearly exposes cases where that is the case in the code.
|
|
Fixes #74047.
|
|
|
|
|
|
|
|
Use `ReEmpty(U0)` as the implicit region bound in typeck
Fixes #74429
r? @nikomatsakis
|
|
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #74141 (libstd/libcore: fix various typos)
- #74490 (add a Backtrace::disabled function)
- #74548 (one more Path::with_extension example, to demonstrate behavior)
- #74587 (Prefer constant over function)
- #74606 (Remove Linux workarounds for missing CLOEXEC support)
- #74637 (Make str point to primitive page)
- #74654 (require type defaults to be after const generic parameters)
- #74659 (Improve codegen for unchecked float casts on wasm)
Failed merges:
r? @ghost
|
|
|
|
|
|
require type defaults to be after const generic parameters
From current discussions it seems like the goal here is for type and const parameters to be unordered and allow things like `struct Foo<const N: usize, T = u32>(T)` and `struct Foo<T, const N: usize = 7>` this way.
Note: This means that using `min_const_generics` it will not be possible for an adt to have both type defaults and const parameters.
closes #70471
r? @varkor @eddyb
|
|
Revert "Compare tagged/niche-filling layout and pick the best one"
Reverts rust-lang/rust#74069. It caused a performance regression, see https://github.com/rust-lang/rust/pull/74069#issuecomment-662166827. perf: https://perf.rust-lang.org/compare.html?start=d3df8512d2c2afc6d2e7d8b5b951dd7f2ad77b02&end=cfade73820883adf654fe34fd6b0b03a99458a51
r? @eddyb
cc @nnethercote
|
|
|
|
Co-authored-by: varkor <github@varkor.com>
|
|
|
|
Do not ICE on assoc type with bad placeholder
Fixes #74612
r? @estebank
|
|
Guard against non-monomorphized type_id intrinsic call
This PR checks whether the type is sufficient monomorphized when calling type_id or type_name intrinsics. If the type is not sufficiently monomorphized, e.g. used in a pattern, the code will be rejected.
Fixes #73976
|
|
Detect when `'static` obligation might come from an `impl`
Partly address #71341.
|
|
as if this is currently possible. HA!
|