| Age | Commit message (Collapse) | Author | Lines |
|
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.
|
|
|
|
|
|
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
|
|
`eprintln!` gets swallowed by Cargo too easily.
|
|
Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it
That's what all other `target_feature`s do.
|
|
Fix ICE for broken or-pattern in async fn
closes #71297
|
|
|
|
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
|
|
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
|
|
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
|
|
|
|
|
|
|
|
Fix E0284 to not use incorrect wording
Fix #71584, fix #69683.
|
|
reword "possible candidate" import suggestion
This suggestion has always read a bit awkwardly to me, particularly the "possible better candidate" variant.
This commit rewords the suggestion to be more concise and mention the kind of the suggested item. There isn't a nice way to label individual suggestions, so I opted to use "items" in the case of multiple suggestions.
|
|
Detect errors caused by `async` block in 2015 edition
Fix #67204.
|
|
Fix #71584, fix #69683.
|
|
use hex for pointers in Miri error messages
Also refine vtable error message: distinguish between "drop fn does not point to a function" and "drop fn points to a function with the wrong signature".
|
|
Add some regression tests
Closes #29988
Closes #34979
Pick up two snippets that have been fixed from #67945 (shouldn't be closed yet!)
|
|
|
|
|
|
|
|
|
|
Miri validation error handling cleanup
Slightly expand @jumbatm's pattern macro and use it throughout validation. This ensures we never incorrectly swallow `InvalidProgram` errors or ICE when they occur.
Fixes https://github.com/rust-lang/rust/issues/71353
r? @oli-obk
|
|
Provide suggestions for type parameters missing bounds for associated types
When implementing the binary operator traits it is easy to forget to restrict the `Output` associated type. `rustc` now accounts for different cases to lead users in the right direction to add the necessary restrictions. The structured suggestions in the following output are new:
```
error: equality constraints are not yet supported in `where` clauses
--> $DIR/missing-bounds.rs:37:33
|
LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
| ^^^^^^^^^^^^^^^^^^^^^^ not supported
|
= note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information
help: if `Output` is an associated type you're trying to set, use the associated type binding syntax
|
LL | impl<B: Add> Add for E<B> where B: Add<Output = B> {
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/missing-bounds.rs:11:11
|
7 | impl<B> Add for A<B> where B: Add {
| - this type parameter
...
11 | A(self.0 + rhs.0)
| ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
= note: expected type parameter `B`
found associated type `<B as std::ops::Add>::Output`
help: consider further restricting this bound
|
7 | impl<B> Add for A<B> where B: Add + std::ops::Add<Output = B> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0369]: cannot add `B` to `B`
--> $DIR/missing-bounds.rs:31:21
|
31 | Self(self.0 + rhs.0)
| ------ ^ ----- B
| |
| B
|
help: consider restricting type parameter `B`
|
27 | impl<B: std::ops::Add<Output = B>> Add for D<B> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
That output is given for the following cases:
```rust
struct A<B>(B);
impl<B> Add for A<B> where B: Add {
type Output = Self;
fn add(self, rhs: Self) -> Self {
A(self.0 + rhs.0) //~ ERROR mismatched types
}
}
struct D<B>(B);
impl<B> Add for D<B> {
type Output = Self;
fn add(self, rhs: Self) -> Self {
Self(self.0 + rhs.0) //~ ERROR cannot add `B` to `B`
}
}
struct E<B>(B);
impl<B: Add> Add for E<B> where <B as Add>::Output = B {
type Output = Self;
fn add(self, rhs: Self) -> Self {
Self(self.0 + rhs.0)
}
}
```
|
|
|
|
|
|
Ignore SGX on a few ui tests
cc @jethrogb
|
|
Define UB in float-to-int casts to saturate
This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
|
|
|
|
|
|
- Round to zero, and representable values cast directly.
- `NaN` goes to 0
- Values beyond the limits of the type are saturated to the "nearest value"
(essentially rounding to zero, in some sense) in the integral type, so e.g.
`f32::INFINITY` would go to `{u,i}N::MAX.`
|
|
|
|
SipHasher with keys initialized to 0 should just use new()
I believe that is what the `new()` is for, for good reasons.
|
|
|
|
|
|
|
|
|
|
|
|
|