Skip to content

Commit 9ebc97a

Browse files
committed
Fix tests
1 parent 591e503 commit 9ebc97a

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/librustc/session/config.rs

+28-7
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@ pub struct ExternEntry {
276276
pub public: bool
277277
}
278278

279+
impl ExternEntry {
280+
pub fn new_public(location: Option<String>) -> ExternEntry {
281+
ExternEntry {
282+
location,
283+
public: true
284+
}
285+
}
286+
}
287+
279288
impl Externs {
280289
pub fn new(data: BTreeMap<String, BTreeSet<ExternEntry>>) -> Externs {
281290
Externs(data)
@@ -2677,7 +2686,7 @@ mod tests {
26772686
build_session_options_and_crate_config,
26782687
to_crate_config
26792688
};
2680-
use crate::session::config::{LtoCli, LinkerPluginLto};
2689+
use crate::session::config::{LtoCli, LinkerPluginLto, ExternEntry};
26812690
use crate::session::build_session;
26822691
use crate::session::search_paths::SearchPath;
26832692
use std::collections::{BTreeMap, BTreeSet};
@@ -2823,33 +2832,45 @@ mod tests {
28232832
v1.externs = Externs::new(mk_map(vec![
28242833
(
28252834
String::from("a"),
2826-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2835+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2836+
ExternEntry::new_public(Some(String::from("c")))
2837+
]),
28272838
),
28282839
(
28292840
String::from("d"),
2830-
mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
2841+
mk_set(vec![ExternEntry::new_public(Some(String::from("e"))),
2842+
ExternEntry::new_public(Some(String::from("f")))
2843+
]),
28312844
),
28322845
]));
28332846

28342847
v2.externs = Externs::new(mk_map(vec![
28352848
(
28362849
String::from("d"),
2837-
mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
2850+
mk_set(vec![ExternEntry::new_public(Some(String::from("e"))),
2851+
ExternEntry::new_public(Some(String::from("f")))
2852+
]),
28382853
),
28392854
(
28402855
String::from("a"),
2841-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2856+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2857+
ExternEntry::new_public(Some(String::from("c")))
2858+
]),
28422859
),
28432860
]));
28442861

28452862
v3.externs = Externs::new(mk_map(vec![
28462863
(
28472864
String::from("a"),
2848-
mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
2865+
mk_set(vec![ExternEntry::new_public(Some(String::from("b"))),
2866+
ExternEntry::new_public(Some(String::from("c")))
2867+
]),
28492868
),
28502869
(
28512870
String::from("d"),
2852-
mk_set(vec![Some(String::from("f")), Some(String::from("e"))]),
2871+
mk_set(vec![ExternEntry::new_public(Some(String::from("f"))),
2872+
ExternEntry::new_public(Some(String::from("e")))
2873+
]),
28532874
),
28542875
]));
28552876

0 commit comments

Comments
 (0)