Use and aliases (use x as y)


#1

Is there any reason why this works:

use foo::bar1;
use foo::bar2 as baz;

and this not:

use foo::{bar1, bar2 as baz};

This seems inconsistent and unreasonable to me.


#2

Totally agree. I’ve found myself wanting to use that syntax a few times. Would love to see it added.


#3

+1


#4

:+1:


#5

:+1:


#6

I think this is a pretty easy change to make (tweak the AST, parser, and resolve a bit) but you probably want to file an rfc for this.


#7

I’ll repost it to internals and see how to proceed from there.


#8

New rfc was created. Comments are welcomed.