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

Lots of commits related to I/O and the scheduler #6046

Merged
merged 62 commits into from
May 3, 2013
Merged

Conversation

brson
Copy link
Contributor

@brson brson commented Apr 24, 2013

r? @pcwalton

Sorry this is so big, and sorry the first commit is just titled 'wip'.

Some interesting bits

  • LocalServices - This is the set of runtime capabilities that all Rust code should expect access to, including the local heap, GC, logging, unwinding.
  • impl Reader, etc. for Option - Constructors like File::open return Option. This lets you write I/O code without ever unwrapping an option.

This series adds a lot of documentation to core::rt::io.

brson added 30 commits April 19, 2013 15:18
These should work now, I hope
There are some better abstractions for this now
Things like the GC heap and unwinding are desirable everywhere the language
might be used, not just in tasks. All Rust code should have access to
LocalServices.
I am going to use memory_region and boxed_region as the local heap
in the new scheduler, for now at least, and I don't have a rust_env
available.
Reusing the existing boxed_region implementation from the runtime
For consistency, for all I/O calls, inspecting the error can be done with
the io_error condition.
These will make it easier to write I/O code without worrying about errors
A task without an unwinder will abort the process on failure.
I'm using this in the runtime tests to guarantee that a call to
`assert!` actually triggers some kind of failure (an abort)
instead of silently doing nothing. This is essentially in lieu
of a working linked failure implementation.
This also reverts some changes to TLS that were leaking memory.

Conflicts:
	src/libcore/rt/uv/net.rs
	src/libcore/task/local_data_priv.rs
	src/libcore/unstable/lang.rs
@pnkfelix
Copy link
Member

@brson landing as is is fine with me, though I might try to sneak in and force that pub keyword into the syntax at some point soon. :)

Conflicts:
	src/libcore/task/local_data_priv.rs
brson and others added 20 commits April 30, 2013 17:45
I've added trt_field_vtable, trt_field_box, and trt_field_tydesc, and
inserted them in place of the "magic numbers" used to access trait
object fields through GEPi().
Lots of linking arguments need to be passed as -Wl,--foo so giving the
comma meaning at the rustc layer makes those flags impossible to pass.

Multiple arguments can now be passed from a shell by quoting the
argument: --link-args='-lfoo -Wl,--as-needed'.
- it is now cross platform, instead of just unix
- it now avoids sleeping (fixing issue rust-lang#6156)
- it now calls force_destroy() when force = true (was a bug)
These were accidentally un-xfail'ed since they pass on x64. They don't yet on x86.
…agic_nums, r=catamorphism,graydon

I don't know how one would write a separate test for this sort of thing. Building the compiler, and `make check` worked, which should mean I didn't screw anything.
Lots of linking arguments need to be passed as -Wl,--foo so giving the
comma meaning at the rustc layer makes those flags impossible to pass.

Multiple arguments can now be passed from a shell by quoting the
argument: --link-args='-lfoo -Wl,--as-needed'.
Recent demoding makes the visitor glue leak. It hasn't shown up in tests
because the box annihilator deletes the leaked boxes. This affects the
new scheduler though which does not yet have a box annihilator.

I don't think there's any great way to test this besides setting up
a task that doesn't run the box annihilator and I don't know that that's
a capability we want tasks to have.
Even more of `core::run` could be rust-ified -- I believe that access to the C extern environ can be done with rust now. I did not do this because some special casing is needed for OSX and I don't have a mac I can test with.

I think this will also fix rust-lang#6096.
@brson
Copy link
Contributor Author

brson commented May 3, 2013

now. it is going to pass. crosses fingers

Conflicts:
	mk/rt.mk
	src/libcore/run.rs
bors added a commit that referenced this pull request May 3, 2013
r? @pcwalton

Sorry this is so big, and sorry the first commit is just titled 'wip'.

Some interesting bits

* [LocalServices](brson@f9069ba) - This is the set of runtime capabilities that *all* Rust code should expect access to, including the local heap, GC, logging, unwinding.
* [impl Reader, etc. for Option](brson@5fbb094) - Constructors like `File::open` return Option<FileStream>. This lets you write I/O code without ever unwrapping an option.

This series adds a lot of [documentation](https://github.com/brson/rust/blob/io/src/libcore/rt/io/mod.rs#L11) to `core::rt::io`.
@bors bors closed this May 3, 2013
@bors bors merged commit 6c478c7 into rust-lang:incoming May 3, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 24, 2020
…st, r=flip1995

Change the criteria of `interior_mutable_const`

This implements my suggestion [here](rust-lang/rust-clippy#5050 (comment)), and so hopefully fixes rust-lang#5050.

* stop linting associated types and generic type parameters
* start linting ones in trait impls
  whose corresponding definitions in the traits are generic
* remove the `is_copy` check
  as presumably the only purpose of it is to allow
  generics with `Copy` bounds as `Freeze` is internal
  and generics are no longer linted
* remove the term 'copy' from the tests
  as being `Copy` no longer have meaning

---

changelog: Change the criteria of `declare_interior_mutable_const` and `borrow_interior_mutable_const` to narrow the lints to only lint things that defenitly is a interior mutable type, not potentially.
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.

10 participants