about summary refs log tree commit diff
path: root/src/libterm
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-07-07 16:35:15 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-07-17 14:05:36 -0700
commitde70d76373e05fcf0f421cedb185b08de10a714c (patch)
treeccfdaa415ce2bb947f40746a3b06a8980ab6cd16 /src/libterm
parentca24abd4d2d02dd96ef323074c9a21d44b3fd202 (diff)
downloadrust-de70d76373e05fcf0f421cedb185b08de10a714c.tar.gz
rust-de70d76373e05fcf0f421cedb185b08de10a714c.zip
librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,
except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]
Diffstat (limited to 'src/libterm')
-rw-r--r--src/libterm/terminfo/searcher.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libterm/terminfo/searcher.rs b/src/libterm/terminfo/searcher.rs
index 7ad14d79754..ebec59924e8 100644
--- a/src/libterm/terminfo/searcher.rs
+++ b/src/libterm/terminfo/searcher.rs
@@ -79,7 +79,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<Path>> {
 pub fn open(term: &str) -> Result<File, String> {
     match get_dbpath_for_term(term) {
         Some(x) => {
-            match File::open(x) {
+            match File::open(&*x) {
                 Ok(file) => Ok(file),
                 Err(e) => Err(format!("error opening file: {}", e)),
             }