You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix fn item implied bounds and wf check
These are two distinct changes:
1. Wf-check all fn item substs.
Fixesrust-lang#104005
2. Use implied bounds from impl header.
Fixesrust-lang#98852Fixesrust-lang#102611
The first is a breaking change and will likely have big impact without the the second one. See the first commit for how it breaks libstd.
Landing the second one without the first will allow more incorrect code to pass. For example an exploit of rust-lang#104005 would be as simple as:
```rust
use core::fmt::Display;
trait ExtendLt<Witness> {
fn extend(self) -> Box<dyn Display>;
}
impl<T: Display> ExtendLt<&'static T> for T {
fn extend(self) -> Box<dyn Display> {
Box::new(self)
}
}
fn main() {
let val = (&String::new()).extend();
println!("{val}");
}
```
cc `@lcnr`
r? types
0 commit comments