Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing unused wrapper to libc::close. #14711

Closed
wants to merge 1 commit into from
Closed

Removing unused wrapper to libc::close. #14711

wants to merge 1 commit into from

Conversation

darnuria
Copy link
Contributor

@darnuria darnuria commented Jun 7, 2014

It's not used and it passes the test after removing.
And some function inside rust repository reimplement it in severals ways like in:
src/libnative/io/helper_thread.rs:

169:    pub fn close(fd: libc::c_int) {
170-        let _fd = FileDesc::new(fd, true);
171-    }
172-}

Or directly use libc::CloseHandler
src/libnative/io/helper_thread.rs:

194:    pub fn close(handle: HANDLE) {
195-        assert!(unsafe { CloseHandle(handle) != 0 });
196-    }

Or libc::close:
src/librustdoc/flock.rs:

108-            if ret == -1 {
109:                unsafe { libc::close(fd); }
110-                fail!("could not lock `{}`", p.display())
111-            }

@bors bors closed this in e87e180 Jun 7, 2014
ogham added a commit to ogham/exa that referenced this pull request Apr 23, 2015
Exa now uses the new IO, Path, and Filesystem libraries that have been out for a while now.

Unfortunately, the new libraries don't *entirely* cover the range of the old libraries just yet: in particular, to become more cross-platform, the data in `UnstableFileStat` isn't available in the Unix `MetadataExt` yet. Much of this is contained in rust-lang/rfcs#1044 (which is due to be implemented in rust-lang/rust#14711), but it's not *entirely* there yet.

As such, this commits a serious loss of functionality: no symlink viewing, no hard links or blocks, or users or groups. Also, some of the code could now be optimised. I just wanted to commit this to sort out most of the 'teething problems' of having a different path system in advance.

Here's an example problem that took ages to fix for you, just because you read this far: when I first got exa to compile, it worked mostly fine, except calling `exa` by itself didn't list the current directory. I traced where the command-line options were being generated, to where files and directories were sorted, to where the threads were spawned... and the problem turned out to be that it was using the full path as the file name, rather than just the last component, and these paths happened to begin with `.`, so it thought they were dotfiles.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
feat: Highlight closure captures when cursor is on pipe or move keyword

This runs into the same issue on vscode as exit points for `->`, where highlights are only triggered on identifiers, rust-lang/rust-analyzer#9395

Though putting the cursor on `move` should at least work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant