-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Rollup of 12 pull requests #62882
Rollup of 12 pull requests #62882
Commits on Jul 9, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5397dfc - Browse repository at this point
Copy the full SHA 5397dfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 01d93bf - Browse repository at this point
Copy the full SHA 01d93bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 283f676 - Browse repository at this point
Copy the full SHA 283f676View commit details -
Configuration menu - View commit details
-
Copy full SHA for b62a77b - Browse repository at this point
Copy the full SHA b62a77bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 50840ee - Browse repository at this point
Copy the full SHA 50840eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 837fe7b - Browse repository at this point
Copy the full SHA 837fe7bView commit details -
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d0635ee - Browse repository at this point
Copy the full SHA d0635eeView commit details -
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for bbc9366 - Browse repository at this point
Copy the full SHA bbc9366View commit details -
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5f7768a - Browse repository at this point
Copy the full SHA 5f7768aView commit details
Commits on Jul 13, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d73c23d - Browse repository at this point
Copy the full SHA d73c23dView commit details
Commits on Jul 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3f77f2c - Browse repository at this point
Copy the full SHA 3f77f2cView commit details
Commits on Jul 19, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 469b7a9 - Browse repository at this point
Copy the full SHA 469b7a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6735a6 - Browse repository at this point
Copy the full SHA c6735a6View commit details -
Revert "Disable stack probing for gnux32."
This reverts commit 42d652e.
Configuration menu - View commit details
-
Copy full SHA for 10d4159 - Browse repository at this point
Copy the full SHA 10d4159View commit details -
Configuration menu - View commit details
-
Copy full SHA for b361864 - Browse repository at this point
Copy the full SHA b361864View commit details -
rustc: Compile the
fmt_macros
crate as an rlibI think this was left out by accident from the "convert everything to rlibs" commit, there's no need for this to be a dylib just as everything else doesn't need to be a dylib!
Configuration menu - View commit details
-
Copy full SHA for c1b4d62 - Browse repository at this point
Copy the full SHA c1b4d62View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6e027d - Browse repository at this point
Copy the full SHA c6e027dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e73386 - Browse repository at this point
Copy the full SHA 0e73386View commit details
Commits on Jul 20, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 2641bed - Browse repository at this point
Copy the full SHA 2641bedView commit details -
Break dependencies between
syntax_ext
and some other cratesMove `source_uitil` macros into `syntax_ext` Cleanup dependencies of `rustc_driver`
Configuration menu - View commit details
-
Copy full SHA for 97e8d67 - Browse repository at this point
Copy the full SHA 97e8d67View commit details -
Configuration menu - View commit details
-
Copy full SHA for 995429d - Browse repository at this point
Copy the full SHA 995429dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1196dfe - Browse repository at this point
Copy the full SHA 1196dfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for b93d2ac - Browse repository at this point
Copy the full SHA b93d2acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 188330b - Browse repository at this point
Copy the full SHA 188330bView commit details -
syntax_ext:
proc_macro_decls
->proc_macro_harness
Few other minor renamings for consistency. Remove one unused dependency from `rustc_passes`. Fix libsyntax tests. Fix rebase.
Configuration menu - View commit details
-
Copy full SHA for ec5f089 - Browse repository at this point
Copy the full SHA ec5f089View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21b502b - Browse repository at this point
Copy the full SHA 21b502bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e6b13a - Browse repository at this point
Copy the full SHA 2e6b13aView commit details
Commits on Jul 21, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 18dceab - Browse repository at this point
Copy the full SHA 18dceabView commit details -
sync with nomicon: raw ptr must be non-dangling and aligned every tim…
…e it is dereferenced
Configuration menu - View commit details
-
Copy full SHA for f502bf7 - Browse repository at this point
Copy the full SHA f502bf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4081222 - Browse repository at this point
Copy the full SHA 4081222View commit details -
Configuration menu - View commit details
-
Copy full SHA for e75ae15 - Browse repository at this point
Copy the full SHA e75ae15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 795d96d - Browse repository at this point
Copy the full SHA 795d96dView commit details
Commits on Jul 22, 2019
-
Configuration menu - View commit details
-
Copy full SHA for a7b9246 - Browse repository at this point
Copy the full SHA a7b9246View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9196781 - Browse repository at this point
Copy the full SHA 9196781View commit details -
Rollup merge of rust-lang#61779 - Zoxc:sharded, r=oli-obk
Use sharded maps for interning Cuts down runtime from 5.5s to 3.8s for non-incremental `syntex_syntax` check builds with 16 threads / 8 cores. r? @eddyb
Configuration menu - View commit details
-
Copy full SHA for c3aa3d8 - Browse repository at this point
Copy the full SHA c3aa3d8View commit details -
Rollup merge of rust-lang#62523 - pnkfelix:delay-bug-to-resolve-issue…
…-62203-ice, r=varkor Delay bug to resolve HRTB ICE Fix rust-lang#62203
Configuration menu - View commit details
-
Copy full SHA for 723fd5d - Browse repository at this point
Copy the full SHA 723fd5dView commit details -
Rollup merge of rust-lang#62528 - SimonSapin:concat, r=alexcrichton
Add joining slices of slices with a slice separator, not just a single item rust-lang#27747 (comment) > It's kinda annoying to be able to join strings with a str (which can have multiple chars), but joining a slice of slices, you can only join with a single element. This turns out to be fixable, with some possible inference regressions. # TL;DR Related trait(s) are unstable and tracked at rust-lang#27747, but the `[T]::join` method that is being extended here is already stable. Example use of the new insta-stable functionality: ```rust let nested: Vec<Vec<Foo>> = /* … */; let separator: &[Foo] = /* … */; // Previously: could only be a single &Foo nested.join(separator) ``` Complete API affected by this PR, after changes: ```rust impl<T> [T] { pub fn concat<Item: ?Sized>(&self) -> <Self as Concat<Item>>::Output where Self: Concat<Item> { Concat::concat(self) } pub fn join<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output where Self: Join<Separator> { Join::join(self, sep) } } // The `Item` parameter is only useful for the the slice-of-slices impl. pub trait Concat<Item: ?Sized> { type Output; fn concat(slice: &Self) -> Self::Output; } pub trait Join<Separator> { type Output; fn join(slice: &Self, sep: Separator) -> Self::Output; } impl<T: Clone, V: Borrow<[T]>> Concat<T> for [V] { type Output = Vec<T>; } impl<T: Clone, V: Borrow<[T]>> Join<&'_ T> for [V] { type Output = Vec<T>; } // New functionality here! impl<T: Clone, V: Borrow<[T]>> Join<&'_ [T]> for [V] { type Output = Vec<T>; } impl<S: Borrow<str>> Concat<str> for [S] { type Output = String; } impl<S: Borrow<str>> Join<&'_ str> for [S] { type Output = String; } ``` # Details After rust-lang#62403 but before this PR, the API is: ```rust impl<T> [T] { pub fn concat<Separator: ?Sized>(&self) -> T::Output where T: SliceConcat<Separator> { SliceConcat::concat(self) } pub fn join<Separator: ?Sized>(&self, sep: &Separator) -> T::Output where T: SliceConcat<Separator> { SliceConcat::join(self, sep) } } pub trait SliceConcat<Separator: ?Sized>: Sized { type Output; fn concat(slice: &[Self]) -> Self::Output; fn join(slice: &[Self], sep: &Separator) -> Self::Output; } impl<T: Clone, V: Borrow<[T]>> SliceConcat<T> for V { type Output = Vec<T>; } impl<S: Borrow<str>> SliceConcat<str> for S { type Output = String; } ``` By adding a trait impl we should be able to accept a slice of `T` as the separator, as an alternative to a single `T` value. In a `some_slice.join(some_separator)` call, trait resolution will pick an impl or the other based on the type of `some_separator`. In `some_slice.concat()` however there is no separator, so this call would become ambiguous. Some regression in type inference or trait resolution may be acceptable on principle, but requiring a turbofish for every single call to `concat` isn’t great. The solution to that is splitting the `SliceConcat` trait into two `Concat` and `Join` traits, one for each eponymous method. Only `Join` would gain a new impl, so that `some_slice.concat()` would not become ambiguous. Now, at the trait level the `Concat` trait does not need a `Separator` parameter anymore. However, simply removing it causes one of the impls not to be accepted anymore: ```rust error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates --> src/liballoc/slice.rs:608:6 | 608 | impl<T: Clone, V: Borrow<[T]>> Concat for [V] { | ^ unconstrained type parameter ``` This makes sense: if `[V]::concat` is a method that is itself not generic, then its return type (which is the `Concat::Output` associated type) needs to be determined based on solely `V`. And although there is no such type in the standard library, there is nothing stopping another crate from defining a `V` type that implements both `Borrow<[Foo]>` and `Borrow<[Bar]>`. It might not be a good idea, but it’s possible. Both would apply here, and there would be no way to determine `T`. This could be a warning sign that this API is too generic. Perhaps we’d be better off having one less type variable, and only implement `Concat for [&'_ [T]]` and `Concat for [Vec<T>]` etc. However this aspect of `[V]::concat` is already stable, so we’re stuck with it. The solution is to keep a dummy type parameter on the `Concat` trait. That way, if a type has multiple `Borrow<[_]>` impls, it’ll end up with multiple corresponding `Concat<_>` impls. In `impl<S: Borrow<str>> Concat<str> for [S]`, the second occurrence of `str` is not meaningful. It could be any type. As long as there is only once such type with an applicable impl, trait resolution will be appeased without demanding turbofishes. # Joining strings with `char` For symmetry I also tried adding this impl (because why not): ```rust impl<S: Borrow<str>> Join<char> for [S] { type Output = String; } ``` This immediately caused an inference regression in a dependency of rustc: ```rust error[E0277]: the trait bound `std::string::String: std::borrow::Borrow<[std::string::String]>` is not satisfied --> /home/simon/.cargo/registry/src/github.com-1ecc6299db9ec823/getopts-0.2.19/src/lib.rs:595:37 | 595 | row.push_str(&desc_rows.join(&desc_sep)); | ^^^^ the trait `std::borrow::Borrow<[std::string::String]>` is not implemented for `std::string::String` | = help: the following implementations were found: <std::string::String as std::borrow::Borrow<str>> = note: required because of the requirements on the impl of `std::slice::Join<&std::string::String>` for `[std::string::String]` ``` In the context of this code, two facts are known: * `desc_rows` is a `Vec<String>` * `desc_sep` is a `String` Previously the first fact alone reduces the resolution of `join` to only one solution, where its argument it expected to be `&str`. Then, `&String` is coerced to `&str`. With the new `Join` impl, the first fact leavs two applicable impls where the separator can be either `&str` or `char`. But `&String` is neither of these things. It appears that possible coercions are not accounted for, in the search for a solution in trait resolution. I have not included this new impl in this PR. It’s still possible to add later, but the `getopts` breakage does not need to block the rest of the PR. And the functionality easy for end-user to duplicate: `slice_of_strings.join(&*char_separator.encode_utf8(&mut [0_u8, 4]))` The `&*` part of that last code snippet is another case of the same issue: `encode_utf8` returns `&mut str` which can be coerced to `&str`, but isn’t when trait resolution is ambiguous.
Configuration menu - View commit details
-
Copy full SHA for 9785008 - Browse repository at this point
Copy the full SHA 9785008View commit details -
Rollup merge of rust-lang#62656 - RalfJung:contains-no-own, r=Dylan-DPC
explain how to search in slice without owned data Cc rust-lang#62367
Configuration menu - View commit details
-
Copy full SHA for 966ba8d - Browse repository at this point
Copy the full SHA 966ba8dView commit details -
Rollup merge of rust-lang#62771 - petrochenkov:depext, r=eddyb
Break dependencies between `syntax_ext` and other crates Move `source_util` macros into `syntax_ext`. Move other early code generation facilities like standard library injection into `syntax_ext`. The only crate that depends on `syntax_ext` now is `rustc_interface` which is one of the "final" crates that depend on everything. Minor: Cleanup dependencies of `rustc_driver`, many of them are no longer used after introduction of `rustc_interface`. r? @eddyb
Configuration menu - View commit details
-
Copy full SHA for 8fad976 - Browse repository at this point
Copy the full SHA 8fad976View commit details -
Rollup merge of rust-lang#62804 - lundibundi:help-infer-const-static,…
… r=eddyb rustc_typeck: improve diagnostics for _ const/static declarations This continues rust-lang#62694 and adds type suggestions to const/static declarations with `_` type. r? @eddyb
Configuration menu - View commit details
-
Copy full SHA for 823d575 - Browse repository at this point
Copy the full SHA 823d575View commit details -
Rollup merge of rust-lang#62808 - crlf0710:gnux32_stack_probe, r=nikic
Revert "Disable stack probing for gnux32." This reverts commit 42d652e. (rust-lang#59686) Closes rust-lang#59674.
Configuration menu - View commit details
-
Copy full SHA for 8311f71 - Browse repository at this point
Copy the full SHA 8311f71View commit details -
Rollup merge of rust-lang#62813 - alexcrichton:less-dylib, r=Mark-Sim…
…ulacrum rustc: Compile the `fmt_macros` crate as an rlib I think this was left out by accident from the "convert everything to rlibs" commit, there's no need for this to be a dylib just as everything else doesn't need to be a dylib!
Configuration menu - View commit details
-
Copy full SHA for b704be5 - Browse repository at this point
Copy the full SHA b704be5View commit details -
Rollup merge of rust-lang#62817 - estebank:variant-sp, r=matthewjasper
Tweak span for variant not found error
Configuration menu - View commit details
-
Copy full SHA for cb1b6c9 - Browse repository at this point
Copy the full SHA cb1b6c9View commit details -
Rollup merge of rust-lang#62822 - RalfJung:pointers, r=Centril
Improve some pointer-related documentation
Configuration menu - View commit details
-
Copy full SHA for 1d5ea88 - Browse repository at this point
Copy the full SHA 1d5ea88View commit details -
Rollup merge of rust-lang#62842 - JohnTitor:test-for-58887, r=alexreg
Add tests for issue-58887 Closes rust-lang#58887
Configuration menu - View commit details
-
Copy full SHA for f7621c5 - Browse repository at this point
Copy the full SHA f7621c5View commit details -
Rollup merge of rust-lang#62859 - spastorino:rename-to-as-ref, r=Centril
Place::as_place_ref is now Place::as_ref r? @oli-obk
Configuration menu - View commit details
-
Copy full SHA for 80aa34d - Browse repository at this point
Copy the full SHA 80aa34dView commit details