- 16 11月, 2017 37 次提交
-
-
由 bors 提交于
Enable TrapUnreachable in LLVM. This patch enables LLVM's TrapUnreachable flag, which tells it to translate `unreachable` instructions into hardware trap instructions, rather than allowing control flow to "fall through" into whatever code happens to follow it in memory. This follows up on https://github.com/rust-lang/rust/issues/28728#issuecomment-332581533. For example, for @zackw's testcase [here](https://github.com/rust-lang/rust/issues/42009#issue-228745924), the output function contains a `ud2` instead of no code, so it won't "fall through" into whatever happens to be next in memory. (I'm also working on the problem of LLVM optimizing away infinite loops, but the patch here is useful independently.) I tested this patch on a few different codebases, and the code size increase ranged from 0.0% to 0.1%.
-
由 bors 提交于
Fix a bug where the rustfmt tarball was not being produced r? @alexcrichton This makes rustfmt a dep of 'extended', which seems to be necessary for the rustfmt dist step to actually get run.
-
由 Nick Cameron 提交于
-
由 bors 提交于
Start shipping the Cargo book Fixes #44910 Fixes #39588 See both of those bugs for more details.
-
由 Dan Gohman 提交于
-
由 bors 提交于
Implement `impl Trait` in argument position (RFC1951, Universal quantification) Implements the remainder of #44721, part of #34511. **Note**: This PR currently allows argument position `impl Trait` in trait functions. The machinery is there to prevent this if we want to, but it currently does not. Rename `hir::TyImplTrait` to `hir::TyImplTraitExistential` and add `hir::TyImplTraitUniversal(DefId, TyParamBounds)`. The `DefId` is needed to extract the index of the parameter in `ast_ty_to_ty`. Introduce an `ImplTraitContext` enum to lowering to keep track of the kind and allowedness of `impl Trait` in that position. This new argument is passed through many places, all ending up in `lower_ty`. Modify `generics_of` and `explicit_predicates_of` to collect the `impl Trait` args into anonymous synthetic generic parameters and to extend the predicates with the appropriate bounds. Add a comparison of the 'syntheticness' of type parameters, that is, prevent the following. ```rust trait Foo { fn foo(&self, &impl Debug); } impl Foo for Bar { fn foo<U: Debug>(&self, x: &U) { ... } } ``` And vice versa. Incedentally, supress `unused type parameter` errors if the type being compared is already a `TyError`. **TODO**: I have tried to annotate open questions with **FIXME**s. The most notable ones that haven't been resolved are the names of the `impl Trait` types and the questions surrounding the new `compare_synthetic_generics` method. 1. For now, the names used for `impl Trait` parameters are `keywords::Invalid.name()`. I would like them to be `impl ...` if possible, but I haven't figured out a way to do that yet. 2. For `compare_synthetic_generics` I have tried to outline the open questions in the [function itself](https://github.com/chrisvittal/rust/blob/3fc9e3705f7bd01f3cb0ea470cf2892f17a92350/src/librustc_typeck/check/compare_method.rs#L714-L725) r? @nikomatsakis
-
由 Christopher Vittal 提交于
-
由 Niko Matsakis 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
We already disallowed them to be in the arg list, such as Fn(impl Debug), but now we disallow Fn() -> impl Debug. Also remove the ImplTraitContext argument from the function lower_parenthesized_parameter_data as it is now unused. Comment out part of test run-pass/impl-trait/xcrate.rs that now fails.
-
由 Christopher Vittal 提交于
Add requested comments, restructure some small bits of code. Fix extern declarations allowing impl Trait.
-
由 Chris Vittal 提交于
Uses Symbol::intern and hir.node_to_pretty_string to create a name for the impl Trait parameter that is just impl and then a ' + ' separated list of bounds that the user typed.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
It'd be good to have a positive test for each case where it is allowed, I should think.
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
also merge disallowed and disallowed-2 into that set
-
由 Niko Matsakis 提交于
-
由 Niko Matsakis 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
Move feature gate check to inside HIR lowering. Change error messages and update tests.
-
由 Christopher Vittal 提交于
First some background: To the compiler, the following two signatures in the trait vs the impl are the same. ```rust trait Foo { fn foo(&self, &impl Debug); } impl Foo for () { fn foo<U: Debug>(&self, x: &U) { ... } } ``` We do not want to allow this, and so we add a new error and check. The check just tests that all paramters 'syntheticness' match up. As during collection, the impl Trait parameters are transformed into anonymous synthetic generics. Furthermore, causes a check for unused type parameters to be skipped in check_bounds_are_used if there is already a TyError. Thus, an unused input will not trigger `type parameter unused` errors. Update the one test that checked for this error in the case of a TyError.
-
由 Christopher Vittal 提交于
-
由 Christopher Vittal 提交于
In ast_generics extraction in generics_of and explicit_predicates_of, also collect inputs if there are any. Then use a Visitor to extract the necessary information from the TyImplTraitUniversal types before extending generics and predicates with the new information.
-
由 Christopher Vittal 提交于
This is for tracking if an ImplItem is part of a trait impl. Add a with_trait_impl_ref method to ItemLowerer to appropriately save the state to allow appropriate nesting of trait and non-trait impls.
-
由 Christopher Vittal 提交于
Replace hir::TyImplTrait with TyImplTraitUniversal and TyImplTraitExistential. Add an ImplTraitContext enum to rustc::hir::lowering to track the kind and allowedness of an impl Trait. Significantly alter lowering to thread ImplTraitContext and one other boolean parameter described below throughought much of lowering. The other parameter is for tracking if lowering a function is in a trait impl, as there is not enough information to otherwise know this information during lowering otherwise. This change also removes the checks from ast_ty_to_ty for impl trait allowedness as they are now all taking place in HIR lowering.
-
由 Christopher Vittal 提交于
With the check for impl trait moving from type checking to HIR lowering the error needs to move too.
-
由 bors 提交于
Fix End-user description not implemented for field access on `TyClosure - [x] Add Tests
-
由 bors 提交于
add `StorageDead` handling fix #45642 r? @arielb1
- 15 11月, 2017 3 次提交
-
-
由 bors 提交于
Reenable clippy testing fixes #45680
-
由 Oliver Schneider 提交于
-
由 Mikhail Modin 提交于
-