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
struct Thing<T> {
thing: T
}
impl<T> Thing<T> {
fn get<T>(self) -> T {
self.thing
}
}
foo.rs:7:4: 7:14 error: mismatched types: expected `T` but found `T` (expected type parameter but found type parameter)
foo.rs:7 self.thing
^~~~~~~~~~
It's all right and proper but maybe we could come up with a way to denote that those two T come from different type parameter lists, or even ban type parameters shadowing each other.
The text was updated successfully, but these errors were encountered:
don't remove `dbg!` in arbitrary expressions
Fixesrust-lang#9914
The `dbg_macro` lint replaces empty `dbg!` invocations with the empty string in its suggestion, which is not always valid code in certain contexts (e.g. `let _ = dbg!();` becomes `let _ = ;`). This PR changes it to `()`, which should always be valid where `dbg!()` is valid (`dbg!()` with no arguments evaluates to `()`).
It also special-cases "standalone" `dbg!();` expression statements, where it will suggest removing the whole statement entirely like it did before.
changelog: [`dbg_macro`]: don't remove `dbg!()` in arbitrary expressions as it sometimes results in syntax errors
It's all right and proper but maybe we could come up with a way to denote that those two T come from different type parameter lists, or even ban type parameters shadowing each other.
The text was updated successfully, but these errors were encountered: