Skip to content
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

duplicate definition of module core with bad span #2274

Closed
brson opened this issue Apr 24, 2012 · 2 comments
Closed

duplicate definition of module core with bad span #2274

brson opened this issue Apr 24, 2012 · 2 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Apr 24, 2012

A crate that uses the core library gets a mysterious error message with a dummy span.

#[link(name = "rustmeta",                                                                                                                                                     
       vers = "0.2",                                                                                                                                                          
       uuid = "f19085c3-dd45-467d-b76b-cb07e5ecd13c")];                                                                                                                       

#[crate_type = "lib"];                                                                                                                                                        

use core(vers = "0.2");                                                                                                                                                       
use std(vers = "0.2");                                                                                                                                                        
use rustsyntax(vers = "0.2");                                                                                                                                                 

import core::*;                                                                                                                                                               
import syntax = rustsyntax;
../src/librustmeta/rustmeta.rc:1:0: 1:0 error: duplicate definition of module core
../src/librustmeta/rustmeta.rc:1 #[link(name = "rustmeta",

We know this happened because of the injected core library, so we should say so.

@marijnh
Copy link
Contributor

marijnh commented Apr 24, 2012

Or even simply not auto-inject core when it is already explicitly used. Some people just like to be explicit.

@bstrie
Copy link
Contributor

bstrie commented Apr 26, 2013

Compiling this updated example:

#[link(name = "rustmeta",
       vers = "0.2",
       uuid = "f19085c3-dd45-467d-b76b-cb07e5ecd13c")];

#[crate_type = "lib"];

extern mod core;

use core::*;

compiles with:

$ rustc co.rs
co.rs:9:4: 9:12 warning: unused import
co.rs:9 use core::*;
            ^~~~~~~~

and correctly produces librustmeta-279555307fd8ef-0.2.so.

@bstrie bstrie closed this as completed Apr 26, 2013
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
trophy case: add the data race in thread::scope
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
This PR adds benchcomp, a tool for comparing one or more suites of benchmarks using two or more 'variants' (command line arguments and environment variables).

benchcomp runs all combinations of suite x variant, parsing the unique output formats of each of these runs. benchcomp then combines the parsed outputs and writes them into a single file. benchcomp can post-process that combined file to create visualizations, exit if the results are not as expected, or perform other actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants