summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-11-20Adjust Ids of path segments in visibility modifiersNick Cameron-0/+25
Fixes #55376
2018-11-15std: Synchronize access to global env during `exec`Alex Crichton-0/+36
This commit, after reverting #55359, applies a different fix for #46775 while also fixing #55775. The basic idea was to go back to pre-#55359 libstd, and then fix #46775 in a way that doesn't expose #55775. The issue described in #46775 boils down to two problems: * First, the global environment is reset during `exec` but, but if the `exec` call fails then the global environment was a dangling pointer into free'd memory as the block of memory was deallocated when `Command` is dropped. This is fixed in this commit by installing a `Drop` stack object which ensures that the `environ` pointer is preserved on a failing `exec`. * Second, the global environment was accessed in an unsynchronized fashion during `exec`. This was fixed by ensuring that the Rust-specific environment lock is acquired for these system-level operations. Thanks to Alex Gaynor for pioneering the solution here! Closes #55775 Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-11-15Revert "Fixes #46775 -- don't mutate the process's environment in Command::exec"Alex Crichton-12/+0
This reverts commit 36fe3b605a7a7143a14565272140ba1b43c1b041.
2018-11-07fix test falloutAlex Burka-7/+7
2018-11-06Fixes #46775 -- don't mutate the process's environment in Command::execAlex Gaynor-0/+12
Instead, pass the environment to execvpe, so the kernel can apply it directly to the new process. This avoids a use-after-free in the case where exec'ing the new process fails for any reason, as well as a race condition if there are other threads alive during the exec.
2018-10-29resolve: Refactor away `legacy_macro_imports`/`LegacyMacroImports`Vadim Petrochenkov-0/+8
2018-10-25Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavisPietro Albini-1/+1
fix typos in various places
2018-10-25Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelixPietro Albini-0/+16
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix #25274.
2018-10-23fix typos in various placesMatthias Krüger-1/+1
2018-10-18Rollup merge of #55102 - petrochenkov:trextra, r=nikomatsakiskennytm-1/+1
resolve: Do not skip extern prelude during speculative resolution Fixes https://github.com/rust-lang/rust/issues/54665
2018-10-17resolve: Do not skip extern prelude during speculative resolutionVadim Petrochenkov-1/+1
2018-10-16Add ignore-compare-mode-nll to some run-pass tests that become compile-fail ↵Felix S. Klock II-0/+46
under #54986.
2018-10-15Rollup merge of #54820 - kleimkuhler:issue-54538-unused_patterns-lint, ↵Manish Goregaokar-0/+1
r=nikomatsakis Closes #54538: `unused_patterns` lint Closes #54538 r? @nikomatsakis
2018-10-12`#[must_use]` for associated functions is supposed to actually workZack M. Davis-1/+1
In the comments of (closed, defunct) pull request #54884, Mazdak "Centril" Farrokhzad noted that must-use annotations didn't work on an associated function (what other communities might call a "static method"). Subsequent logging revealed that in this case we have a `Def::Method`, whereas the lint pass was only matching on `Def::Fn`. (One could argue that those def-names are thereby misleading—must-use for self-ful methods have always worked—but documenting or reworking that can be left to another day.)
2018-10-11Auto merge of #54850 - mcr431:fix-54707-trait-function-from-macro, ↵bors-0/+42
r=nikomatsakis Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
2018-10-10Accept `Option<Box<$t:ty>>` in macro argumentEsteban Küber-0/+16
Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ```
2018-10-09Add clarifying pattern lint comment and revert testKevin Leimkuhler-1/+2
2018-10-09Simply unused_parens check and add testsKevin Leimkuhler-1/+1
2018-10-09Remove `feature(tool_lints)` from testsflip1995-2/+2
2018-10-08parse_trait_item_ now handles interpolated blocks as function body declsMatthew Russo-0/+42
2018-10-07Auto merge of #54810 - 1aim:unused-impl-trait, r=oli-obkbors-114/+1
Fix dead code lint for functions using impl Trait Fixes https://github.com/rust-lang/rust/issues/54754 This is a minimal fix that doesn't add any new queries or touches unnecessary code. Please nominate for beta backport if wanted.
2018-10-07Auto merge of #54835 - ↵bors-22/+0
oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril Stabilize `min_const_fn` tracking issue: #53555 r? @Centril
2018-10-07Auto merge of #54451 - alexcrichton:no-mangle-extern-linkage, r=michaelwoeristerbors-0/+1
rustc: Allow `#[no_mangle]` anywhere in a crate This commit updates the compiler to allow the `#[no_mangle]` (and `#[export_name]` attributes) to be located anywhere within a crate. These attributes are unconditionally processed, causing the compiler to always generate an exported symbol with the appropriate name. After some discussion on #54135 it was found that not a great reason this hasn't been allowed already, and it seems to match the behavior that many expect! Previously the compiler would only export a `#[no_mangle]` symbol if it were *publicly reachable*, meaning that it itself is `pub` and it's otherwise publicly reachable from the root of the crate. This new definition is that `#[no_mangle]` *is always reachable*, no matter where it is in a crate or whether it has `pub` or not. This should make it much easier to declare an exported symbol with a known and unique name, even when it's an internal implementation detail of the crate itself. Note that these symbols will persist beyond LTO as well, always making their way to the linker. Along the way this commit removes the `private_no_mangle_functions` lint (also for statics) as there's no longer any need to lint these situations. Furthermore a good number of tests were updated now that symbol visibility has been changed. Closes #54135
2018-10-06rustc: Allow `#[no_mangle]` anywhere in a crateAlex Crichton-0/+1
This commit updates the compiler to allow the `#[no_mangle]` (and `#[export_name]` attributes) to be located anywhere within a crate. These attributes are unconditionally processed, causing the compiler to always generate an exported symbol with the appropriate name. After some discussion on #54135 it was found that not a great reason this hasn't been allowed already, and it seems to match the behavior that many expect! Previously the compiler would only export a `#[no_mangle]` symbol if it were *publicly reachable*, meaning that it itself is `pub` and it's otherwise publicly reachable from the root of the crate. This new definition is that `#[no_mangle]` *is always reachable*, no matter where it is in a crate or whether it has `pub` or not. This should make it much easier to declare an exported symbol with a known and unique name, even when it's an internal implementation detail of the crate itself. Note that these symbols will persist beyond LTO as well, always making their way to the linker. Along the way this commit removes the `private_no_mangle_functions` lint (also for statics) as there's no longer any need to lint these situations. Furthermore a good number of tests were updated now that symbol visibility has been changed. Closes #54135
2018-10-05Stabilize `min_const_fn`Oliver Schneider-22/+0
2018-10-04rename skolemized to placeholderNiko Matsakis-2/+2
2018-10-04Convert conservative_impl_trait.rs to compile-passJonas Schievink-26/+0
2018-10-04Convert issue-49556.rs to compile-passJonas Schievink-31/+0
2018-10-04Convert issue-49376.rs to compile-passJonas Schievink-63/+0
2018-10-04Convert existential-minimal.rs to compile-passJonas Schievink-23/+0
2018-10-04Convert impl-trait/issue-42479.rs to compile-passJonas Schievink-41/+0
2018-10-04Call Foo::async_method in the async-await testJonas Schievink-14/+1
2018-10-04Fix dead code lint for functions using impl TraitJonas Schievink-0/+84
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-2/+7
2018-10-02Rollup merge of #54702 - RalfJung:fn-ptr-promotion, r=oli-obkPietro Albini-0/+8
do not promote comparing function pointers This *could* break existing code that relied on fn ptr comparison getting promoted to `'static` lifetime. Fixes https://github.com/rust-lang/rust/issues/54696
2018-10-02Rollup merge of #54680 - RalfJung:compile-pass, r=pnkfelixPietro Albini-7152/+0
make run-pass tests with empty main just compile-pass tests Many run-pass tests have an empty main, so there is not actually any point in running them. This makes them `compile-pass` tests instead, saving some time (generating the binary and then running it). For now I did this only for `run-pass/issues`; if there is interest I can also do it for the other directories. I used `^\s*fn\s+main\(\s*\)\s*\{\s*\}` as regexp to identify these files.
2018-10-02move some more testsRalf Jung-1416/+0
2018-10-02Auto merge of #54701 - arielb1:outlives-later, r=nikomatsakisbors-0/+54
normalize param-env type-outlives predicates last The normalization of type-outlives predicates can depend on misc. environment predicates, but not the other way around. Inferred lifetime bounds can propagate type-outlives bounds far and wide, so their normalization needs to work well. Fixes #54467 r? @nikomatsakis beta-nominating because this is required for inferred_outlives_bounds, which is in beta
2018-10-01normalize param-env type-outlives predicates lastAriel Ben-Yehuda-0/+54
The normalization of type-outlives predicates can depend on misc. environment predicates, but not the other way around. Inferred lifetime bounds can propagate type-outlives bounds far and wide, so their normalization needs to work well. Fixes #54467
2018-10-01Auto merge of #54667 - RalfJung:maybe-uninit, r=pnkfelixbors-0/+83
Panic when using mem::uninitialized or mem::zeroed on an uninhabited type All code by @japaric. This re-submits one half of https://github.com/rust-lang/rust/pull/53508. This is likely not the one that introduced the perf regression, but just to be sure I'll do a perf run anyway.
2018-10-01Rollup merge of #54676 - ↵kennytm-4/+3
pnkfelix:issue-15287-kill-zflag-disabling-ast-check, r=alexcrichton Remove `-Z disable_ast_check_for_mutation_in_guard` One should use `#![feature(bind_by_move_pattern_guards)]` over `-Z disable_ast_check_for_mutation_in_guard` cc #15287
2018-09-30do not promote comparing function pointersRalf Jung-0/+8
2018-09-30the test requires unwinding so we don't run it on the wasm32-bare targetJorge Aparicio-0/+1
2018-09-30allow dead_codeJorge Aparicio-0/+1
2018-09-30add empty enum to the test casesJorge Aparicio-0/+20
2018-09-30improve the run-pass testJorge Aparicio-4/+34
2018-09-30panic when instantiating an uninhabited type via mem::{uninitialized,zeroed}Jorge Aparicio-0/+31
2018-09-30make run-pass tests with empty main just compile-pass testsRalf Jung-5736/+0
2018-09-30Auto merge of #54596 - mjbshaw:drop, r=RalfJungbors-11/+48
Make core::mem::needs_drop a const fn This fixes #51929.
2018-09-30Auto merge of #54639 - nagisa:lets-alias-for-now, r=eddybbors-0/+33
Do not put noalias annotations by default This will be re-enabled sooner or later depending on results of further investigation. Fixes #54462 Beta backport is: #54640 r? @nikomatsakis