Skip to content

use self; gets entirely deleted #6558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emilyyyylime opened this issue May 9, 2025 · 1 comment
Open

use self; gets entirely deleted #6558

emilyyyylime opened this issue May 9, 2025 · 1 comment

Comments

@emilyyyylime
Copy link

before:

// hi
use me; // me
use self; // self
use this; // this
// bye

after:

// hi
 // self
use me; // me
use this; // this
// bye

use self; is indeed invalid but I think it's more useful for users to see the rustc error (self imports are only allowed within a { } list) than for the line to be entirely deleted.

@emilyyyylime
Copy link
Author

emilyyyylime commented May 9, 2025

I guess this also causes non-canonical formats :P (although eventually canonical):

use self::self::self::self;

->

use self::self::self;

->

use self::self;

->

use self;

->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant