This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
8b1c424b6d
rust
/
src
/
test
/
ui
/
resolve
/
resolve-conflict-item-vs-extern-crate.rs
6 lines
92 B
Rust
Raw
Normal View
History
Unescape
Escape
Refactor away the field Module::external_module_children in resolve
2016-01-29 16:21:36 -06:00
fn
std
(
)
{
}
Clearer Error Message for Duplicate Definition Clearer use of the error message and span labels to communicate duplicaiton defitions/imports. New error format: ``` error[E0428]: the name `Foo` is defined twice --> example.rs:2:1 | 1 | trait Foo { } | ------------- previous definition of the trait `Foo` here 2 | struct Foo { } | ^^^^^^^^^^^^^^ `Foo` redefined here = note: `Foo` must be defined only once in the type namespace of this module error: aborting due to previous error ```
2017-05-17 22:29:58 -05:00
mod
std
{
}
//~ ERROR the name `std` is defined multiple times
librustc: Forbid external crates, imports, and/or items from being declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-12 22:31:30 -05:00
fn
main
(
)
{
}
Reference in New Issue
Copy Permalink