location / scoping of Impl #120753
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi,
I am learning Rust via rust-book.cs.brown.edu and I think one of the examples had an Impl for a struct placed within a function. So I was thinking about where Impls can be placed, and whether they can be out of scope. I wrote up the below code (without the added scoping) and it worked. However, it still worked when I added a layer of scoping as below.
I consulted a friend who said this may warrant a warning from the compiler, and I should create an issue for it.
Rustc version: rustc 1.75.0 (82e1608 2023-12-21) (built from a source tarball)
The text was updated successfully, but these errors were encountered: