| Age | Commit message (Collapse) | Author | Lines |
|
Don't ICE on missing `Unsize` impl
Previously code of the form
```rust
#![feature(unsize, dispatch_from_dyn)]
use std::marker::Unsize;
use std::ops::DispatchFromDyn;
pub struct Foo<'a, T: ?Sized> {
_inner: &'a &'a T,
}
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
```
would generate an ICE due to the missing `Unsize` impl being run through the `suggest_change_mut` suggestion. This PR adds an early exit and a pointer to the appropriate docs regarding `Unsize` instead:
```
error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied
--> src/test/ui/issues/issue-71036.rs:11:1
|
11 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unsize<&'a U>` is not implemented for `&'a T`
|
= note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information
= note: required because of the requirements on the impl of `std::ops::DispatchFromDyn<&'a &'a U>` for `&'a &'a T`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
```
r? @estebank
Resolves #71036
|
|
r=petrochenkov
add long error explanation for E0228
Add long explanation for the E0228 error code
Part of #61137
Let me know if this is wrong at all (or can be written more clearly), I'm still learning Rust.
|
|
Fix hang in lexical_region_resolve
Regionck was stuck in a loop where a region value was changing between two equal regions.
Closes #72051
|
|
Fix unused_parens false positive when using binary operations
Fixes #71290
r? @cuviper who provided instructions
|
|
|
|
Rollup of 12 pull requests
Successful merges:
- #71525 (`prefix` should not be mutable.)
- #71741 (Pointer printing: do not print 0 offset)
- #71870 (Be slightly more precise about any::type_name()'s guarantees.)
- #71909 (Document From trait for Option implementations)
- #71964 (Fix bootstrap failing on win32)
- #72137 (Clean up E0581 explanation)
- #72138 (Add doc comment for `rustc_middle::mir::mono::Linkage`)
- #72150 (Remove UnnormalizedProjection)
- #72151 (Update books)
- #72163 (docs: remove comment referencing non-existent method)
- #72169 (Clean up E0582 explanation)
- #72183 (Fix Arc::decr_strong_count doc test)
Failed merges:
r? @ghost
|
|
Remove UnnormalizedProjection
This was only used for the old chalk integration with chalk-engine
r? @nikomatsakis
|
|
Pointer printing: do not print 0 offset
r? @eddyb Cc @oli-obk
|
|
Modify SimplifyArmIdentity so it can trigger on mir-opt-level=1
I also added test cases to make sure the optimization can fire on all of
these cases:
```rust
fn case_1(o: Option<u8>) -> Option<u8> {
match o {
Some(u) => Some(u),
None => None,
}
}
fn case2(r: Result<u8, i32>) -> Result<u8, i32> {
match r {
Ok(u) => Ok(u),
Err(i) => Err(i),
}
}
fn case3(r: Result<u8, i32>) -> Result<u8, i32> {
let u = r?;
Ok(u)
}
```
Without MIR inlining, this still does not completely optimize away the
`?` operator because the `Try::into_result()`, `From::from()` and
`Try::from_error()` calls still exist. This does move us a bit closer to
that goal though because:
- We can now run the pass on mir-opt-level=1
- We no longer depend on the copy propagation pass running which is
unlikely to stabilize anytime soon.
Fixes #66855
|
|
Suggest adding super trait constraints
|
|
Process termination test for SGX
The issue is described in https://github.com/fortanix/rust-sgx/issues/109
cc @jethrogb
|
|
|
|
|
|
- Make the bound restriction suggestion `span_suggestion_verbose`.
- Fix whitespace typo.
|
|
|
|
|
|
strings do not have to be valid UTF-8 any more
Cc https://github.com/rust-lang/reference/pull/792
r? @oli-obk
|
|
Add strikethrough support to rustdoc
Implements uncontroversial part of #71183.
r? @GuillaumeGomez
|
|
|
|
|
|
I also added test cases to make sure the optimization can fire on all of
these cases:
```rust
fn case_1(o: Option<u8>) -> Option<u8> {
match o {
Some(u) => Some(u),
None => None,
}
}
fn case2(r: Result<u8, i32>) -> Result<u8, i32> {
match r {
Ok(u) => Ok(u),
Err(i) => Err(i),
}
}
fn case3(r: Result<u8, i32>) -> Result<u8, i32> {
let u = r?;
Ok(u)
}
```
Without MIR inlining, this still does not completely optimize away the
`?` operator because the `Try::into_result()`, `From::from()` and
`Try::from_error()` calls still exist. This does move us a bit closer to
that goal though because:
- We can now run the pass on mir-opt-level=1
- We no longer depend on the copy propagation pass running which is
unlikely to stabilize anytime soon.
|
|
Emit a warning when optimization fuel runs out
`eprintln!` gets swallowed by Cargo too easily.
|
|
display `ConstKind::Param`
|
|
Fix debug assertion in error code
Closes #70813
|
|
Deprecated emoji
Fixes #67872.
r? @kinnison
cc @rust-lang/rustdoc
|
|
|
|
Const prop aggregates even if partially or fully modified
r? @wesleywiser
cc @rust-lang/wg-mir-opt I'm moderately scared of this change, but I'm confident in having reviewed all the cases.
|
|
`eprintln!` gets swallowed by Cargo too easily.
|
|
Rollup of 4 pull requests
Successful merges:
- #71840 (Rework MIR drop tree lowering)
- #71882 (Update the `cc` crate)
- #71945 (Sort "implementations on foreign types" section in the sidebar)
- #72043 (Add missing backtick in E0569 explanation)
Failed merges:
r? @ghost
|
|
Rework MIR drop tree lowering
This PR changes how drops are generated in MIR construction. This is the first half of the fix for #47949.
Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later.
The motivation for this is
* It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state.
* The basic block order for MIR more closely resembles execution order.
This PR also:
* Highlights cleanup blocks in the graphviz MIR output.
* Removes some unnecessary drop flag assignments.
|
|
Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it
That's what all other `target_feature`s do.
|
|
Fix disagreeement about CGU reuse and LTO
This commit fixes an issue where the codegen backend's selection of LTO
disagreed with what the codegen later thought was being done. Discovered
in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in
optimized mode is compiled incrementally it will always panic on the
second compilation. The underlying issue turned out to be that the
production of the original artifact determined that LTO should not be
done (because it's being postponed to the linker) but the CGU reuse
selection thought that LTO was done so it was trying to load pre-LTO
artifacts which were never generated.
The fix here is to ensure that the logic when generating code which
determines what kind of LTO is being done is shared amongst the CGU
reuse decision and the backend actually doing LTO. This means that
they'll both be in agreement about whether the previous compilation did
indeed produce incremental pre-LTO artifacts.
Closes #72006
|
|
This commit fixes an issue where the codegen backend's selection of LTO
disagreed with what the codegen later thought was being done. Discovered
in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in
optimized mode is compiled incrementally it will always panic on the
second compilation. The underlying issue turned out to be that the
production of the original artifact determined that LTO should not be
done (because it's being postponed to the linker) but the CGU reuse
selection thought that LTO was done so it was trying to load pre-LTO
artifacts which were never generated.
The fix here is to ensure that the logic when generating code which
determines what kind of LTO is being done is shared amongst the CGU
reuse decision and the backend actually doing LTO. This means that
they'll both be in agreement about whether the previous compilation did
indeed produce incremental pre-LTO artifacts.
Closes #72006
|
|
Fix ICE for broken or-pattern in async fn
closes #71297
|
|
|
|
Remove ast::{Ident, Name} reexports.
The reexport of `Symbol` into `Name` confused me.
|
|
Move tests from `test/run-fail` to UI
Fixes #65440
cc #65865 #65506
r? @nikomatsakis
|
|
upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir
Reintegrate chalk into rustc.
r? @nikomatsakis
cc. @rust-lang/wg-traits
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #70834 (Add core::future::{pending,ready})
- #71839 (Make BTreeMap::new and BTreeSet::new const)
- #71890 (Simplify the error Registry methods a little)
- #71942 (Shrink `LocalDecl`)
- #71947 (Dead-code pass highlights too much of impl functions)
- #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation)
- #72018 (Fix canonicalization links)
- #72031 (Better documentation for io::Read::read() return value)
Failed merges:
r? @ghost
|
|
Dead-code pass highlights too much of impl functions
Fixes #66627.
Previous diagnostic:
```
error: method is never used: `unused_impl_fn_3`
--> src/main.rs:28:5
|
28 | / fn unused_impl_fn_3(
29 | | var: i32,
30 | | ) {
31 | | println!("bar {}", var);
32 | | }
| |_____^
```
New diagnostic:
```
error: associated function is never used: `unused_impl_fn_3`
--> $DIR/lint-dead-code-6.rs:13:8
|
LL | fn unused_impl_fn_3(
| ^^^^^^^^^^^^^^^^
```
This makes associated functions in line with free-standing functions.
|
|
Make BTreeMap::new and BTreeSet::new const
|
|
Renamed "undef" -> "uninit"
1. InvalidUndefBytes -> InvalidUninitBytes
2. ScalarMaybeUndef -> ScalarMaybeUninit
3. UndefMask -> InitMask
Related issue #71193
|
|
Test for zero-sized function items not ICEing
Closes #30276.
Again.
Please give rustcake with no icing!
|
|
|
|
|
|
|
|
Add const-generics test
Taken from #71973 as this apparently already compiles.
r? @varkor
|
|
|