Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d4fda66
mk: Specify armv6 for gcc on arm-unknown-linux-*
alexcrichton Feb 21, 2016
a23e4fc
Add crate_name in E0152 error display
GuillaumeGomez Feb 22, 2016
dfe72fa
Add test for E0152 error message improvement
GuillaumeGomez Feb 20, 2016
b49ce1a
Fix warn(unused_mut) in example
kevinastock Feb 23, 2016
60ce31a
Correct char.encode_utf16() documentation
tormol Feb 23, 2016
b38a856
Don't show associated consts from trait impls
mitaa Feb 23, 2016
f5df7e0
Show associated types in inherent impls
mitaa Feb 23, 2016
3358fb1
Fix the visibility of extern crate declarations and stop warning on p…
jseyfried Feb 2, 2016
f8d6dcf
Warn when reexporting a private extern crate
jseyfried Feb 2, 2016
5172745
Warn instead of error when using an inaccessable extern crate
jseyfried Feb 12, 2016
d34c6ee
Use a character that requires two `u16`s in the examples for `char.en…
tormol Feb 24, 2016
7ad7065
Uncapitalize note messages
jseyfried Feb 24, 2016
27ca250
Allow creation of src-links for device files
mitaa Feb 24, 2016
cf76fcf
Fix source-links for files with absolute-paths
mitaa Feb 23, 2016
1282833
rustc: Refactor how unstable flags are handled
alexcrichton Feb 20, 2016
a48f958
Rollup merge of #31362 - jseyfried:fix_extern_crate_visibility, r=nik…
Manishearth Feb 25, 2016
05485be
Rollup merge of #31793 - alexcrichton:add-real-option-gating, r=nikom…
Manishearth Feb 25, 2016
db86810
Rollup merge of #31800 - alexcrichton:armv6-plz, r=brson
Manishearth Feb 25, 2016
7731cdc
Rollup merge of #31818 - GuillaumeGomez:error_display, r=brson
Manishearth Feb 25, 2016
4cfa2ee
Rollup merge of #31827 - teoryn:patch-1, r=brson
Manishearth Feb 25, 2016
39f41c6
Rollup merge of #31831 - tormol:master, r=alexcrichton
Manishearth Feb 25, 2016
6078a86
Rollup merge of #31835 - mitaa:rdoc-global-src, r=alexcrichton
Manishearth Feb 25, 2016
e584a49
Rollup merge of #31837 - mitaa:rdoc-inherent-assoc, r=alexcrichton
Manishearth Feb 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ impl<'a, 'tcx> LanguageItemCollector<'a, 'tcx> {
// Check for duplicates.
match self.items.items[item_index] {
Some(original_def_id) if original_def_id != item_def_id => {
let cstore = &self.session.cstore;
span_err!(self.session, span, E0152,
"duplicate entry for `{}`", LanguageItems::item_name(item_index));
"duplicate entry for `{}`, first definition found in `{}`",
LanguageItems::item_name(item_index),
cstore.crate_name(item_def_id.krate));
}
Some(_) | None => {
_ => {
// OK.
}
}
Expand Down
22 changes: 22 additions & 0 deletions src/test/compile-fail/duplicate_entry_error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test for issue #31788

// error-pattern: duplicate entry for `panic_fmt`, first definition found in `std`

#![feature(lang_items)]

#[lang = "panic_fmt"]
fn panic_fmt() -> ! {
loop {}
}

fn main() {}