Require that the meta items in a use statement have unique names
This commit is contained in:
parent
a793b85fbd
commit
375f0b2211
@ -58,6 +58,8 @@ fn find_library_crate(&session::session sess, &ast::ident ident,
|
||||
&vec[str] library_search_paths) ->
|
||||
option::t[tup(str, vec[u8])] {
|
||||
|
||||
attr::require_unique_names(sess, metas);
|
||||
|
||||
auto crate_name = {
|
||||
auto name_items = attr::find_meta_items_by_name(metas, "name");
|
||||
alt (vec::last(name_items)) {
|
||||
|
7
src/test/compile-fail/use-meta-dup.rs
Normal file
7
src/test/compile-fail/use-meta-dup.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// xfail-stage0
|
||||
// error-pattern:duplicate meta item `name`
|
||||
|
||||
use std(name = "std",
|
||||
name = "nonstd");
|
||||
|
||||
fn main(){}
|
Loading…
x
Reference in New Issue
Block a user