Skip to content

Commit 87734b1

Browse files
committed
Fix tests
1 parent a6ae8ab commit 87734b1

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/librustc/session/config.rs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,15 @@ pub struct ExternEntry {
291291
pub public: bool
292292
}
293293

294+
impl ExternEntry {
295+
pub fn new_public(location: Option<String>) -> ExternEntry {
296+
ExternEntry {
297+
location,
298+
public: true
299+
}
300+
}
301+
}
302+
294303
impl Externs {
295304
pub fn new(data: BTreeMap<String, BTreeSet<ExternEntry>>) -> Externs {
296305
Externs(data)
@@ -2705,7 +2714,7 @@ mod tests {
27052714
build_session_options_and_crate_config,
27062715
to_crate_config
27072716
};
2708-
use crate::session::config::{LtoCli, LinkerPluginLto, PgoGenerate};
2717+
use crate::session::config::{LtoCli, LinkerPluginLto, PgoGenerate, ExternEntry};
27092718
use crate::session::build_session;
27102719
use crate::session::search_paths::SearchPath;
27112720
use std::collections::{BTreeMap, BTreeSet};
@@ -2851,33 +2860,45 @@ mod tests {
28512860
v1.externs = Externs::new(mk_map(vec![
28522861
(
28532862
String::from("a"),
2854-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2863+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2864+
ExternEntry::new_public(Some(String::from("c")))
2865+
]),
28552866
),
28562867
(
28572868
String::from("d"),
2858-
mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
2869+
mk_set(vec![ExternEntry::new_public(Some(String::from("e"))),
2870+
ExternEntry::new_public(Some(String::from("f")))
2871+
]),
28592872
),
28602873
]));
28612874

28622875
v2.externs = Externs::new(mk_map(vec![
28632876
(
28642877
String::from("d"),
2865-
mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
2878+
mk_set(vec![ExternEntry::new_public(Some(String::from("e"))),
2879+
ExternEntry::new_public(Some(String::from("f")))
2880+
]),
28662881
),
28672882
(
28682883
String::from("a"),
2869-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2884+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2885+
ExternEntry::new_public(Some(String::from("c")))
2886+
]),
28702887
),
28712888
]));
28722889

28732890
v3.externs = Externs::new(mk_map(vec![
28742891
(
28752892
String::from("a"),
2876-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2893+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2894+
ExternEntry::new_public(Some(String::from("c")))
2895+
]),
28772896
),
28782897
(
28792898
String::from("d"),
2880-
mk_set(vec![Some(String::from("f")), Some(String::from("e"))]),
2899+
mk_set(vec![ExternEntry::new_public(Some(String::from("f"))),
2900+
ExternEntry::new_public(Some(String::from("e")))
2901+
]),
28812902
),
28822903
]));
28832904

0 commit comments

Comments
 (0)