Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d3a4f36

Browse files
committedMar 27, 2015
rollup merge of rust-lang#23786: alexcrichton/less-quotes
Conflicts: src/test/auxiliary/static-function-pointer-aux.rs src/test/auxiliary/trait_default_method_xc_aux.rs src/test/run-pass/issue-4545.rs
2 parents 1c0e1a8 + e77db16 commit d3a4f36

File tree

100 files changed

+259
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+259
-300
lines changed
 

‎src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ extern crate pcre;
937937
938938
extern crate std; // equivalent to: extern crate std as std;
939939
940-
extern crate "std" as ruststd; // linking to 'std' under another name
940+
extern crate std as ruststd; // linking to 'std' under another name
941941
```
942942

943943
##### Use declarations

‎src/librustc/metadata/creader.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,20 @@ struct CrateInfo {
7373
}
7474

7575
pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
76-
let say = |s: &str, warn: bool| {
76+
let say = |s: &str| {
7777
match (sp, sess) {
7878
(_, None) => panic!("{}", s),
79-
(Some(sp), Some(sess)) if warn => sess.span_warn(sp, s),
8079
(Some(sp), Some(sess)) => sess.span_err(sp, s),
81-
(None, Some(sess)) if warn => sess.warn(s),
8280
(None, Some(sess)) => sess.err(s),
8381
}
8482
};
8583
if s.len() == 0 {
86-
say("crate name must not be empty", false);
87-
} else if s.contains("-") {
88-
say(&format!("crate names soon cannot contain hyphens: {}", s), true);
84+
say("crate name must not be empty");
8985
}
9086
for c in s.chars() {
9187
if c.is_alphanumeric() { continue }
92-
if c == '_' || c == '-' { continue }
93-
say(&format!("invalid character `{}` in crate name: `{}`", c, s), false);
88+
if c == '_' { continue }
89+
say(&format!("invalid character `{}` in crate name: `{}`", c, s));
9490
}
9591
match sess {
9692
Some(sess) => sess.abort_if_errors(),
@@ -306,13 +302,7 @@ impl<'a> CrateReader<'a> {
306302
-> Option<ast::CrateNum> {
307303
let mut ret = None;
308304
self.sess.cstore.iter_crate_data(|cnum, data| {
309-
// For now we do a "fuzzy match" on crate names by considering
310-
// hyphens equal to underscores. This is purely meant to be a
311-
// transitionary feature while we deprecate the quote syntax of
312-
// `extern crate` statements.
313-
if data.name != name.replace("-", "_") {
314-
return
315-
}
305+
if data.name != name { return }
316306

317307
match hash {
318308
Some(hash) if *hash == data.hash() => { ret = Some(cnum); return }

0 commit comments

Comments
 (0)
Please sign in to comment.